diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..846a31d --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,44 @@ +# This CITATION.cff file was generated with cffinit. +# Visit https://bit.ly/cffinit to generate yours today! + +cff-version: 1.2.0 +title: LODE - Live OWL Documentation Environment +message: >- + New reengineered version of LODE, maintained by + OpenCitations. +type: software +authors: + - given-names: Valentina + family-names: Pasqual + email: valentina.pasqual2@unibo.it + orcid: 'https://orcid.org/0000-0001-5931-5187' + affiliation: >- + Digital Humanities Advanced Research Centre (/DH.arc), + Department of Classical Philology and Italian Studies, + University of Bologna, Bologna, Italy + - given-names: Silvio + family-names: Peroni + email: silvio.peroni@unibo.it + affiliation: >- + Research Centre for Open Scholarly Metadata, + Department of Classical Philology and Italian Studies, + University of Bologna, Bologna, Italy + orcid: 'https://orcid.org/0000-0003-0530-4305' + - given-names: Ahmadreza + family-names: Nazari + orcid: 'https://orcid.org/0009-0000-3884-1575' + email: ahmadreza.nazari@studio.unibo.it + affiliation: >- + Digital Humanities and Digital Knowledge, Department + of Classical Philology and Italian Studies, University + of Bologna, Bologna, Italy +repository-code: 'https://github.com/opencitations/lode' +url: 'https://lode.opencitations.net/' +abstract: >- + LODE is a re-engineered and extensible framework for generating human-readable documentation of semantic artefacts. It preserves the established single-page, W3C Recommendation-style documentation paradigm of its legacy verision, while introducing a modular architecture that decouples artefact interpretation, internal representation, and rendering. This design enables the framework to support multiple semantic artefact types through configurable interpretation modules. The current implementation supports OWL ontology documentation. +keywords: + - Ontology documentation + - OWL ontologies + - Semantic artefacts documentation + - Web tool +license: ISC diff --git a/lode/api.py b/lode/api.py index 6491653..aef8c38 100644 --- a/lode/api.py +++ b/lode/api.py @@ -209,14 +209,17 @@ def _hold(m): out = out.replace(f"\x00MD{i}\x00", block) return out - -def _nav_qs(read_as: str, url, upload_id, lang) -> str: +def _nav_qs(read_as: str, url, upload_id, lang, imported, closure) -> str: p = {"read_as": read_as, "lang": lang or ""} p["upload_id" if upload_id else "url"] = upload_id or (url or "") + if imported: + p["imported"] = "true" + if closure: + p["closure"] = "true" return urlencode(p) - -def _render_view(request, reader, *, resource, lang, source_url, upload_id, read_as): +def _render_view(request, reader, *, resource, lang, source_url, upload_id, read_as, + imported=None, closure=None): viewer = reader.get_viewer() data = viewer.get_view_data(resource_uri=resource, language=lang) data["warnings"] = reader.get_warnings() @@ -224,7 +227,7 @@ def _render_view(request, reader, *, resource, lang, source_url, upload_id, read "request": request, "source_url": source_url, "upload_id": upload_id, - "nav_qs": _nav_qs(read_as, source_url, upload_id, lang), + "nav_qs": _nav_qs(read_as, source_url, upload_id, lang, imported, closure), **data, }) resp.body = _minify(resp.body.decode("utf-8")).encode("utf-8") @@ -491,7 +494,8 @@ def extract_get( logger.info("=== REQUEST SUCCESS ===") return _render_view(request, reader, resource=resource, lang=lang, - source_url=url, upload_id=upload_id, read_as=read_as.value) + source_url=url, upload_id=upload_id, read_as=read_as.value, + imported=imported, closure=closure) @app.post("/extract", response_class=HTMLResponse) @@ -520,7 +524,8 @@ async def extract_post( imported=imported, closure=closure, warnings=warnings, ) return _render_view(request, reader, resource=resource, lang=lang, - source_url=None, upload_id=token, read_as=read_as.value) + source_url=None, upload_id=token, read_as=read_as.value, + imported=imported, closure=closure) # ========================================================================== diff --git a/lode/templates/viewer.html b/lode/templates/viewer.html index 87f35cc..a7393b7 100644 --- a/lode/templates/viewer.html +++ b/lode/templates/viewer.html @@ -114,7 +114,7 @@