pylode 3.3.4__tar.gz → 3.4.2__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 (49) hide show
  1. {pylode-3.3.4 → pylode-3.4.2}/PKG-INFO +7 -7
  2. {pylode-3.3.4 → pylode-3.4.2}/README.md +4 -4
  3. {pylode-3.3.4 → pylode-3.4.2}/pylode/cli.py +22 -2
  4. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/ontpub.py +15 -37
  5. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/component/properties_table.py +7 -2
  6. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/html.py +1 -1
  7. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/vocpub.py +238 -284
  8. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf_elements.py +44 -1
  9. {pylode-3.3.4 → pylode-3.4.2}/pylode/server.py +59 -46
  10. {pylode-3.3.4 → pylode-3.4.2}/pylode/utils.py +5 -4
  11. pylode-3.4.2/pylode/version.py +8 -0
  12. {pylode-3.3.4 → pylode-3.4.2}/pyproject.toml +3 -3
  13. pylode-3.3.4/pylode/version.py +0 -3
  14. {pylode-3.3.4 → pylode-3.4.2}/pylode/__init__.py +0 -0
  15. {pylode-3.3.4 → pylode-3.4.2}/pylode/__main__.py +0 -0
  16. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/__init__.py +0 -0
  17. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/__init__.py +0 -0
  18. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/component/__init__.py +0 -0
  19. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/component/example.py +0 -0
  20. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/component/heading.py +0 -0
  21. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/component/link.py +0 -0
  22. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/component/preamble.py +0 -0
  23. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/component/tooltip.py +0 -0
  24. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/dataset.py +0 -0
  25. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/fragment.py +0 -0
  26. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/loader.py +0 -0
  27. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/model.py +0 -0
  28. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/namespace.py +0 -0
  29. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/query/__init__.py +0 -0
  30. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/query/common.py +0 -0
  31. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/query/property_shape.py +0 -0
  32. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/random.py +0 -0
  33. {pylode-3.3.4 → pylode-3.4.2}/pylode/profiles/supermodel/state.py +0 -0
  34. {pylode-3.3.4 → pylode-3.4.2}/pylode/pylode.css +0 -0
  35. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/dcterms-mod.ttl +0 -0
  36. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/licenses.ttl +0 -0
  37. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/ontdoc.ttl +0 -0
  38. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/owl.ttl +0 -0
  39. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/prov.ttl +0 -0
  40. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/rdf.ttl +0 -0
  41. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/rdfs-mod.ttl +0 -0
  42. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/sdo-mod.ttl +0 -0
  43. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/skos.ttl +0 -0
  44. {pylode-3.3.4 → pylode-3.4.2}/pylode/rdf/void.ttl +0 -0
  45. {pylode-3.3.4 → pylode-3.4.2}/pylode/static/asciidoc.css +0 -0
  46. {pylode-3.3.4 → pylode-3.4.2}/pylode/static/hierarchy.css +0 -0
  47. {pylode-3.3.4 → pylode-3.4.2}/pylode/static/hierarchy.js +0 -0
  48. {pylode-3.3.4 → pylode-3.4.2}/pylode/static/property-table-row.js +0 -0
  49. {pylode-3.3.4 → pylode-3.4.2}/pylode/static/pylode.css +0 -0
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pylode
3
- Version: 3.3.4
3
+ Version: 3.4.2
4
4
  Summary: An OWL ontology documentation tool using Python, based on LODE.
5
5
  Author: Nicholas Car
6
6
  Author-email: Nicholas Car <nick@kurrawong.ai>
7
7
  License-Expression: BSD-3-Clause
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.9
10
9
  Classifier: Programming Language :: Python :: 3.10
11
10
  Classifier: Programming Language :: Python :: 3.11
12
11
  Classifier: Programming Language :: Python :: 3.12
@@ -18,10 +17,11 @@ Requires-Dist: dominate>=2.6.0,<3
18
17
  Requires-Dist: html5lib>=1.1,<2
19
18
  Requires-Dist: httpx>=0.25.0,<1.0.0
20
19
  Requires-Dist: tqdm>=4.67.3
20
+ Requires-Dist: kurra>=2.3.0
21
21
  Requires-Dist: bs4>=0.0.2 ; extra == 'server'
22
22
  Requires-Dist: falcon>=4.2.0 ; extra == 'server'
23
23
  Requires-Dist: validators>=0.35.0 ; extra == 'server'
24
- Requires-Python: >=3.9, <4
24
+ Requires-Python: >=3.12, <4
25
25
  Project-URL: Homepage, https://github.com/RDFLib/pyLODE
26
26
  Project-URL: Documentation, https://github.com/RDFLib/pyLODE
27
27
  Project-URL: Source, https://github.com/RDFLib/pyLODE
@@ -29,7 +29,7 @@ Project-URL: Changelog, https://github.com/RDFLib/pyLODE/releases
29
29
  Provides-Extra: server
30
30
  Description-Content-Type: text/markdown
31
31
 
32
- ![pyLODE logo](https://rawcdn.githack.com/RDFLib/pyLODE/master/img/pyLODE-250.png)
32
+ ![pyLODE logo](https://raw.githubusercontent.com/RDFLib/pyLODE/master/img/pyLODE-250.png)
33
33
  [![PyPI version](https://badge.fury.io/py/pyLODE.svg)](https://badge.fury.io/py/pyLODE)
34
34
 
35
35
  # pyLODE
@@ -152,8 +152,8 @@ The active endpoint accepts the following querystring parameters:
152
152
  * `url` for the absolute URL of the ontology document that you wish to render. The server hosting that ontology document must be capable of responding to Content Negotiation,
153
153
  i.e. it must supply RDF according to an HTTP `Accept` request for `text/turtle`, `application/rdf+xml` etc.
154
154
  * `profile` for the profile to use to generate HTML. Must be one of:
155
- * `ontpub` (https://w3id.org/profile/ontpub) for ontologies. This is the default if no ``profile`` is provided.
156
- * `vocpub` (https://w3id.org/profile/vocpub) for SKOS vocabularies
155
+ * `ontpub` (https://linked.data.gov.au/def/ontpub) for ontologies. This is the default if no ``profile`` is provided.
156
+ * `vocpub` (https://linked.data.gov.au/def/vocpub) for SKOS vocabularies
157
157
  * `supermodel` for profiles of profiles
158
158
  * `sort` to indicate whether subjects should be sorted in the rendered output. Must be one of:
159
159
  * `true` to sort the subjects (this is the default)
@@ -298,7 +298,7 @@ python -m pytest tests --disable-warnings
298
298
 
299
299
  Since version 3.0.1, we have moved to documenting releases in GitHub: https://github.com/RDFLib/pyLODE/releases
300
300
 
301
- Older releasese
301
+ Older releases
302
302
 
303
303
  | Version | Date | Description |
304
304
  |---------|------------------|---------------------------------------------------------------------------------|
@@ -1,4 +1,4 @@
1
- ![pyLODE logo](https://rawcdn.githack.com/RDFLib/pyLODE/master/img/pyLODE-250.png)
1
+ ![pyLODE logo](https://raw.githubusercontent.com/RDFLib/pyLODE/master/img/pyLODE-250.png)
2
2
  [![PyPI version](https://badge.fury.io/py/pyLODE.svg)](https://badge.fury.io/py/pyLODE)
3
3
 
4
4
  # pyLODE
@@ -121,8 +121,8 @@ The active endpoint accepts the following querystring parameters:
121
121
  * `url` for the absolute URL of the ontology document that you wish to render. The server hosting that ontology document must be capable of responding to Content Negotiation,
122
122
  i.e. it must supply RDF according to an HTTP `Accept` request for `text/turtle`, `application/rdf+xml` etc.
123
123
  * `profile` for the profile to use to generate HTML. Must be one of:
124
- * `ontpub` (https://w3id.org/profile/ontpub) for ontologies. This is the default if no ``profile`` is provided.
125
- * `vocpub` (https://w3id.org/profile/vocpub) for SKOS vocabularies
124
+ * `ontpub` (https://linked.data.gov.au/def/ontpub) for ontologies. This is the default if no ``profile`` is provided.
125
+ * `vocpub` (https://linked.data.gov.au/def/vocpub) for SKOS vocabularies
126
126
  * `supermodel` for profiles of profiles
127
127
  * `sort` to indicate whether subjects should be sorted in the rendered output. Must be one of:
128
128
  * `true` to sort the subjects (this is the default)
@@ -267,7 +267,7 @@ python -m pytest tests --disable-warnings
267
267
 
268
268
  Since version 3.0.1, we have moved to documenting releases in GitHub: https://github.com/RDFLib/pyLODE/releases
269
269
 
270
- Older releasese
270
+ Older releases
271
271
 
272
272
  | Version | Date | Description |
273
273
  |---------|------------------|---------------------------------------------------------------------------------|
@@ -1,4 +1,5 @@
1
1
  import argparse
2
+ import logging
2
3
  import sys
3
4
  from pathlib import Path
4
5
 
@@ -44,17 +45,36 @@ parser.add_argument(
44
45
  "-p",
45
46
  "--profile",
46
47
  help="Which profile to use to generate HTML. Must be one of "
47
- "'ontpub' (https://w3id.org/profile/ontpub) - for ontologies, "
48
- "'vocpub' (https://w3id.org/profile/vocpub) - for SKOS vocabularies"
48
+ "'ontpub' (https://linked.data.gov.au/def/ontpub) - for ontologies, "
49
+ "'vocpub' (https://linked.data.gov.au/def/vocpub) - for SKOS vocabularies"
49
50
  "'supermodel' - for profiles of profiles",
50
51
  choices=["ontpub", "vocpub", "supermodel"],
51
52
  default="ontpub",
52
53
  )
53
54
 
55
+ parser.add_argument(
56
+ "-l",
57
+ "--loglevel",
58
+ help="Set the logging level",
59
+ choices=["error", "warning", "info", "debug"],
60
+ default="error",
61
+ )
62
+
54
63
 
55
64
  def main():
56
65
  args = parser.parse_args()
57
66
 
67
+ logger = logging.getLogger()
68
+
69
+ if args.loglevel == "error":
70
+ logger.setLevel(level=logging.ERROR)
71
+ elif args.loglevel == "warning":
72
+ logger.setLevel(level=logging.WARNING)
73
+ elif args.loglevel == "info":
74
+ logger.setLevel(level=logging.INFO)
75
+ elif args.loglevel == "debug":
76
+ logger.setLevel(level=logging.DEBUG)
77
+
58
78
  try:
59
79
  sort_subjects = args.sort
60
80
  if args.profile == "ontpub":
@@ -44,42 +44,20 @@ from rdflib.namespace import (
44
44
  SKOS,
45
45
  )
46
46
 
47
- from pylode.utils import PylodeError
48
-
49
- try:
50
- from .rdf_elements import AGENT_PROPS, CLASS_PROPS, ONT_PROPS, ONTDOC, PROP_PROPS
51
- from .utils import (
52
- back_onts_label_props,
53
- get_ns,
54
- load_background_onts,
55
- load_background_onts_titles,
56
- load_ontology,
57
- make_pylode_logo,
58
- prop_obj_pair_html,
59
- section_html,
60
- sort_ontology,
61
- )
62
- from .version import __version__
63
- except ImportError:
64
- from pylode.rdf_elements import (
65
- AGENT_PROPS,
66
- CLASS_PROPS,
67
- ONT_PROPS,
68
- ONTDOC,
69
- PROP_PROPS,
70
- )
71
- from pylode.utils import (
72
- back_onts_label_props,
73
- get_ns,
74
- load_background_onts,
75
- load_background_onts_titles,
76
- load_ontology,
77
- make_pylode_logo,
78
- prop_obj_pair_html,
79
- section_html,
80
- sort_ontology,
81
- )
82
- from pylode.version import __version__
47
+ from ..rdf_elements import AGENT_PROPS, CLASS_PROPS, ONT_PROPS, ONTDOC, PROP_PROPS
48
+ from ..utils import (
49
+ PylodeError,
50
+ back_onts_label_props,
51
+ get_ns,
52
+ load_background_onts,
53
+ load_background_onts_titles,
54
+ load_ontology,
55
+ make_pylode_logo,
56
+ prop_obj_pair_html,
57
+ section_html,
58
+ sort_ontology,
59
+ )
60
+ from ..version import __version__
83
61
 
84
62
  RDF_FOLDER = Path(__file__).parent / "rdf"
85
63
 
@@ -316,7 +294,7 @@ class OntPub:
316
294
 
317
295
  Just calls other helper functions in order"""
318
296
  make_pylode_logo(
319
- self.doc, __version__, "OntPub", "https://w3id.org/profile/ontpub"
297
+ self.doc, __version__, "OntPub", "https://linked.data.gov.au/def/ontpub"
320
298
  )
321
299
  self._make_metadata()
322
300
  self._make_main_sections()
@@ -3,8 +3,13 @@ from rdflib import Literal, URIRef
3
3
 
4
4
  from pylode.profiles.supermodel.component import external_link, tooltip
5
5
  from pylode.profiles.supermodel.fragment import make_html_fragment
6
- from pylode.profiles.supermodel.model import (Class, CodedProperty, Property,
7
- Resource, SimpleCodedProperty)
6
+ from pylode.profiles.supermodel.model import (
7
+ Class,
8
+ CodedProperty,
9
+ Property,
10
+ Resource,
11
+ SimpleCodedProperty,
12
+ )
8
13
 
9
14
 
10
15
  def render_resource_or_literal(item: Resource | Literal, class_: Class, class_index):
@@ -927,7 +927,7 @@ class Supermodel:
927
927
  str(imp)
928
928
  for imp in self.query.onts_props[OWL.imports]
929
929
  ]
930
- metadata_row("Imports", imports)
930
+ metadata_row("Imports", imports)
931
931
  if (
932
932
  DCTERMS.description in self.query.onts_props
933
933
  and len(self.query.onts_props[DCTERMS.description]) > 0