Loading src/saref_pypeline/check/TS103673_Clause_9_4_2_Checker.py +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ class Checker(BaseGraphDocumentChecker): @filter_clause def check_clause(self): self.prefixes = { prefix: str(namespace) for prefix, namespace in self.document.namespaces str(prefix): str(namespace) for prefix, namespace in self.document.namespaces } # Check prefixes in the ontology Loading src/saref_pypeline/check/TS103673_Clause_9_4_5_Checker.py +4 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,10 @@ class Checker(BaseGraphDocumentChecker): graph_with_imports = self.pipeline.dataset.graph( self.document.version_iri_with_imports ) graph_with_imports.serialize( to_serialize = Graph() to_serialize += graph_with_imports to_serialize.remove((None, OWL.imports, None)) to_serialize.serialize( destination=temp_file.name, format="ttl", encoding="utf-8" ) Loading src/saref_pypeline/pipeline.py +19 −7 Original line number Diff line number Diff line Loading @@ -308,6 +308,10 @@ class SAREFPipeline: for project_version in source.versions: if not self.filter_version(project_version): continue if self.strict: v = project_version.version if v.major == 0 or v.minor == 0 or v.micro == 0: continue self.load_version(project_version) # feature-gated imports Loading @@ -334,7 +338,7 @@ class SAREFPipeline: if self.mode is PipelineMode.WEBSITE: self.site_manager = SiteManager(self) self.generate_static_files() self.site_manager.generate_static_files() for source in self.projects_fetched: if not self.filter_project(source): Loading @@ -342,6 +346,10 @@ class SAREFPipeline: for project_version in source.versions: if not self.filter_version(project_version): continue if self.strict: v = project_version.version if v.major == 0 or v.minor == 0 or v.micro == 0: continue source.repo.git.checkout(project_version.branch_name) if self.mode == PipelineMode.CHECK: TS103673_Checker(self, project_version).check_clause() Loading @@ -364,6 +372,10 @@ class SAREFPipeline: for project_version in source.versions: if not self.filter_version(project_version): continue if self.strict: v = project_version.version if v.major == 0 or v.minor == 0 or v.micro == 0: continue self.site_manager.generate_terms_pages(project_version) def run_on_project(self, basename): Loading Loading @@ -518,12 +530,12 @@ class SAREFPipeline: versions.sort(key=lambda x: x.version) # Filter versions if strict if self.strict: versions = [ v for v in versions if v.branch_type in [BranchType.WORKING_DIRECTORY, BranchType.RELEASE] ] # if self.strict: # versions = [ # v # for v in versions # if v.branch_type in [BranchType.WORKING_DIRECTORY, BranchType.RELEASE] # ] logger.debug( f"{project.name} versions: {" < ".join([f"{version.version} ({version.branch_type})" for version in versions])}" Loading src/saref_pypeline/website/constants.py +1 −0 Original line number Diff line number Diff line NAME_SOURCES_PORTAL = "portal" NAME_SITE = "site" HTACCESS_PATH = "RewriteCond %{REQUEST_URI} ^(.*/)?[^/]*$\n" HTACCESS_PATH_GRAPH = "RewriteCond %{REQUEST_URI} ^(.*)?/[^/]*$\n" SAREF_PORTAL_STATIC_GIT = "https://labs.etsi.org/rep/saref/saref-portal.git" No newline at end of file src/saref_pypeline/website/resources/site/files/js/dismiss_toasts.js 0 → 100644 +41 −0 Original line number Diff line number Diff line document.addEventListener('DOMContentLoaded', function () { const toasts = document.querySelectorAll('.toast'); function hashString(str) { let hash = 5381; for (let i = 0; i < str.length; i++) { hash = ((hash << 5) + hash) + str.charCodeAt(i); // hash * 33 + c } return hash >>> 0; // force unsigned } let dismissed = []; try { dismissed = JSON.parse(localStorage.getItem('dismissedToasts')) || []; } catch (e) { dismissed = []; } toasts.forEach((toastEl, index) => { let toastId; if (toastEl.id) { toastId = toastEl.id; } else { const txt = toastEl.innerText.trim(); toastId = `hash_${hashString(txt)}`; } const bsToast = new bootstrap.Toast(toastEl, { autohide: false }); if (!dismissed.includes(toastId)) { bsToast.show(); } toastEl.addEventListener('hidden.bs.toast', () => { if (!dismissed.includes(toastId)) { dismissed.push(toastId); localStorage.setItem('dismissedToasts', JSON.stringify(dismissed)); } }); }); }); No newline at end of file Loading
src/saref_pypeline/check/TS103673_Clause_9_4_2_Checker.py +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ class Checker(BaseGraphDocumentChecker): @filter_clause def check_clause(self): self.prefixes = { prefix: str(namespace) for prefix, namespace in self.document.namespaces str(prefix): str(namespace) for prefix, namespace in self.document.namespaces } # Check prefixes in the ontology Loading
src/saref_pypeline/check/TS103673_Clause_9_4_5_Checker.py +4 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,10 @@ class Checker(BaseGraphDocumentChecker): graph_with_imports = self.pipeline.dataset.graph( self.document.version_iri_with_imports ) graph_with_imports.serialize( to_serialize = Graph() to_serialize += graph_with_imports to_serialize.remove((None, OWL.imports, None)) to_serialize.serialize( destination=temp_file.name, format="ttl", encoding="utf-8" ) Loading
src/saref_pypeline/pipeline.py +19 −7 Original line number Diff line number Diff line Loading @@ -308,6 +308,10 @@ class SAREFPipeline: for project_version in source.versions: if not self.filter_version(project_version): continue if self.strict: v = project_version.version if v.major == 0 or v.minor == 0 or v.micro == 0: continue self.load_version(project_version) # feature-gated imports Loading @@ -334,7 +338,7 @@ class SAREFPipeline: if self.mode is PipelineMode.WEBSITE: self.site_manager = SiteManager(self) self.generate_static_files() self.site_manager.generate_static_files() for source in self.projects_fetched: if not self.filter_project(source): Loading @@ -342,6 +346,10 @@ class SAREFPipeline: for project_version in source.versions: if not self.filter_version(project_version): continue if self.strict: v = project_version.version if v.major == 0 or v.minor == 0 or v.micro == 0: continue source.repo.git.checkout(project_version.branch_name) if self.mode == PipelineMode.CHECK: TS103673_Checker(self, project_version).check_clause() Loading @@ -364,6 +372,10 @@ class SAREFPipeline: for project_version in source.versions: if not self.filter_version(project_version): continue if self.strict: v = project_version.version if v.major == 0 or v.minor == 0 or v.micro == 0: continue self.site_manager.generate_terms_pages(project_version) def run_on_project(self, basename): Loading Loading @@ -518,12 +530,12 @@ class SAREFPipeline: versions.sort(key=lambda x: x.version) # Filter versions if strict if self.strict: versions = [ v for v in versions if v.branch_type in [BranchType.WORKING_DIRECTORY, BranchType.RELEASE] ] # if self.strict: # versions = [ # v # for v in versions # if v.branch_type in [BranchType.WORKING_DIRECTORY, BranchType.RELEASE] # ] logger.debug( f"{project.name} versions: {" < ".join([f"{version.version} ({version.branch_type})" for version in versions])}" Loading
src/saref_pypeline/website/constants.py +1 −0 Original line number Diff line number Diff line NAME_SOURCES_PORTAL = "portal" NAME_SITE = "site" HTACCESS_PATH = "RewriteCond %{REQUEST_URI} ^(.*/)?[^/]*$\n" HTACCESS_PATH_GRAPH = "RewriteCond %{REQUEST_URI} ^(.*)?/[^/]*$\n" SAREF_PORTAL_STATIC_GIT = "https://labs.etsi.org/rep/saref/saref-portal.git" No newline at end of file
src/saref_pypeline/website/resources/site/files/js/dismiss_toasts.js 0 → 100644 +41 −0 Original line number Diff line number Diff line document.addEventListener('DOMContentLoaded', function () { const toasts = document.querySelectorAll('.toast'); function hashString(str) { let hash = 5381; for (let i = 0; i < str.length; i++) { hash = ((hash << 5) + hash) + str.charCodeAt(i); // hash * 33 + c } return hash >>> 0; // force unsigned } let dismissed = []; try { dismissed = JSON.parse(localStorage.getItem('dismissedToasts')) || []; } catch (e) { dismissed = []; } toasts.forEach((toastEl, index) => { let toastId; if (toastEl.id) { toastId = toastEl.id; } else { const txt = toastEl.innerText.trim(); toastId = `hash_${hashString(txt)}`; } const bsToast = new bootstrap.Toast(toastEl, { autohide: false }); if (!dismissed.includes(toastId)) { bsToast.show(); } toastEl.addEventListener('hidden.bs.toast', () => { if (!dismissed.includes(toastId)) { dismissed.push(toastId); localStorage.setItem('dismissedToasts', JSON.stringify(dismissed)); } }); }); }); No newline at end of file