Skip to content

Commit 7f74887

Browse files
committed
formats for version 5.5.1
1 parent a28a787 commit 7f74887

4 files changed

Lines changed: 25 additions & 24 deletions

File tree

pylode/rdf_elements.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
from rdflib import Namespace
2-
from rdflib.namespace import (
3-
DCTERMS,
4-
OWL,
5-
RDF,
6-
RDFS,
7-
SDO,
8-
SKOS,
9-
VANN,
10-
XSD
11-
)
2+
from rdflib.namespace import DCTERMS, OWL, RDF, RDFS, SDO, SKOS, VANN, XSD
123

134
ONTDOC = Namespace("https://w3id.org/profile/ontdoc/")
145

pylode/utils.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
try:
3737
from .rdf_elements import (
3838
AGENT_PROPS,
39+
DATATYPE_CARDINALITIES,
3940
ONT_TYPES,
4041
ONTDOC,
4142
OWL_SET_TYPES,
4243
PROPS,
4344
RESTRICTION_TYPES,
44-
DATATYPE_CARDINALITIES
4545
)
4646
except ImportError:
4747
from rdf_elements import (
@@ -559,7 +559,7 @@ def _orcid_logo_svg(id):
559559
</g>
560560
</g>
561561
</svg>"""
562-
562+
563563
def _ror_logo_svg(id):
564564
id = id if ("http" in id) else f"https://ror.org/{id}"
565565
return f"""
@@ -724,14 +724,22 @@ def _restriction_html(ont__, obj__, ns__):
724724
for o2 in ont__.objects(o, RDFS.range):
725725
for rp, ro in ont__.predicate_objects(o2):
726726
if rp == OWL.onDatatype:
727-
prop = _hyperlink_html(ont__, ro, back_onts_, ns__, fids_)
727+
prop = _hyperlink_html(
728+
ont__, ro, back_onts_, ns__, fids_
729+
)
728730
if rp == OWL.withRestrictions:
729731
cards = []
730732
for ro2 in ont__.objects(o2, OWL.withRestrictions):
731-
for ro3 in ont__.objects(ro2, RDF.rest * ZeroOrMore / RDF.first):
732-
for rp4, ro4 in ont__.predicate_objects(ro3):
733+
for ro3 in ont__.objects(
734+
ro2, RDF.rest * ZeroOrMore / RDF.first
735+
):
736+
for rp4, ro4 in ont__.predicate_objects(
737+
ro3
738+
):
733739
if rp4 in DATATYPE_CARDINALITIES.keys():
734-
cards.append(f"{DATATYPE_CARDINALITIES[rp4]}{ro4}")
740+
cards.append(
741+
f"{DATATYPE_CARDINALITIES[rp4]}{ro4}"
742+
)
735743
if len(cards) > 0:
736744
card = " [" + ", ".join(cards) + "]"
737745
# XXX
@@ -852,7 +860,9 @@ def _make_hierarchy_html(
852860
name = make_title_from_iri(s)
853861
c = {
854862
"iri": str(s),
855-
"name": str(name), # need 2 x for OntPub (title) and VocPub (prefLabel) profiles
863+
"name": str(
864+
name
865+
), # need 2 x for OntPub (title) and VocPub (prefLabel) profiles
856866
}
857867
for o2 in ont.objects(s, parent_indicator):
858868
if not isinstance(o2, BNode):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Changelog = "https://github.com/RDFLib/pyLODE/releases"
77

88
[project]
99
name = "pylode"
10-
version = "3.5.1a"
10+
version = "3.5.1"
1111
description = "An OWL ontology documentation tool using Python, based on LODE."
1212
authors = [{ name = "Nicholas Car", email = "nick@kurrawong.ai" }]
1313
requires-python = ">=3.12,<4"

tests/test_issues.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ def test_issue_246(fix_html):
221221

222222
def test_issue_261(fix_html):
223223
# open("issues.html", "w").write(fix_html)
224-
assert de_space_html(
225-
"""[&gt;=0, &lt;42]"""
226-
) in de_space_html(fix_html), "Min/Max datatype cardinality restriction incorrect"
224+
assert de_space_html("""[&gt;=0, &lt;42]""") in de_space_html(fix_html), (
225+
"Min/Max datatype cardinality restriction incorrect"
226+
)
227227

228-
assert de_space_html(
229-
"""[&lt;=42]"""
230-
) in de_space_html(fix_html), "Max datatype cardinality restriction incorrect"
228+
assert de_space_html("""[&lt;=42]""") in de_space_html(fix_html), (
229+
"Max datatype cardinality restriction incorrect"
230+
)

0 commit comments

Comments
 (0)