pylode 3.2.1__tar.gz → 3.2.3__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 (53) hide show
  1. pylode-3.2.3/PKG-INFO +302 -0
  2. pylode-3.2.3/README.md +282 -0
  3. {pylode-3.2.1 → pylode-3.2.3}/pylode/__init__.py +2 -5
  4. {pylode-3.2.1 → pylode-3.2.3}/pylode/cli.py +7 -8
  5. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/ontpub.py +30 -36
  6. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/component/example.py +3 -3
  7. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/component/preamble.py +1 -1
  8. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/component/properties_table.py +4 -5
  9. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/dataset.py +2 -1
  10. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/html.py +38 -37
  11. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/loader.py +1 -1
  12. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/model.py +1 -2
  13. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/namespace.py +2 -3
  14. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/query/__init__.py +34 -30
  15. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/query/common.py +4 -2
  16. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/query/property_shape.py +11 -7
  17. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/vocpub.py +35 -42
  18. pylode-3.2.3/pylode/rdf/refs.pickle +0 -0
  19. pylode-3.2.3/pylode/rdf/refs_titles.pickle +0 -0
  20. {pylode-3.2.1 → pylode-3.2.3}/pylode/utils.py +24 -19
  21. pylode-3.2.3/pylode/version.py +3 -0
  22. {pylode-3.2.1 → pylode-3.2.3}/pyproject.toml +8 -5
  23. pylode-3.2.1/PKG-INFO +0 -388
  24. pylode-3.2.1/README.rst +0 -367
  25. pylode-3.2.1/pylode/version.py +0 -1
  26. {pylode-3.2.1 → pylode-3.2.3}/LICENSE +0 -0
  27. {pylode-3.2.1 → pylode-3.2.3}/pylode/__main__.py +0 -0
  28. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/__init__.py +1 -1
  29. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/__init__.py +0 -0
  30. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/component/__init__.py +2 -2
  31. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/component/heading.py +0 -0
  32. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/component/link.py +0 -0
  33. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/component/tooltip.py +0 -0
  34. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/fragment.py +0 -0
  35. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/random.py +1 -1
  36. {pylode-3.2.1 → pylode-3.2.3}/pylode/profiles/supermodel/state.py +0 -0
  37. {pylode-3.2.1 → pylode-3.2.3}/pylode/pylode.css +0 -0
  38. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/dcterms-mod.ttl +0 -0
  39. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/licenses.ttl +0 -0
  40. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/ontdoc.ttl +0 -0
  41. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/owl.ttl +0 -0
  42. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/prov.ttl +0 -0
  43. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/rdf.ttl +0 -0
  44. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/rdfs-mod.ttl +0 -0
  45. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/sdo-mod.ttl +0 -0
  46. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/skos.ttl +0 -0
  47. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf/void.ttl +0 -0
  48. {pylode-3.2.1 → pylode-3.2.3}/pylode/rdf_elements.py +0 -0
  49. {pylode-3.2.1 → pylode-3.2.3}/pylode/static/asciidoc.css +0 -0
  50. {pylode-3.2.1 → pylode-3.2.3}/pylode/static/hierarchy.css +0 -0
  51. {pylode-3.2.1 → pylode-3.2.3}/pylode/static/hierarchy.js +0 -0
  52. {pylode-3.2.1 → pylode-3.2.3}/pylode/static/property-table-row.js +0 -0
  53. {pylode-3.2.1 → pylode-3.2.3}/pylode/static/pylode.css +0 -0
pylode-3.2.3/PKG-INFO ADDED
@@ -0,0 +1,302 @@
1
+ Metadata-Version: 2.3
2
+ Name: pylode
3
+ Version: 3.2.3
4
+ Summary: An OWL ontology documentation tool using Python, based on LODE.
5
+ Author: Nicholas Car
6
+ Author-email: nick@kurrawong.ai
7
+ Requires-Python: >=3.9,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Dist: Markdown (>=3.3.7,<4.0.0)
15
+ Requires-Dist: dominate (>=2.6.0,<3.0.0)
16
+ Requires-Dist: html5lib (>=1.1,<2.0)
17
+ Requires-Dist: httpx (>=0.25.0,<1.0.0)
18
+ Requires-Dist: rdflib (>=7.0.0,<8.0.0)
19
+ Description-Content-Type: text/markdown
20
+
21
+ ![pyLODE logo](https://rawcdn.githack.com/RDFLib/pyLODE/master/img/pyLODE-250.png)
22
+ [![PyPI version](https://badge.fury.io/py/pyLODE.svg)](https://badge.fury.io/py/pyLODE)
23
+
24
+ # pyLODE
25
+
26
+ An OWL ontology documentation tool using Python, based on LODE.
27
+
28
+ In addition to making web page, human-readable forms of ontologies, pyLODE encourages ontology annotation *best practice* by only producing good results for well documented inputs! pyLODE defines what it considers “well documented” in sections below, e.g. [What pyLODE understands](#what-pylode-understands).
29
+
30
+ **New mode**: In v3.1.0, pyLODE now has a new mode called `supermodel`, in addition to the existing `ontpub` mode. This new mode allows for documenting **profiles and modules** of multipart models. See [supermodel.md](supermodel.md) for more information.
31
+
32
+ ---
33
+
34
+ ## A note on the v 3.x change
35
+
36
+ This is pyLODE version 3.0.1 and it’s vastly different from pyLODE 2.x. It doesn’t yet handle all the various “profiles” that pyLODE 2.13.2 does, such as SKOS “vocabularies” & Profiles Vocabulary “profiles”, it only handles OWL “ontologies”, nor all the special data types, such as JSON literals.
37
+
38
+ However, it generates HTML in a much more straightforward manner and the code is both more efficient and much more maintainable, which is why it’s been made.
39
+
40
+ v 3.x will eventually catch up to all of v 2.13.2’s features.
41
+
42
+ To access v 2.13.2 of pyLODE, either:
43
+
44
+ - [Download it from PyPI](https://pypi.org/project/pylode/2.13.2/)
45
+ - [Check it out from GitHub](https://github.com/RDFLib/pyLODE/releases/tag/2.13.2)
46
+ - Access it via the [online service](http://tools.kurrawong.ai/pylode)
47
+
48
+ ---
49
+
50
+ ## Contents
51
+
52
+ 1. [Quick Intro](#quick-intro)
53
+ 2. [Use](#use)
54
+ 3. [What pyLODE understands](#what-pylode-understands)
55
+ 4. [Examples](#examples)
56
+ 5. [Installation](#installation)
57
+ 6. [Testing](#testing)
58
+ 7. [Differences from LODE](#differences-from-lode)
59
+ 8. [Releases](#releases)
60
+ 9. [License](#license)
61
+ 10. [Citation](#citation)
62
+ 11. [Collaboration](#collaboration)
63
+ 12. [Contacts](#contacts)
64
+
65
+ ## Quick Intro
66
+
67
+ The Live OWL Documentation Environment tool
68
+ ([LODE](https://github.com/essepuntato/LODE)) is a well-known (in Semantic Web circles) Java & XSLT-based tool used to generate human-readable HTML documents for OWL and RDF ontologies. That tool is now a bit dated and its [online version](https://essepuntato.it/lode) is not always online.
69
+
70
+ This tool is a complete re-implementation of LODE’s functionality using Python and Python’s RDF manipulation module, [rdflib](https://pypi.org/project/rdflib/). An ontology to be documented is parsed and inspected using rdflib and HTML is generated directly using Python’s [dominate](https://pypi.org/project/dominate/) package.
71
+
72
+ ## Use
73
+
74
+ The tool can be used in multiple ways:
75
+
76
+ - BASH command line script
77
+ - `pyLODE.sh` in `bin/`
78
+ - Windows EXE
79
+ - `pyLODE.exe` in `bin/`
80
+ - Mac executable
81
+ - `pyLODE` in `bin/`
82
+ - Python script
83
+ - `cli.py` or module
84
+ - As-a-service locally
85
+ - via the [Falcon framework](https://falconframework.org/)
86
+ - see `server.py`
87
+ - As-a-service online
88
+ - https://tools.kurrawong.ai/pylode
89
+
90
+ ### Command line arguments
91
+
92
+ ```text
93
+ usage: cli.py [-h] [-v] [-o OUTPUTFILE] [-c {true,false}] input
94
+
95
+ positional arguments:
96
+ input Input file location or URL
97
+
98
+ optional arguments:
99
+ -h, --help show this help message and exit
100
+ -v, --version show program's version number and exit
101
+ -o OUTPUTFILE,
102
+ --outputfile OUTPUTFILE
103
+ Output file name (postfixed with .html if needed)
104
+ -c {true,false},
105
+ --css {true,false}
106
+ Include CSS in the output HTML
107
+ ```
108
+
109
+ ### Basic Use
110
+
111
+ **As a Python script**
112
+
113
+ ```bash
114
+ python pylode examples/ontpub/minimal.ttl -o minimal.html
115
+ ```
116
+
117
+ **As a Docker container**
118
+
119
+ ```bash
120
+ docker build -t pylode:latest .
121
+ ```
122
+
123
+ ```bash
124
+ docker run --mount 'type=bind,src=<ttl_directory>,target=/app/pylode/data' \
125
+ pylode:latest python3.10 pylode/cli.py data/<ttl_file> -o data/<html_file>
126
+ ```
127
+
128
+ > Note: `<ttl_directory>` must be absolute
129
+
130
+ ### Module Use
131
+
132
+ **For OWL**
133
+
134
+ ```python
135
+ from pylode.profiles.ontpub import OntPub
136
+
137
+ od = OntPub(ontology="some-ontology-file.ttl")
138
+ html = od.make_html()
139
+ od.make_html(destination="some-resulting-html-file.html")
140
+ ```
141
+
142
+ **For SKOS**
143
+
144
+ ```python
145
+ from pylode.profiles.vocpub import VocPub
146
+
147
+ od = VocPub(ontology="some-ontology-file.ttl")
148
+ html = od.make_html()
149
+ od.make_html(destination="some-resulting-html-file.html")
150
+ ```
151
+
152
+ ## Examples
153
+
154
+ The [`examples/` directory](https://github.com/RDFLib/pyLODE/tree/master/examples) contains multiple RDF & HTML pairs.
155
+
156
+ Rendered examples:
157
+
158
+ - [minimal.html](https://rdflib.dev/pyLODE/examples/ontpub/minimal.html)
159
+ - [agift.html](https://rdflib.dev/pyLODE/examples/ontpub/agrif.html)
160
+ - [alternates.html](https://rdflib.dev/pyLODE/examples/ontpub/alternates.html)
161
+ - [asgs.html](https://rdflib.dev/pyLODE/examples/ontpub/asgs.html)
162
+
163
+ ## What pyLODE understands
164
+
165
+ pyLODE understands definitional ontologies (`owl:Ontology`), classes, and properties.
166
+
167
+ Supported properties can be found in `rdf_elements.py`.
168
+
169
+ pyLODE deliberately does **not** translate everything in RDF to HTML, enforcing a conventional ontology documentation style. Support for new patterns can be requested via the [issue tracker](https://github.com/RDFLib/pyLODE/issues).
170
+
171
+ ### Notes on Agents
172
+
173
+ pyLODE supports simple and complex Agent objects, including ORCIDs, affiliations, and contact details.
174
+
175
+ ```turtle
176
+ <ontology_x>
177
+ schema:creator [
178
+ schema:name "Nicholas J. Car" ;
179
+ schema:identifier <http://orcid.org/0000-0002-8742-7730> ;
180
+ schema:email "nick@kurrawong.ai"^^xsd:anyURI ;
181
+ schema:affiliation [
182
+ schema:name "KurrawongAI" ;
183
+ schema:url "https://kurrawong.ai"^^xsd:anyURI ;
184
+ ] ;
185
+ ] ;
186
+ .
187
+ ```
188
+
189
+ ## Installation
190
+
191
+ pyLODE is available on [PyPI](https://pypi.org/project/pyLODE/):
192
+
193
+ ```bash
194
+ pip install pylode
195
+ ```
196
+
197
+ ## Testing
198
+
199
+ ```bash
200
+ python -m pytest tests --disable-warnings
201
+ ```
202
+
203
+ ## Differences from LODE
204
+
205
+ - command line access
206
+ - you can use this on your own desktop so you don't need me to maintain a live service for use
207
+ - use of modern simple HTML
208
+ - no JavaScript: pyLODE generates static HTML pages
209
+ - catering for a wider range of ontology options such as:
210
+ - schema.org ``domainIncludes`` & ``rangeIncludes`` for properties
211
+ - better Agent representation
212
+ - see the [Notes on Agents](#notes-on-agents) section above
213
+ - smarter CURIES
214
+ - pyLODE caches and looks up well-known prefixes to make more/better CURIES
215
+ - it tries to be smart with CURIE presentation by CURIE-ising all URIs it finds, rather than printing them
216
+ - reference ontologies property labels
217
+ - pyLODE caches ~ 10 well-known ontologies (RDFS, SKOS etc), properties from which people often use for their ontology documentation. Where these properties are used, the background ontology's labels are use
218
+ - **active development**
219
+ - pyLODE has been under active development since mid-2019 and is
220
+ still very much actively developed - it's not just staying still
221
+ - it will be improved in foreseeable to cater for more and more things
222
+ - recent ontology documentation initiatives such as the [MOD Ontology](https://github.com/FAIR-IMPACT/MOD) will be handled, if requested
223
+
224
+ ## Releases
225
+
226
+ **Current release:** **3.2.3**
227
+
228
+ ### Release Schedule
229
+
230
+ | Version | Date | Description |
231
+ |---------|------------------|---------------------------------------------------------------------------------|
232
+ | 3.2.3 | 27 January 2026 | Updating dependencies & release procedure. Tidy testing cleanup |
233
+ | 3.2.1 | 31 January 2025 | Fix version number in version.py |
234
+ | 3.2.0 | 27 July 2024 | dependency updates and merged multiple small PRs |
235
+ | 3.1.4 | 6 April 2024 | Fix load_ontology function's detection of data input |
236
+ | 3.1.3 | 18 March 2024 | Relax rdflib version constraint |
237
+ | 3.1.2 | 18 March 2024 | Relax httpx version constraint |
238
+ | 3.1.1 | 19 February 2024 | Fix release |
239
+ | 3.1.0 | 19 February 2024 | Add supermodel mode - supports documenting profiles and modules |
240
+ | 3.0.5 | 27 April 2023 | Minor patching |
241
+ | 3.0.4 | 24 May 2022 | Use of Poetry |
242
+ | 3.0.2 | 24 May 2022 | Support for preformatted skos:example literals |
243
+ | 3.0.1 | 6 Jan 2022 | Direct HTML generation using dominate; easier to maintain and extend |
244
+ | 2.13.2 | 21 December 2021 | Updated RDFlib to 6.1.1, improved test to properly use pytest |
245
+ | 2.10.0 | 24 May 2021 | Update Windows EXE build process, simplified versioning |
246
+ | 2.9.1 | 28 Apr 2021 | Support for ASCIIDOC format (OntDoc profile only) |
247
+ | 2.8.11 | 28 Apr 2021 | Further changes for PyPI only |
248
+ | 2.8.10 | 27 Apr 2021 | Further changes for PyPI only |
249
+ | 2.8.9 | 27 Apr 2021 | PyPI enhancements only |
250
+ | 2.8.8 | 27 Apr 2021 | Several small bugs fixed, auto-generation of version no. from Git tag |
251
+ | 2.8.6 | 23 Feb 2021 | Fixing char encoding issues, updated examples, new test files style - per issue |
252
+ | 2.8.5 | 5 Jan 2021 | Small enhancements to the Falcon server deployment option |
253
+ | 2.8.3 | 3 July 2020 | Packaging bugfixes only |
254
+ | 2.7 | 1 July 2020 | Much refactoring for new profile creation ease |
255
+ | 2.6 | 15 June 2020 | Supports PROF profiles as well as taxonomies & ontologies |
256
+ | 2.4 | 27 May 2020 | Small improvements over 2.0 |
257
+ | 2.0 | 18 Apr 2020 | Includes multiple profiles - OWP & vocpub |
258
+ | 1.0 | 15 Dec 2019 | Initial working release |
259
+
260
+ ## License
261
+
262
+ This code is licensed using the BSD 3-Clause licence. See the [LICENSE](LICENSE) file for the deed. Note Citation below though for attribution.
263
+
264
+ ## Citation
265
+
266
+ If you use pyLODE, please leave the pyLODE logo with a hyperlink back here in the top left of published HTML pages.
267
+
268
+ ## Collaboration
269
+
270
+ Contributions are welcome!
271
+
272
+ Please submit issues or pull requests via the [issue tracker](https://github.com/rdflib/pyLODE/issues).
273
+
274
+ But the very best thing you could do is create a Pull Request for us to action!
275
+
276
+ ## Contacts
277
+
278
+ **Author:**
279
+ Nicholas Car
280
+ *Data Architect*
281
+ [Kurrawong AI](https://kurrawong.ai)
282
+ <nick@kurrawong.ai>
283
+
284
+ ## Release Procedure
285
+
286
+ 1. tidy code: `$ task format`
287
+ 2. pass all tests: `$ task test`
288
+ 3. increment version number
289
+ * in `pyproject.toml`
290
+ * in README.md, 'Current Release' & 'Release Schedule'
291
+ 4. commit all changes `$ git commit -a "..."`
292
+ 5. tag with version number: `$git tag ...`
293
+ 6. push changes `$ git push`
294
+ 7. push version `git push --tags`
295
+ 8. publish on PyPI:
296
+ * `poetry build`
297
+ * `poetry publish -u __token__ -p {TOKEN}`
298
+ 9. make a GitHub release
299
+ * include `/dist` build artifacts
300
+ 10. increment version number to next release in `pyproject.toml`
301
+ 11. commit all changes `$ git commit -a "..."`
302
+ 12. push changes `$ git push`
pylode-3.2.3/README.md ADDED
@@ -0,0 +1,282 @@
1
+ ![pyLODE logo](https://rawcdn.githack.com/RDFLib/pyLODE/master/img/pyLODE-250.png)
2
+ [![PyPI version](https://badge.fury.io/py/pyLODE.svg)](https://badge.fury.io/py/pyLODE)
3
+
4
+ # pyLODE
5
+
6
+ An OWL ontology documentation tool using Python, based on LODE.
7
+
8
+ In addition to making web page, human-readable forms of ontologies, pyLODE encourages ontology annotation *best practice* by only producing good results for well documented inputs! pyLODE defines what it considers “well documented” in sections below, e.g. [What pyLODE understands](#what-pylode-understands).
9
+
10
+ **New mode**: In v3.1.0, pyLODE now has a new mode called `supermodel`, in addition to the existing `ontpub` mode. This new mode allows for documenting **profiles and modules** of multipart models. See [supermodel.md](supermodel.md) for more information.
11
+
12
+ ---
13
+
14
+ ## A note on the v 3.x change
15
+
16
+ This is pyLODE version 3.0.1 and it’s vastly different from pyLODE 2.x. It doesn’t yet handle all the various “profiles” that pyLODE 2.13.2 does, such as SKOS “vocabularies” & Profiles Vocabulary “profiles”, it only handles OWL “ontologies”, nor all the special data types, such as JSON literals.
17
+
18
+ However, it generates HTML in a much more straightforward manner and the code is both more efficient and much more maintainable, which is why it’s been made.
19
+
20
+ v 3.x will eventually catch up to all of v 2.13.2’s features.
21
+
22
+ To access v 2.13.2 of pyLODE, either:
23
+
24
+ - [Download it from PyPI](https://pypi.org/project/pylode/2.13.2/)
25
+ - [Check it out from GitHub](https://github.com/RDFLib/pyLODE/releases/tag/2.13.2)
26
+ - Access it via the [online service](http://tools.kurrawong.ai/pylode)
27
+
28
+ ---
29
+
30
+ ## Contents
31
+
32
+ 1. [Quick Intro](#quick-intro)
33
+ 2. [Use](#use)
34
+ 3. [What pyLODE understands](#what-pylode-understands)
35
+ 4. [Examples](#examples)
36
+ 5. [Installation](#installation)
37
+ 6. [Testing](#testing)
38
+ 7. [Differences from LODE](#differences-from-lode)
39
+ 8. [Releases](#releases)
40
+ 9. [License](#license)
41
+ 10. [Citation](#citation)
42
+ 11. [Collaboration](#collaboration)
43
+ 12. [Contacts](#contacts)
44
+
45
+ ## Quick Intro
46
+
47
+ The Live OWL Documentation Environment tool
48
+ ([LODE](https://github.com/essepuntato/LODE)) is a well-known (in Semantic Web circles) Java & XSLT-based tool used to generate human-readable HTML documents for OWL and RDF ontologies. That tool is now a bit dated and its [online version](https://essepuntato.it/lode) is not always online.
49
+
50
+ This tool is a complete re-implementation of LODE’s functionality using Python and Python’s RDF manipulation module, [rdflib](https://pypi.org/project/rdflib/). An ontology to be documented is parsed and inspected using rdflib and HTML is generated directly using Python’s [dominate](https://pypi.org/project/dominate/) package.
51
+
52
+ ## Use
53
+
54
+ The tool can be used in multiple ways:
55
+
56
+ - BASH command line script
57
+ - `pyLODE.sh` in `bin/`
58
+ - Windows EXE
59
+ - `pyLODE.exe` in `bin/`
60
+ - Mac executable
61
+ - `pyLODE` in `bin/`
62
+ - Python script
63
+ - `cli.py` or module
64
+ - As-a-service locally
65
+ - via the [Falcon framework](https://falconframework.org/)
66
+ - see `server.py`
67
+ - As-a-service online
68
+ - https://tools.kurrawong.ai/pylode
69
+
70
+ ### Command line arguments
71
+
72
+ ```text
73
+ usage: cli.py [-h] [-v] [-o OUTPUTFILE] [-c {true,false}] input
74
+
75
+ positional arguments:
76
+ input Input file location or URL
77
+
78
+ optional arguments:
79
+ -h, --help show this help message and exit
80
+ -v, --version show program's version number and exit
81
+ -o OUTPUTFILE,
82
+ --outputfile OUTPUTFILE
83
+ Output file name (postfixed with .html if needed)
84
+ -c {true,false},
85
+ --css {true,false}
86
+ Include CSS in the output HTML
87
+ ```
88
+
89
+ ### Basic Use
90
+
91
+ **As a Python script**
92
+
93
+ ```bash
94
+ python pylode examples/ontpub/minimal.ttl -o minimal.html
95
+ ```
96
+
97
+ **As a Docker container**
98
+
99
+ ```bash
100
+ docker build -t pylode:latest .
101
+ ```
102
+
103
+ ```bash
104
+ docker run --mount 'type=bind,src=<ttl_directory>,target=/app/pylode/data' \
105
+ pylode:latest python3.10 pylode/cli.py data/<ttl_file> -o data/<html_file>
106
+ ```
107
+
108
+ > Note: `<ttl_directory>` must be absolute
109
+
110
+ ### Module Use
111
+
112
+ **For OWL**
113
+
114
+ ```python
115
+ from pylode.profiles.ontpub import OntPub
116
+
117
+ od = OntPub(ontology="some-ontology-file.ttl")
118
+ html = od.make_html()
119
+ od.make_html(destination="some-resulting-html-file.html")
120
+ ```
121
+
122
+ **For SKOS**
123
+
124
+ ```python
125
+ from pylode.profiles.vocpub import VocPub
126
+
127
+ od = VocPub(ontology="some-ontology-file.ttl")
128
+ html = od.make_html()
129
+ od.make_html(destination="some-resulting-html-file.html")
130
+ ```
131
+
132
+ ## Examples
133
+
134
+ The [`examples/` directory](https://github.com/RDFLib/pyLODE/tree/master/examples) contains multiple RDF & HTML pairs.
135
+
136
+ Rendered examples:
137
+
138
+ - [minimal.html](https://rdflib.dev/pyLODE/examples/ontpub/minimal.html)
139
+ - [agift.html](https://rdflib.dev/pyLODE/examples/ontpub/agrif.html)
140
+ - [alternates.html](https://rdflib.dev/pyLODE/examples/ontpub/alternates.html)
141
+ - [asgs.html](https://rdflib.dev/pyLODE/examples/ontpub/asgs.html)
142
+
143
+ ## What pyLODE understands
144
+
145
+ pyLODE understands definitional ontologies (`owl:Ontology`), classes, and properties.
146
+
147
+ Supported properties can be found in `rdf_elements.py`.
148
+
149
+ pyLODE deliberately does **not** translate everything in RDF to HTML, enforcing a conventional ontology documentation style. Support for new patterns can be requested via the [issue tracker](https://github.com/RDFLib/pyLODE/issues).
150
+
151
+ ### Notes on Agents
152
+
153
+ pyLODE supports simple and complex Agent objects, including ORCIDs, affiliations, and contact details.
154
+
155
+ ```turtle
156
+ <ontology_x>
157
+ schema:creator [
158
+ schema:name "Nicholas J. Car" ;
159
+ schema:identifier <http://orcid.org/0000-0002-8742-7730> ;
160
+ schema:email "nick@kurrawong.ai"^^xsd:anyURI ;
161
+ schema:affiliation [
162
+ schema:name "KurrawongAI" ;
163
+ schema:url "https://kurrawong.ai"^^xsd:anyURI ;
164
+ ] ;
165
+ ] ;
166
+ .
167
+ ```
168
+
169
+ ## Installation
170
+
171
+ pyLODE is available on [PyPI](https://pypi.org/project/pyLODE/):
172
+
173
+ ```bash
174
+ pip install pylode
175
+ ```
176
+
177
+ ## Testing
178
+
179
+ ```bash
180
+ python -m pytest tests --disable-warnings
181
+ ```
182
+
183
+ ## Differences from LODE
184
+
185
+ - command line access
186
+ - you can use this on your own desktop so you don't need me to maintain a live service for use
187
+ - use of modern simple HTML
188
+ - no JavaScript: pyLODE generates static HTML pages
189
+ - catering for a wider range of ontology options such as:
190
+ - schema.org ``domainIncludes`` & ``rangeIncludes`` for properties
191
+ - better Agent representation
192
+ - see the [Notes on Agents](#notes-on-agents) section above
193
+ - smarter CURIES
194
+ - pyLODE caches and looks up well-known prefixes to make more/better CURIES
195
+ - it tries to be smart with CURIE presentation by CURIE-ising all URIs it finds, rather than printing them
196
+ - reference ontologies property labels
197
+ - pyLODE caches ~ 10 well-known ontologies (RDFS, SKOS etc), properties from which people often use for their ontology documentation. Where these properties are used, the background ontology's labels are use
198
+ - **active development**
199
+ - pyLODE has been under active development since mid-2019 and is
200
+ still very much actively developed - it's not just staying still
201
+ - it will be improved in foreseeable to cater for more and more things
202
+ - recent ontology documentation initiatives such as the [MOD Ontology](https://github.com/FAIR-IMPACT/MOD) will be handled, if requested
203
+
204
+ ## Releases
205
+
206
+ **Current release:** **3.2.3**
207
+
208
+ ### Release Schedule
209
+
210
+ | Version | Date | Description |
211
+ |---------|------------------|---------------------------------------------------------------------------------|
212
+ | 3.2.3 | 27 January 2026 | Updating dependencies & release procedure. Tidy testing cleanup |
213
+ | 3.2.1 | 31 January 2025 | Fix version number in version.py |
214
+ | 3.2.0 | 27 July 2024 | dependency updates and merged multiple small PRs |
215
+ | 3.1.4 | 6 April 2024 | Fix load_ontology function's detection of data input |
216
+ | 3.1.3 | 18 March 2024 | Relax rdflib version constraint |
217
+ | 3.1.2 | 18 March 2024 | Relax httpx version constraint |
218
+ | 3.1.1 | 19 February 2024 | Fix release |
219
+ | 3.1.0 | 19 February 2024 | Add supermodel mode - supports documenting profiles and modules |
220
+ | 3.0.5 | 27 April 2023 | Minor patching |
221
+ | 3.0.4 | 24 May 2022 | Use of Poetry |
222
+ | 3.0.2 | 24 May 2022 | Support for preformatted skos:example literals |
223
+ | 3.0.1 | 6 Jan 2022 | Direct HTML generation using dominate; easier to maintain and extend |
224
+ | 2.13.2 | 21 December 2021 | Updated RDFlib to 6.1.1, improved test to properly use pytest |
225
+ | 2.10.0 | 24 May 2021 | Update Windows EXE build process, simplified versioning |
226
+ | 2.9.1 | 28 Apr 2021 | Support for ASCIIDOC format (OntDoc profile only) |
227
+ | 2.8.11 | 28 Apr 2021 | Further changes for PyPI only |
228
+ | 2.8.10 | 27 Apr 2021 | Further changes for PyPI only |
229
+ | 2.8.9 | 27 Apr 2021 | PyPI enhancements only |
230
+ | 2.8.8 | 27 Apr 2021 | Several small bugs fixed, auto-generation of version no. from Git tag |
231
+ | 2.8.6 | 23 Feb 2021 | Fixing char encoding issues, updated examples, new test files style - per issue |
232
+ | 2.8.5 | 5 Jan 2021 | Small enhancements to the Falcon server deployment option |
233
+ | 2.8.3 | 3 July 2020 | Packaging bugfixes only |
234
+ | 2.7 | 1 July 2020 | Much refactoring for new profile creation ease |
235
+ | 2.6 | 15 June 2020 | Supports PROF profiles as well as taxonomies & ontologies |
236
+ | 2.4 | 27 May 2020 | Small improvements over 2.0 |
237
+ | 2.0 | 18 Apr 2020 | Includes multiple profiles - OWP & vocpub |
238
+ | 1.0 | 15 Dec 2019 | Initial working release |
239
+
240
+ ## License
241
+
242
+ This code is licensed using the BSD 3-Clause licence. See the [LICENSE](LICENSE) file for the deed. Note Citation below though for attribution.
243
+
244
+ ## Citation
245
+
246
+ If you use pyLODE, please leave the pyLODE logo with a hyperlink back here in the top left of published HTML pages.
247
+
248
+ ## Collaboration
249
+
250
+ Contributions are welcome!
251
+
252
+ Please submit issues or pull requests via the [issue tracker](https://github.com/rdflib/pyLODE/issues).
253
+
254
+ But the very best thing you could do is create a Pull Request for us to action!
255
+
256
+ ## Contacts
257
+
258
+ **Author:**
259
+ Nicholas Car
260
+ *Data Architect*
261
+ [Kurrawong AI](https://kurrawong.ai)
262
+ <nick@kurrawong.ai>
263
+
264
+ ## Release Procedure
265
+
266
+ 1. tidy code: `$ task format`
267
+ 2. pass all tests: `$ task test`
268
+ 3. increment version number
269
+ * in `pyproject.toml`
270
+ * in README.md, 'Current Release' & 'Release Schedule'
271
+ 4. commit all changes `$ git commit -a "..."`
272
+ 5. tag with version number: `$git tag ...`
273
+ 6. push changes `$ git push`
274
+ 7. push version `git push --tags`
275
+ 8. publish on PyPI:
276
+ * `poetry build`
277
+ * `poetry publish -u __token__ -p {TOKEN}`
278
+ 9. make a GitHub release
279
+ * include `/dist` build artifacts
280
+ 10. increment version number to next release in `pyproject.toml`
281
+ 11. commit all changes `$ git commit -a "..."`
282
+ 12. push changes `$ git push`
@@ -1,8 +1,5 @@
1
- from .utils import *
1
+ from .profiles import OntPub, Supermodel, VocPub
2
2
  from .rdf_elements import *
3
+ from .utils import *
3
4
  from .utils import PylodeError
4
- from .profiles import OntPub, VocPub, Supermodel
5
5
  from .version import __version__
6
-
7
-
8
- __all__ = ["__version__"]
@@ -1,10 +1,9 @@
1
1
  import argparse
2
- from pathlib import Path
3
2
  import sys
3
+ from pathlib import Path
4
4
 
5
5
  sys.path.insert(0, str(Path(__file__).absolute().parent.parent))
6
- from pylode import __version__, PylodeError
7
- from pylode import OntPub, VocPub, Supermodel
6
+ from pylode import OntPub, PylodeError, Supermodel, VocPub, __version__
8
7
 
9
8
  parser = argparse.ArgumentParser()
10
9
 
@@ -29,7 +28,7 @@ parser.add_argument(
29
28
  parser.add_argument(
30
29
  "-c",
31
30
  "--css",
32
- help="Whether (true) or not (false) to include CSS within an output " "HTML file.",
31
+ help="Whether (true) or not (false) to include CSS within an output HTML file.",
33
32
  choices=["true", "false"],
34
33
  default="true",
35
34
  )
@@ -38,7 +37,7 @@ parser.add_argument(
38
37
  "-s",
39
38
  "--sort",
40
39
  help="Enables sorting of the subjects in the ontology in the output",
41
- action='store_true',
40
+ action="store_true",
42
41
  )
43
42
 
44
43
  parser.add_argument(
@@ -59,11 +58,11 @@ def main():
59
58
  try:
60
59
  sort_subjects = args.sort
61
60
  if args.profile == "ontpub":
62
- html = OntPub(args.input, sort_subjects = sort_subjects)
61
+ html = OntPub(args.input, sort_subjects=sort_subjects)
63
62
  elif args.profile == "vocpub":
64
- html = VocPub(args.input, sort_subjects = sort_subjects)
63
+ html = VocPub(args.input, sort_subjects=sort_subjects)
65
64
  elif args.profile == "supermodel":
66
- html = Supermodel(args.input, sort_subjects = sort_subjects)
65
+ html = Supermodel(args.input, sort_subjects=sort_subjects)
67
66
  else:
68
67
  raise ValueError(f"Unexpected profile type '{args.profile}'")
69
68
  except PylodeError as e: