From e3517c7bc18248f6062c6d1e67b11430009d9704 Mon Sep 17 00:00:00 2001 From: muddymudskipper Date: Wed, 28 Aug 2024 10:17:42 +0100 Subject: [PATCH] fix validate_profiles, test import tree --- CHANGELOG.md | 8 +- cmem_plugin_reason/plugin_reason.py | 115 ------------------ cmem_plugin_reason/utils.py | 2 +- poetry.lock | 24 ++-- tests/test_reason.py | 48 +++++--- .../{vocab.ttl => test_reason_ontology_1.ttl} | 26 +--- tests/test_reason_ontology_2.ttl | 24 ++++ tests/test_reason_ontology_3.ttl | 27 ++++ tests/test_validate.md | 8 +- tests/test_validate_ontology_1.ttl | 9 ++ tests/test_validate_ontology_2.ttl | 9 ++ ...ology.ttl => test_validate_ontology_3.ttl} | 4 +- 12 files changed, 128 insertions(+), 176 deletions(-) rename tests/{vocab.ttl => test_reason_ontology_1.ttl} (96%) create mode 100644 tests/test_reason_ontology_2.ttl create mode 100644 tests/test_reason_ontology_3.ttl create mode 100644 tests/test_validate_ontology_1.ttl create mode 100644 tests/test_validate_ontology_2.ttl rename tests/{test_validate_ontology.ttl => test_validate_ontology_3.ttl} (94%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35f5fc0..2638129 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Validate: added "mode" parameter +### Fixed + +- respect owl:imports in OWL2 profile validation + ### Changed - Validate: the entity output includes the reasoner option on path "reason" - Detailed axiom generator documentation - - The axiom generator ObjectPropertyCharacteristic does not yield results possibly due to a bug in the OWL API. Currently, -this axiom generator and its (working) counterpart DataPropertyCharacteristic are removed from the Reason plugin. + - The axiom generator ObjectPropertyCharacteristic does not yield results. Currently, this axiom generator and its + - (working) counterpart DataPropertyCharacteristic are removed from the Reason plugin. ## [1.0.0beta5] 2024-08-15 diff --git a/cmem_plugin_reason/plugin_reason.py b/cmem_plugin_reason/plugin_reason.py index 9aab801..8b78971 100644 --- a/cmem_plugin_reason/plugin_reason.py +++ b/cmem_plugin_reason/plugin_reason.py @@ -37,121 +37,6 @@ REASONER_PARAMETER.description += " Select axiom generators below [Click (?) for documentation]." -# -# SUBCLASS_DESC = """The reasoner will infer assertions about the hierarchy of classes, i.e. -# `SubClassOf:` statements. -# -# If there are classes `Person`, `Student` and `Professor`, such that `Person DisjointUnionOf: -# Student, Professor` holds, the reasoner will infer `Student SubClassOf: Person`. -# """ -# -# EQUIVALENCE_DESC = """The reasoner will infer assertions about the equivalence of classes, i.e. -# `EquivalentTo:` statements. -# -# If there are classes `Person`, `Student` and `Professor`, such that `Person DisjointUnionOf: -# Student, Professor` holds, the reasoner will infer `Person EquivalentTo: Student and Professor`. -# """ -# -# DISJOINT_DESC = """The reasoner will infer assertions about the disjointness of classes, i.e. -# `DisjointClasses:` statements. -# -# If there are classes `Person`, `Student` and `Professor`, such that `Person DisjointUnionOf: -# Student, Professor` holds, the reasoner will infer `DisjointClasses: Student, Professor`. -# """ -# -# # DATA_PROP_CHAR_DESC = """The reasoner will infer characteristics of data properties, i.e. -# # `Characteristics:` statements. For data properties, this only pertains to functionality. -# # -# # If there are data properties `identifier` and `enrollmentNumber`, such that `enrollmentNumber -# # SubPropertyOf: identifier` and `identifier Characteristics: Functional` holds, the reasoner will -# # infer `enrollmentNumber Characteristics: Functional`. -# # """ -# -# DATA_PROP_EQUIV_DESC = """The reasoner will infer axioms about the equivalence of data properties, -# i.e. `EquivalentProperties` statements. -# -# If there are data properties `identifier` and `enrollmentNumber`, such that `enrollmentNumber -# SubPropertyOf: identifier` and `identifier SubPropertyOf: enrollmentNumber` holds, the reasoner -# will infer `Student EquivalentProperties: identifier, enrollmentNumber`. -# """ -# -# DATA_PROP_SUB_DESC = """The reasoner will infer axioms about the hierarchy of data properties, -# i.e. `SubPropertyOf:` statements. -# -# If there are data properties `identifier`, `studentIdentifier` and `enrollmentNumber`, such that -# `studentIdentifier SubPropertyOf: identifier` and `enrollmentNumber SubPropertyOf: -# studentIdentifier` holds, the reasoner will infer `enrollmentNumber SubPropertyOf: identifier`. -# """ -# -# CLASS_ASSERT_DESC = """The reasoner will infer assertions about the classes of individuals, i.e. -# `Types:` statements. -# -# Assume, there are classes `Person`, `Student` and `University` as well as the property -# `enrolledIn`, such that `Student EquivalentTo: Person and enrolledIn some University` holds. For -# the individual `John` with the assertions `John Types: Person; Facts: enrolledIn -# LeipzigUniversity`, the reasoner will infer `John Types: Student`. -# """ -# -# PROPERTY_ASSERT_DESC = """The reasoner will infer assertions about the properties of individuals, -# i.e. `Facts:` statements. -# -# Assume, there are properties `enrolledIn` and `offers`, such that `enrolled SubPropertyChain: -# enrolledIn o inverse (offers)` holds. For the individuals `John`and `LeipzigUniversity` with the -# assertions `John Facts: enrolledIn KnowledgeRepresentation` and `LeipzigUniversity Facts: offers -# KnowledgeRepresentation`, the reasoner will infer `John Facts: enrolledIn LeipzigUniversity`. -# """ -# -# # OBJECT_PROP_CHAR_DESC = """The reasoner will infer characteristics of object properties, i.e. -# # `Characteristics:` statements. -# # -# # If there are object properties `enrolledIn` and `studentOf`, such that `enrolledIn -# # SubPropertyOf: studentOf` and `enrolledIn Characteristics: Functional` holds, the reasoner will -# # infer `studentOf Characteristics: Functional`. **Note: this inference does neither work in JFact -# # nor in HermiT!** -# # """ -# -# OBJECT_PROP_EQUIV_DESC = """The reasoner will infer assertions about the equivalence of object -# properties, i.e. `EquivalentTo:` statements. -# -# If there are object properties `hasAlternativeLecture` and `hasSameTopicAs`, such that -# `hasAlternativeLecture Characteristics: Symmetric` and `hasSameTopicAs InverseOf: -# hasAlternativeLecture` holds, the reasoner will infer `EquivalentProperties: -# hasAlternativeLecture, hasSameTopicAs`. -# """ -# -# OBJECT_PROP_SUB_DESC = """The reasoner will infer axioms about the inclusion of object properties, -# i.e. `SubPropertyOf:` statements. -# -# If there are object properties `enrolledIn`, `studentOf` and `hasStudent`, such that `enrolledIn -# SubPropertyOf: studentOf` and `enrolledIn InverseOf: hasStudent` holds, the reasoner will infer -# `hasStudent SubPropertyOf: inverse (studentOf)`. -# """ -# -# OBJECT_PROP_INV_DESC = """The reasoner will infer axioms about the inversion about object -# properties, i.e. `InverseOf:` statements. -# -# If there is a object property `hasAlternativeLecture`, such that `hasAlternativeLecture -# Characteristics: Symmetric` holds, the reasoner will infer `hasAlternativeLecture InverseOf: -# hasAlternativeLecture`. -# """ -# -# OBJECT_PROP_RANGE_DESC = """The reasoner will infer axioms about the ranges of object properties, -# i.e. `Range:` statements. -# -# If there are classes `Student` and `Lecture` as wells as object properties `hasStudent` and -# `enrolledIn`, such that `hasStudent Range: Student and enrolledIn some Lecture` holds, the -# reasoner will infer `hasStudent Range: Student`. -# """ -# -# OBJECT_PROP_DOMAIN_DESC = """The reasoner will infer axioms about the domains of object -# properties, i.e. `Domain:` statements. -# -# If there are classes `Person`, `Student` and `Professor` as wells as the object property -# `hasRoleIn`, such that `Professor SubClassOf: Person`, `Student SubClassOf: Person` and -# `hasRoleIn Domain: Professor or Student` holds, the reasoner will infer `hasRoleIn Domain: -# Person`. -# """ - @Plugin( label="Reason", diff --git a/cmem_plugin_reason/utils.py b/cmem_plugin_reason/utils.py index 295e5c7..1e12d5f 100644 --- a/cmem_plugin_reason/utils.py +++ b/cmem_plugin_reason/utils.py @@ -209,7 +209,7 @@ def validate_profiles(plugin: WorkflowPlugin, graphs: dict) -> list: valid_profiles = [] for profile in ("Full", "DL", "EL", "QL", "RL"): plugin.log.info(f"Validating {profile} profile.") - cmd = f"validate-profile --profile {profile} --input {ontology_location}" + cmd = f"merge --input {ontology_location} validate-profile --profile {profile}" response = robot(cmd, plugin.max_ram_percentage) if response.stdout.endswith(b"[Ontology and imports closure in profile]\n\n"): valid_profiles.append(profile) diff --git a/poetry.lock b/poetry.lock index 4899fc0..7b89598 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1003,13 +1003,13 @@ requests = ">=2.0.1,<3.0.0" [[package]] name = "rich" -version = "13.7.1" +version = "13.8.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false python-versions = ">=3.7.0" files = [ - {file = "rich-13.7.1-py3-none-any.whl", hash = "sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222"}, - {file = "rich-13.7.1.tar.gz", hash = "sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432"}, + {file = "rich-13.8.0-py3-none-any.whl", hash = "sha256:2e85306a063b9492dffc86278197a60cbece75bcb766022f3436f567cae11bdc"}, + {file = "rich-13.8.0.tar.gz", hash = "sha256:a5ac1f1cd448ade0d59cc3356f7db7a7ccda2c8cbae9c7a90c28ff463d3e91f4"}, ] [package.dependencies] @@ -1065,19 +1065,23 @@ setuptools = "*" [[package]] name = "setuptools" -version = "73.0.1" +version = "74.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-73.0.1-py3-none-any.whl", hash = "sha256:b208925fcb9f7af924ed2dc04708ea89791e24bde0d3020b27df0e116088b34e"}, - {file = "setuptools-73.0.1.tar.gz", hash = "sha256:d59a3e788ab7e012ab2c4baed1b376da6366883ee20d7a5fc426816e3d7b1193"}, + {file = "setuptools-74.0.0-py3-none-any.whl", hash = "sha256:0274581a0037b638b9fc1c6883cc71c0210865aaa76073f7882376b641b84e8f"}, + {file = "setuptools-74.0.0.tar.gz", hash = "sha256:a85e96b8be2b906f3e3e789adec6a9323abf79758ecfa3065bd740d81158b11e"}, ] [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"] core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.11.*)", "pytest-mypy"] [[package]] name = "six" @@ -1092,13 +1096,13 @@ files = [ [[package]] name = "textual" -version = "0.77.0" +version = "0.78.0" description = "Modern Text User Interface framework" optional = false python-versions = "<4.0.0,>=3.8.1" files = [ - {file = "textual-0.77.0-py3-none-any.whl", hash = "sha256:f117d29ddf9764c8969d1ac23724a7bd8cfe9111e158f2355d8a0e5ad10f5bd7"}, - {file = "textual-0.77.0.tar.gz", hash = "sha256:866c1e18e87b2817ce08e09259224b771caaf8824988c4c717094c6bf106b20f"}, + {file = "textual-0.78.0-py3-none-any.whl", hash = "sha256:c9d3c7dc467c37ee2e54a0283ac2c85dac35e4fc949518ed054a65b8e3e9b822"}, + {file = "textual-0.78.0.tar.gz", hash = "sha256:421f508b0d41ea0b8ecf273bf83f0d19376667eb0a87f70575252395d90ab315"}, ] [package.dependencies] diff --git a/tests/test_reason.py b/tests/test_reason.py index ef7e418..09f9375 100644 --- a/tests/test_reason.py +++ b/tests/test_reason.py @@ -20,9 +20,13 @@ UID = "e02aaed014c94e0c91bf960fed127750" REASON_DATA_GRAPH_IRI = f"https://ns.eccenca.com/reasoning/{UID}/data/" -REASON_ONTOLOGY_GRAPH_IRI = f"https://ns.eccenca.com/reasoning/{UID}/vocab/" +REASON_ONTOLOGY_GRAPH_IRI_1 = f"https://ns.eccenca.com/reasoning/{UID}/vocab/" +REASON_ONTOLOGY_GRAPH_IRI_2 = f"https://ns.eccenca.com/reasoning/{UID}/vocab2/" +REASON_ONTOLOGY_GRAPH_IRI_3 = f"https://ns.eccenca.com/reasoning/{UID}/vocab3/" REASON_RESULT_GRAPH_IRI = f"https://ns.eccenca.com/reasoning/{UID}/result/" -VALIDATE_ONTOLOGY_GRAPH_IRI = f"https://ns.eccenca.com/validateontology/{UID}/vocab/" +VALIDATE_ONTOLOGY_GRAPH_IRI_1 = f"https://ns.eccenca.com/validateontology/{UID}/vocab/" +VALIDATE_ONTOLOGY_GRAPH_IRI_2 = f"https://ns.eccenca.com/validateontology/{UID}/vocab2/" +VALIDATE_ONTOLOGY_GRAPH_IRI_3 = f"https://ns.eccenca.com/validateontology/{UID}/vocab3/" OUTPUT_GRAPH_IRI = f"https://ns.eccenca.com/validateontology/{UID}/output/" MD_FILENAME = f"{UID}.md" PROJECT_ID = f"validate_plugin_test_project_{UID}" @@ -37,31 +41,39 @@ def get_value_dict(entities: Entities) -> dict: return value_dict +def import_graph(iri: str, filename: str) -> None: + """Import graph to CMEM""" + res = post(iri, Path(__path__[0]) / filename, replace=True) + if res.status_code != 204: # noqa: PLR2004 + raise ValueError(f"Response {res.status_code}: {res.url}") + + @pytest.fixture() def _setup(request: pytest.FixtureRequest) -> None: """Set up""" - res = post(REASON_DATA_GRAPH_IRI, Path(__path__[0]) / "dataset_owl.ttl", replace=True) - if res.status_code != 204: # noqa: PLR2004 - raise ValueError(f"Response {res.status_code}: {res.url}") - res = post(REASON_ONTOLOGY_GRAPH_IRI, Path(__path__[0]) / "vocab.ttl", replace=True) - if res.status_code != 204: # noqa: PLR2004 - raise ValueError(f"Response {res.status_code}: {res.url}") + import_graph(REASON_DATA_GRAPH_IRI, "dataset_owl.ttl") + import_graph(REASON_ONTOLOGY_GRAPH_IRI_1, "test_reason_ontology_1.ttl") + import_graph(REASON_ONTOLOGY_GRAPH_IRI_2, "test_reason_ontology_2.ttl") + import_graph(REASON_ONTOLOGY_GRAPH_IRI_3, "test_reason_ontology_3.ttl") with suppress(Exception): delete_project(PROJECT_ID) make_new_project(PROJECT_ID) - res = post( - VALIDATE_ONTOLOGY_GRAPH_IRI, Path(__path__[0]) / "test_validate_ontology.ttl", replace=True - ) - if res.status_code != 204: # noqa: PLR2004 - raise ValueError(f"Response {res.status_code}: {res.url}") + + import_graph(VALIDATE_ONTOLOGY_GRAPH_IRI_1, "test_validate_ontology_1.ttl") + import_graph(VALIDATE_ONTOLOGY_GRAPH_IRI_2, "test_validate_ontology_2.ttl") + import_graph(VALIDATE_ONTOLOGY_GRAPH_IRI_3, "test_validate_ontology_3.ttl") request.addfinalizer(lambda: delete(REASON_DATA_GRAPH_IRI)) - request.addfinalizer(lambda: delete(REASON_ONTOLOGY_GRAPH_IRI)) + request.addfinalizer(lambda: delete(REASON_ONTOLOGY_GRAPH_IRI_1)) + request.addfinalizer(lambda: delete(REASON_ONTOLOGY_GRAPH_IRI_2)) + request.addfinalizer(lambda: delete(REASON_ONTOLOGY_GRAPH_IRI_3)) request.addfinalizer(lambda: delete(REASON_RESULT_GRAPH_IRI)) request.addfinalizer(lambda: delete_project(PROJECT_ID)) request.addfinalizer(lambda: delete(OUTPUT_GRAPH_IRI)) - request.addfinalizer(lambda: delete(VALIDATE_ONTOLOGY_GRAPH_IRI)) # noqa: PT021 + request.addfinalizer(lambda: delete(VALIDATE_ONTOLOGY_GRAPH_IRI_1)) + request.addfinalizer(lambda: delete(VALIDATE_ONTOLOGY_GRAPH_IRI_2)) + request.addfinalizer(lambda: delete(VALIDATE_ONTOLOGY_GRAPH_IRI_3)) # noqa: PT021 @needs_cmem @@ -81,7 +93,7 @@ def get_remote_graph(iri: str) -> Graph: def test_reasoner(reasoner: str, err_list: list) -> list: ReasonPlugin( data_graph_iri=REASON_DATA_GRAPH_IRI, - ontology_graph_iri=REASON_ONTOLOGY_GRAPH_IRI, + ontology_graph_iri=REASON_ONTOLOGY_GRAPH_IRI_1, output_graph_iri=REASON_RESULT_GRAPH_IRI, reasoner=reasoner, sub_class=False, @@ -99,7 +111,7 @@ def test_reasoner(reasoner: str, err_list: list) -> list: def test_validate(errors: str) -> str: result = ValidatePlugin( - ontology_graph_iri=VALIDATE_ONTOLOGY_GRAPH_IRI, + ontology_graph_iri=VALIDATE_ONTOLOGY_GRAPH_IRI_1, output_graph_iri=OUTPUT_GRAPH_IRI, reasoner="elk", validate_profile=True, @@ -116,7 +128,7 @@ def test_validate(errors: str) -> str: if value_dict["markdown"] != md_test: val_errors += 'EntityPath "markdown" output error. ' - if value_dict["ontology_graph_iri"] != VALIDATE_ONTOLOGY_GRAPH_IRI: + if value_dict["ontology_graph_iri"] != VALIDATE_ONTOLOGY_GRAPH_IRI_1: val_errors += 'EntityPath "ontology_graph_iri" output error. ' if value_dict["reasoner"] != "elk": val_errors += 'EntityPath "reasoner" output error. ' diff --git a/tests/vocab.ttl b/tests/test_reason_ontology_1.ttl similarity index 96% rename from tests/vocab.ttl rename to tests/test_reason_ontology_1.ttl index f2e778e..407257d 100644 --- a/tests/vocab.ttl +++ b/tests/test_reason_ontology_1.ttl @@ -9,7 +9,8 @@ rdf:type owl:Ontology ; rdfs:comment "Vocabulary for a reasoning use case"@en ; rdfs:label "Eccenca Reasoning Vocabulary"@en ; - rdfs:seeAlso . + rdfs:seeAlso ; + owl:imports . ################################################################# # Object Properties @@ -141,16 +142,6 @@ owl:Thing rdf:type owl:Class . rdfs:label "adult"^^xsd:string . -### https://ns.eccenca.com/reasoning/e02aaed014c94e0c91bf960fed127750/vocab/animal -:animal rdf:type owl:Class ; - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :eats ; - owl:someValuesFrom owl:Thing - ] ; - rdfs:comment ""^^xsd:string ; - rdfs:isDefinedBy ; - rdfs:label "animal"^^xsd:string . - ### https://ns.eccenca.com/reasoning/e02aaed014c94e0c91bf960fed127750/vocab/animal_lover :animal_lover rdf:type owl:Class ; @@ -261,19 +252,6 @@ owl:Thing rdf:type owl:Class . rdfs:label "cat liker"^^xsd:string . -### https://ns.eccenca.com/reasoning/e02aaed014c94e0c91bf960fed127750/vocab/cat_owner -:cat_owner rdf:type owl:Class ; - owl:equivalentClass [ owl:intersectionOf ( :person - [ rdf:type owl:Restriction ; - owl:onProperty :has_pet ; - owl:someValuesFrom :cat - ] - ) ; - rdf:type owl:Class - ] ; - rdfs:comment ""^^xsd:string ; - rdfs:isDefinedBy ; - rdfs:label "cat owner"^^xsd:string . ### https://ns.eccenca.com/reasoning/e02aaed014c94e0c91bf960fed127750/vocab/company diff --git a/tests/test_reason_ontology_2.ttl b/tests/test_reason_ontology_2.ttl new file mode 100644 index 0000000..fde26ff --- /dev/null +++ b/tests/test_reason_ontology_2.ttl @@ -0,0 +1,24 @@ +@prefix : . +@prefix owl: . +@prefix rdf: . +@prefix xml: . +@prefix xsd: . +@prefix rdfs: . +@base . + + rdf:type owl:Ontology ; + rdfs:comment "Vocabulary for a reasoning use case"@en ; + rdfs:label "Eccenca Reasoning Vocabulary"@en ; + rdfs:seeAlso ; + owl:imports . + + +### https://ns.eccenca.com/reasoning/e02aaed014c94e0c91bf960fed127750/vocab/animal +:animal rdf:type owl:Class ; + rdfs:subClassOf [ rdf:type owl:Restriction ; + owl:onProperty :eats ; + owl:someValuesFrom owl:Thing + ] ; + rdfs:comment ""^^xsd:string ; + rdfs:isDefinedBy ; + rdfs:label "animal"^^xsd:string . diff --git a/tests/test_reason_ontology_3.ttl b/tests/test_reason_ontology_3.ttl new file mode 100644 index 0000000..0e7e0ae --- /dev/null +++ b/tests/test_reason_ontology_3.ttl @@ -0,0 +1,27 @@ +@prefix : . +@prefix owl: . +@prefix rdf: . +@prefix xml: . +@prefix xsd: . +@prefix rdfs: . +@base . + + rdf:type owl:Ontology ; + rdfs:comment "Vocabulary for a reasoning use case"@en ; + rdfs:label "Eccenca Reasoning Vocabulary"@en ; + rdfs:seeAlso . + + +### https://ns.eccenca.com/reasoning/e02aaed014c94e0c91bf960fed127750/vocab/cat_owner +:cat_owner rdf:type owl:Class ; + owl:equivalentClass [ owl:intersectionOf ( :person + [ rdf:type owl:Restriction ; + owl:onProperty :has_pet ; + owl:someValuesFrom :cat + ] + ) ; + rdf:type owl:Class + ] ; + rdfs:comment ""^^xsd:string ; + rdfs:isDefinedBy ; + rdfs:label "cat owner"^^xsd:string . \ No newline at end of file diff --git a/tests/test_validate.md b/tests/test_validate.md index f0ee2ce..f7a6f74 100644 --- a/tests/test_validate.md +++ b/tests/test_validate.md @@ -6,14 +6,14 @@ # Axiom Impact ## Axioms used 1 times -- [A](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/A) SubClassOf [B](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/B) [vocab] -- [A](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/A) DisjointWith [B](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/B) [vocab] -- [D_6](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/D_6) Type [A](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/A) [vocab] +- [A](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/A) SubClassOf [B](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/B) [] +- [A](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/A) DisjointWith [B](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/B) [] +- [D_6](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/D_6) Type [A](https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab/A) [] # Ontologies used: -- vocab (https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab) +- (https://ns.eccenca.com/validateontology/e02aaed014c94e0c91bf960fed127750/vocab3/) diff --git a/tests/test_validate_ontology_1.ttl b/tests/test_validate_ontology_1.ttl new file mode 100644 index 0000000..f27b0c2 --- /dev/null +++ b/tests/test_validate_ontology_1.ttl @@ -0,0 +1,9 @@ +@prefix : . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@base . + + rdf:type owl:Ontology ; + owl:imports . + diff --git a/tests/test_validate_ontology_2.ttl b/tests/test_validate_ontology_2.ttl new file mode 100644 index 0000000..008cd76 --- /dev/null +++ b/tests/test_validate_ontology_2.ttl @@ -0,0 +1,9 @@ +@prefix : . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@base . + + rdf:type owl:Ontology ; + owl:imports . + diff --git a/tests/test_validate_ontology.ttl b/tests/test_validate_ontology_3.ttl similarity index 94% rename from tests/test_validate_ontology.ttl rename to tests/test_validate_ontology_3.ttl index e6fa516..2f5424e 100644 --- a/tests/test_validate_ontology.ttl +++ b/tests/test_validate_ontology_3.ttl @@ -2,9 +2,9 @@ @prefix owl: . @prefix rdf: . @prefix rdfs: . -@base . +@base . - rdf:type owl:Ontology . + rdf:type owl:Ontology . ################################################################# # Classes