oc-lode 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. oc_lode-2.1.0/.gitignore +29 -0
  2. oc_lode-2.1.0/LICENSE.md +15 -0
  3. oc_lode-2.1.0/PKG-INFO +169 -0
  4. oc_lode-2.1.0/README.md +133 -0
  5. oc_lode-2.1.0/lode/__init__.py +2 -0
  6. oc_lode-2.1.0/lode/api.py +553 -0
  7. oc_lode-2.1.0/lode/builder.py +307 -0
  8. oc_lode-2.1.0/lode/cli.py +99 -0
  9. oc_lode-2.1.0/lode/exceptions.py +43 -0
  10. oc_lode-2.1.0/lode/helpers/__init__.py +1 -0
  11. oc_lode-2.1.0/lode/helpers/formats.py +32 -0
  12. oc_lode-2.1.0/lode/helpers/html_utils.py +32 -0
  13. oc_lode-2.1.0/lode/helpers/rdf.py +89 -0
  14. oc_lode-2.1.0/lode/helpers/spool.py +86 -0
  15. oc_lode-2.1.0/lode/models/__init__.py +38 -0
  16. oc_lode-2.1.0/lode/models/annotation.py +9 -0
  17. oc_lode-2.1.0/lode/models/atom.py +28 -0
  18. oc_lode-2.1.0/lode/models/attribute.py +13 -0
  19. oc_lode-2.1.0/lode/models/cardinality.py +29 -0
  20. oc_lode-2.1.0/lode/models/collection.py +29 -0
  21. oc_lode-2.1.0/lode/models/concept.py +156 -0
  22. oc_lode-2.1.0/lode/models/container.py +23 -0
  23. oc_lode-2.1.0/lode/models/datatype.py +9 -0
  24. oc_lode-2.1.0/lode/models/datatypeRestriction.py +28 -0
  25. oc_lode-2.1.0/lode/models/individual.py +40 -0
  26. oc_lode-2.1.0/lode/models/literal.py +40 -0
  27. oc_lode-2.1.0/lode/models/model.py +73 -0
  28. oc_lode-2.1.0/lode/models/oneOf.py +20 -0
  29. oc_lode-2.1.0/lode/models/property.py +96 -0
  30. oc_lode-2.1.0/lode/models/propertyConceptRestriction.py +37 -0
  31. oc_lode-2.1.0/lode/models/propertySelfRestriction.py +20 -0
  32. oc_lode-2.1.0/lode/models/quantifier.py +22 -0
  33. oc_lode-2.1.0/lode/models/relation.py +104 -0
  34. oc_lode-2.1.0/lode/models/resource.py +224 -0
  35. oc_lode-2.1.0/lode/models/restriction.py +10 -0
  36. oc_lode-2.1.0/lode/models/rule.py +27 -0
  37. oc_lode-2.1.0/lode/models/statement.py +49 -0
  38. oc_lode-2.1.0/lode/models/truthFunction.py +32 -0
  39. oc_lode-2.1.0/lode/models/value.py +28 -0
  40. oc_lode-2.1.0/lode/models/variable.py +9 -0
  41. oc_lode-2.1.0/lode/reader/README.md +215 -0
  42. oc_lode-2.1.0/lode/reader/__init__.py +16 -0
  43. oc_lode-2.1.0/lode/reader/config/base.yaml +201 -0
  44. oc_lode-2.1.0/lode/reader/config/owl.yaml +598 -0
  45. oc_lode-2.1.0/lode/reader/config/rdf.yaml +72 -0
  46. oc_lode-2.1.0/lode/reader/config/rdfs.yaml +69 -0
  47. oc_lode-2.1.0/lode/reader/config/skos.yaml +22 -0
  48. oc_lode-2.1.0/lode/reader/config_manager.py +295 -0
  49. oc_lode-2.1.0/lode/reader/loader.py +278 -0
  50. oc_lode-2.1.0/lode/reader/logic/__init__.py +15 -0
  51. oc_lode-2.1.0/lode/reader/logic/base_logic.py +892 -0
  52. oc_lode-2.1.0/lode/reader/logic/owl_logic.py +1104 -0
  53. oc_lode-2.1.0/lode/reader/logic/rdf_logic.py +253 -0
  54. oc_lode-2.1.0/lode/reader/logic/skos_logic.py +91 -0
  55. oc_lode-2.1.0/lode/reader/modules.py +229 -0
  56. oc_lode-2.1.0/lode/reader/provenance_graph.py +60 -0
  57. oc_lode-2.1.0/lode/reader/reader.py +292 -0
  58. oc_lode-2.1.0/lode/reader/security.py +221 -0
  59. oc_lode-2.1.0/lode/reader/warnings/__init__.py +15 -0
  60. oc_lode-2.1.0/lode/reader/warnings/owl_warnings.py +171 -0
  61. oc_lode-2.1.0/lode/static/style.css +1087 -0
  62. oc_lode-2.1.0/lode/templates/_card_owl.html +307 -0
  63. oc_lode-2.1.0/lode/templates/_card_skos.html +50 -0
  64. oc_lode-2.1.0/lode/templates/_toc_sidebar.html +95 -0
  65. oc_lode-2.1.0/lode/templates/_value.html +55 -0
  66. oc_lode-2.1.0/lode/templates/error.html +74 -0
  67. oc_lode-2.1.0/lode/templates/index.html +499 -0
  68. oc_lode-2.1.0/lode/templates/viewer.html +500 -0
  69. oc_lode-2.1.0/lode/viewer/__init__.py +28 -0
  70. oc_lode-2.1.0/lode/viewer/base_viewer.py +775 -0
  71. oc_lode-2.1.0/lode/viewer/config/model_annotations_deterministic_sorting.yaml +42 -0
  72. oc_lode-2.1.0/lode/viewer/config/owl_viewer.yaml +49 -0
  73. oc_lode-2.1.0/lode/viewer/config/rdf_viewer.yaml +39 -0
  74. oc_lode-2.1.0/lode/viewer/config/skos_viewer.yaml +17 -0
  75. oc_lode-2.1.0/lode/viewer/helpers.py +190 -0
  76. oc_lode-2.1.0/lode/viewer/owl_viewer.py +187 -0
  77. oc_lode-2.1.0/lode/viewer/rdf_viewer.py +8 -0
  78. oc_lode-2.1.0/lode/viewer/skos_viewer.py +172 -0
  79. oc_lode-2.1.0/pyproject.toml +68 -0
  80. oc_lode-2.1.0/tests/data/cito.ttl +1753 -0
  81. oc_lode-2.1.0/tests/data/provenance/anon.ttl +5 -0
  82. oc_lode-2.1.0/tests/data/provenance/deep.ttl +5 -0
  83. oc_lode-2.1.0/tests/data/provenance/home.ttl +12 -0
  84. oc_lode-2.1.0/tests/data/provenance/imp.ttl +10 -0
  85. oc_lode-2.1.0/tests/data/provenance/main.ttl +13 -0
  86. oc_lode-2.1.0/tests/data/provenance/ver.ttl +7 -0
  87. oc_lode-2.1.0/tests/ontologies_spar.json +85 -0
  88. oc_lode-2.1.0/tests/test_api.py +207 -0
  89. oc_lode-2.1.0/tests/test_modules.py +662 -0
  90. oc_lode-2.1.0/tests/test_owl_integrity.py +2772 -0
  91. oc_lode-2.1.0/tests/test_owl_logic.py +1810 -0
  92. oc_lode-2.1.0/tests/test_owl_viewer.py +558 -0
  93. oc_lode-2.1.0/tests/test_packaging.py +73 -0
  94. oc_lode-2.1.0/tests/test_reader.py +248 -0
  95. oc_lode-2.1.0/tests/test_security.py +685 -0
  96. oc_lode-2.1.0/tests/test_static_builder.py +219 -0
  97. oc_lode-2.1.0/tests/tests.md +40 -0
@@ -0,0 +1,29 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.so
5
+ build/
6
+ dist/
7
+ *.egg-info/
8
+
9
+ # Virtual environments
10
+ .venv/
11
+
12
+ # Testing
13
+ .pytest_cache/
14
+ .coverage
15
+ htmlcov/
16
+
17
+ # IDE
18
+ .vscode/
19
+ .idea/
20
+
21
+ # Starlight/Astro
22
+ site/
23
+
24
+ # saved files
25
+ spool/
26
+
27
+ # claude
28
+ CLAUDE.md
29
+ .claude/
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2025 Valentina Pasqual, Silvio Peroni
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
oc_lode-2.1.0/PKG-INFO ADDED
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.5
2
+ Name: oc-lode
3
+ Version: 2.1.0
4
+ Summary: New reengineered version of LODE, maintained by OpenCitations
5
+ Project-URL: Homepage, https://github.com/opencitations/lode
6
+ Project-URL: Repository, https://github.com/opencitations/lode
7
+ Project-URL: Documentation, https://opencitations.github.io/lode/
8
+ Project-URL: Issues, https://github.com/opencitations/lode/issues
9
+ Author: Ahmadreza Nazari
10
+ Author-email: Valentina Pasqual <valentina.pasqual2@unibo.it>, Silvio Peroni <silvio.peroni@unibo.it>
11
+ License-Expression: ISC
12
+ License-File: LICENSE.md
13
+ Keywords: documentation,ontology,opencitations,owl,rdf,semantic-web,skos
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Natural Language :: English
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Software Development :: Documentation
24
+ Requires-Python: >=3.10
25
+ Requires-Dist: jinja2>=3.1.2
26
+ Requires-Dist: minify-html>=0.18.1
27
+ Requires-Dist: pyyaml>=6.0
28
+ Requires-Dist: rdflib>=7.4.0
29
+ Requires-Dist: requests>=2.31.0
30
+ Provides-Extra: server
31
+ Requires-Dist: fastapi>=0.104.1; extra == 'server'
32
+ Requires-Dist: gunicorn>=21.0.0; extra == 'server'
33
+ Requires-Dist: python-multipart>=0.0.6; extra == 'server'
34
+ Requires-Dist: uvicorn[standard]>=0.24.0; extra == 'server'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # Lode
38
+
39
+ [![Run tests](https://github.com/opencitations/lode/actions/workflows/tests.yml/badge.svg)](https://github.com/opencitations/lode/actions/workflows/tests.yml)
40
+ [![Coverage](https://opencitations.github.io/lode/coverage/coverage-badge.svg)](https://opencitations.github.io/lode/coverage/)
41
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
42
+
43
+ Live Owl Documentation Enviroment (LODE) is an open source service that automatically extracts entities from semantic artefacts (OWL, RDF/RDFS, SKOS) and renders them, together with their textual definitions, as a human-readable HTML page designed for browsing and navigation through embedded links. This new reengineered version of LODE is maintained by OpenCitations.
44
+
45
+ **Try it online:** a hosted instance of the web service is available at https://lode.opencitations.net/, with no installation needed.
46
+
47
+
48
+ ## Installation
49
+
50
+ ```bash
51
+ pip install oc-lode
52
+
53
+ # with the web service (`lode serve`)
54
+ pip install "oc-lode[server]"
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ ```bash
60
+ # Build static documentation from an ontology URL or a local file
61
+ lode build --url <url> --read-as <owl|rdf|skos> [--out ./docs] [--lang en] [--artefact-name index] [--imported] [--closure]
62
+ lode build --file <path> --read-as <owl|rdf|skos> [--out ./docs]
63
+
64
+ # Run the web service locally (requires the [server] extra)
65
+ lode serve --port 8000
66
+ ```
67
+
68
+ ## Documentation
69
+
70
+ Full documentation is available at: https://opencitations.github.io/lode/
71
+
72
+ ## Prerequisites
73
+
74
+ This project uses [UV](https://docs.astral.sh/uv/) for dependency management.
75
+
76
+ ### Setup
77
+
78
+ ```bash
79
+ # Clone the repository
80
+ git clone https://github.com/opencitations/lode.git
81
+
82
+ # Enter the repo
83
+ cd lode
84
+
85
+ # Install dependencies
86
+ uv sync --all-extras --dev
87
+
88
+ # run locally
89
+ uv run python main.py
90
+
91
+ # open at
92
+ localhost:8000
93
+ ```
94
+
95
+ ## Docker
96
+
97
+ ### Build
98
+
99
+ ```bash
100
+ docker build -t lode .
101
+ ```
102
+
103
+ ### Run
104
+
105
+ ```bash
106
+ docker run -p 8080:8080 lode
107
+ ```
108
+
109
+ ### Run from Docker Hub
110
+
111
+ ```bash
112
+ docker run -p 8080:8080 opencitations/lode:latest
113
+ ```
114
+
115
+ Replace `latest` with the desired version tag.
116
+
117
+ The app will be available at `localhost:8080`.
118
+
119
+ ## Running tests
120
+
121
+ ```bash
122
+ uv run pytest tests/
123
+ ```
124
+
125
+ ## How to cite
126
+
127
+ If you use LODE, please cite both the paper and the software:
128
+
129
+ Pasqual, V., Nazari, A., Peroni, S. (2026). Supporting the understanding of ontologies for scientific knowledge graphs with the new version of LODE. In *Proceedings of the 6th International Workshop on Scientific Knowledge: Representation, Discovery, and Assessment (Sci-K 2026), co-located with the 25th International Semantic Web Conference (ISWC) 2026, Bari, Italy*, CEUR Workshop Proceedings, Vol. 4291, pp. 12–26. https://ceur-ws.org/Vol-4291/paper1.pdf
130
+
131
+ ```bibtex
132
+ @inproceedings{pasqual2026lode,
133
+ author = {Pasqual, Valentina and Nazari, Ahmadreza and Peroni, Silvio},
134
+ title = {Supporting the Understanding of Ontologies for Scientific Knowledge Graphs with the New Version of LODE},
135
+ booktitle = {Proceedings of the 6th International Workshop on Scientific Knowledge: Representation, Discovery, and Assessment (Sci-K 2026), co-located with the 25th International Semantic Web Conference (ISWC) 2026, Bari, Italy},
136
+ series = {CEUR Workshop Proceedings},
137
+ volume = {4291},
138
+ pages = {12--26},
139
+ publisher = {CEUR-WS.org},
140
+ issn = {1613-0073},
141
+ year = {2026},
142
+ url = {https://ceur-ws.org/Vol-4291/paper1.pdf}
143
+ }
144
+ ```
145
+
146
+ To cite the software (all versions), use this BibTeX entry:
147
+
148
+ ```bibtex
149
+ @software{lode,
150
+ author = {Pasqual, Valentina and Peroni, Silvio and Nazari, Ahmadreza},
151
+ title = {LODE - Live OWL Documentation Environment},
152
+ year = {2026},
153
+ publisher = {Zenodo},
154
+ doi = {10.5281/zenodo.21805185},
155
+ url = {https://github.com/opencitations/lode}
156
+ }
157
+ ```
158
+
159
+ <!-- ### Building documentation locally
160
+
161
+ ```bash
162
+ cd docs
163
+ npm install
164
+ npm run dev
165
+ ``` -->
166
+
167
+ ## License
168
+
169
+ This project is licensed under the ISC License - see the [LICENSE.md](https://github.com/opencitations/lode/blob/main/LICENSE.md) file for details.
@@ -0,0 +1,133 @@
1
+ # Lode
2
+
3
+ [![Run tests](https://github.com/opencitations/lode/actions/workflows/tests.yml/badge.svg)](https://github.com/opencitations/lode/actions/workflows/tests.yml)
4
+ [![Coverage](https://opencitations.github.io/lode/coverage/coverage-badge.svg)](https://opencitations.github.io/lode/coverage/)
5
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
6
+
7
+ Live Owl Documentation Enviroment (LODE) is an open source service that automatically extracts entities from semantic artefacts (OWL, RDF/RDFS, SKOS) and renders them, together with their textual definitions, as a human-readable HTML page designed for browsing and navigation through embedded links. This new reengineered version of LODE is maintained by OpenCitations.
8
+
9
+ **Try it online:** a hosted instance of the web service is available at https://lode.opencitations.net/, with no installation needed.
10
+
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ pip install oc-lode
16
+
17
+ # with the web service (`lode serve`)
18
+ pip install "oc-lode[server]"
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ # Build static documentation from an ontology URL or a local file
25
+ lode build --url <url> --read-as <owl|rdf|skos> [--out ./docs] [--lang en] [--artefact-name index] [--imported] [--closure]
26
+ lode build --file <path> --read-as <owl|rdf|skos> [--out ./docs]
27
+
28
+ # Run the web service locally (requires the [server] extra)
29
+ lode serve --port 8000
30
+ ```
31
+
32
+ ## Documentation
33
+
34
+ Full documentation is available at: https://opencitations.github.io/lode/
35
+
36
+ ## Prerequisites
37
+
38
+ This project uses [UV](https://docs.astral.sh/uv/) for dependency management.
39
+
40
+ ### Setup
41
+
42
+ ```bash
43
+ # Clone the repository
44
+ git clone https://github.com/opencitations/lode.git
45
+
46
+ # Enter the repo
47
+ cd lode
48
+
49
+ # Install dependencies
50
+ uv sync --all-extras --dev
51
+
52
+ # run locally
53
+ uv run python main.py
54
+
55
+ # open at
56
+ localhost:8000
57
+ ```
58
+
59
+ ## Docker
60
+
61
+ ### Build
62
+
63
+ ```bash
64
+ docker build -t lode .
65
+ ```
66
+
67
+ ### Run
68
+
69
+ ```bash
70
+ docker run -p 8080:8080 lode
71
+ ```
72
+
73
+ ### Run from Docker Hub
74
+
75
+ ```bash
76
+ docker run -p 8080:8080 opencitations/lode:latest
77
+ ```
78
+
79
+ Replace `latest` with the desired version tag.
80
+
81
+ The app will be available at `localhost:8080`.
82
+
83
+ ## Running tests
84
+
85
+ ```bash
86
+ uv run pytest tests/
87
+ ```
88
+
89
+ ## How to cite
90
+
91
+ If you use LODE, please cite both the paper and the software:
92
+
93
+ Pasqual, V., Nazari, A., Peroni, S. (2026). Supporting the understanding of ontologies for scientific knowledge graphs with the new version of LODE. In *Proceedings of the 6th International Workshop on Scientific Knowledge: Representation, Discovery, and Assessment (Sci-K 2026), co-located with the 25th International Semantic Web Conference (ISWC) 2026, Bari, Italy*, CEUR Workshop Proceedings, Vol. 4291, pp. 12–26. https://ceur-ws.org/Vol-4291/paper1.pdf
94
+
95
+ ```bibtex
96
+ @inproceedings{pasqual2026lode,
97
+ author = {Pasqual, Valentina and Nazari, Ahmadreza and Peroni, Silvio},
98
+ title = {Supporting the Understanding of Ontologies for Scientific Knowledge Graphs with the New Version of LODE},
99
+ booktitle = {Proceedings of the 6th International Workshop on Scientific Knowledge: Representation, Discovery, and Assessment (Sci-K 2026), co-located with the 25th International Semantic Web Conference (ISWC) 2026, Bari, Italy},
100
+ series = {CEUR Workshop Proceedings},
101
+ volume = {4291},
102
+ pages = {12--26},
103
+ publisher = {CEUR-WS.org},
104
+ issn = {1613-0073},
105
+ year = {2026},
106
+ url = {https://ceur-ws.org/Vol-4291/paper1.pdf}
107
+ }
108
+ ```
109
+
110
+ To cite the software (all versions), use this BibTeX entry:
111
+
112
+ ```bibtex
113
+ @software{lode,
114
+ author = {Pasqual, Valentina and Peroni, Silvio and Nazari, Ahmadreza},
115
+ title = {LODE - Live OWL Documentation Environment},
116
+ year = {2026},
117
+ publisher = {Zenodo},
118
+ doi = {10.5281/zenodo.21805185},
119
+ url = {https://github.com/opencitations/lode}
120
+ }
121
+ ```
122
+
123
+ <!-- ### Building documentation locally
124
+
125
+ ```bash
126
+ cd docs
127
+ npm install
128
+ npm run dev
129
+ ``` -->
130
+
131
+ ## License
132
+
133
+ This project is licensed under the ISC License - see the [LICENSE.md](https://github.com/opencitations/lode/blob/main/LICENSE.md) file for details.
@@ -0,0 +1,2 @@
1
+ """LODE: Live OWL Documentation Environment, maintained by OpenCitations."""
2
+