Skip to content

Commit ae79ed4

Browse files
authored
Corrected test when loading rdfs. It used type for is_a. (#796)
# Description A bugfix in 0wlready2==0.46 corrected what is returned when using type on dataclasses. We had used type instead of is_a in the test and this has now been corrected.
1 parent d3f8e88 commit ae79ed4

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

ontopy/excelparser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ def create_ontology_from_pandas( # pylint:disable=too-many-locals,too-many-bran
473473
"owlready_ontology.owl#python_name"
474474
)
475475
)
476+
476477
# Add back the triples python name triples that were in the input_ontology.
477478
if input_ontology:
478479
for triple in pyname_triples_to_keep:

ontopy/ontology.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def get_unabbreviated_triples(
156156
):
157157
# pylint: disable=invalid-name
158158
"""Returns all triples unabbreviated.
159+
Imported ontologies not included.
159160
160161
If any of the `subject`, `predicate` or `obj` arguments are given,
161162
only matching triples will be returned.
@@ -2157,6 +2158,7 @@ def _get_unabbreviated_triples(
21572158
onto, subject=None, predicate=None, obj=None, blank=None
21582159
):
21592160
"""Help function returning all matching triples unabbreviated.
2161+
Does not include imported ontologies.
21602162
21612163
If `blank` is given, it will be used to represent blank nodes.
21622164
"""

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defusedxml>=0.7.1,<1
44
graphviz>=0.16,<0.21
55
numpy>=1.19.5,<3
66
openpyxl>=3.0.9,<3.2
7-
Owlready2>=0.28,!=0.32,!=0.34,<0.46
7+
Owlready2>=0.28,!=0.32,!=0.34,<0.47
88
packaging>=21.0,<25
99
pandas>=1.2,<2.3
1010
Pygments>=2.7.4,<3

tests/test_load.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ def test_load(repo_dir: "Path", testonto: "Ontology") -> None:
5555

5656

5757
def test_load_rdfs() -> None:
58+
"""Test to load non-emmo based ontologies rdf and rdfs"""
5859
from ontopy import get_ontology
5960

60-
# Test loading non-EMMO-based ontologies rdf and rdfs
6161
rdf_onto = get_ontology(
6262
"https://www.w3.org/1999/02/22-rdf-syntax-ns.ttl"
6363
).load(emmo_based=False)
6464
rdfs_onto = get_ontology("https://www.w3.org/2000/01/rdf-schema.ttl").load(
6565
emmo_based=False
6666
)
6767
rdfs_onto.Class # Needed to initialize rdfs_onto
68-
assert type(rdf_onto.HTML).iri == rdfs_onto.Datatype.iri
68+
assert rdf_onto.HTML.is_a[0].iri == rdfs_onto.Datatype.iri

0 commit comments

Comments
 (0)