3

I am using RDF lib with python. Is it there any function that controls if an ontology is inconsistent.

<  owl:Class rdf:about="http://www.semanticweb.org/ontologies/2016/1/semantic_mapping_domain_model#Chair">
    <  owl:equivalentClass rdf:resource="http://www.semanticweb.org/ontologies/2016/1/semantic_mapping_domain_model#Table"/>
    <  rdfs:subClassOf rdf:resource="http://www.semanticweb.org/ontologies/2016/1/semantic_mapping_domain_model#Furniture"/>
    <  owl:disjointWith rdf:resource="http://www.semanticweb.org/ontologies/2016/1/semantic_mapping_domain_model#Table"/>
<  /owl:Class>

I have forced an individual to belong to some class and to its complement. I would like to perform a consistency check on a .owl file using python.

Starting the Pellet reasoner with Protégé returns:

InconsistentOntologyException: cannot do reasoning on inconsistent ontologies!

When I load the ontology (you can find it here) with the following python code:

import uri
from rdflib import Graph, Literal, BNode, Namespace, RDF, URIRef
from rdflib.namespace import DC, FOAF, RDF
[...]
g = Graph()
g.parse("/local_path/scripts/semantic_mapChairs.owl")
[...]

nothing is detected (there is an instance of the object Chair). Do you have any advice?

UserK
  • 884
  • 3
  • 17
  • 40
  • 1
    RDFLib is, as the name implies, an RDF library. It is not an OWL reasoner. – Jeen Broekstra Oct 29 '16 at 03:48
  • Is it possible to use an OWL reasoner to perform a consistency check on an ontology and notify a python program about the result? – UserK Nov 03 '16 at 15:39
  • Probably you could use [tag:owlready]. – Stanislav Kralin Mar 06 '18 at 12:36
  • Thanks I ll have look. It seems that the library supports reasoners invocation – UserK Mar 06 '18 at 15:18
  • I have this exact same requirement - owl defines the logic, but I have an independent set of rdf that contains the instances. My question on how to go about doing this using owlready2 is here: https://stackoverflow.com/questions/74389044/owlready2-importing-in-memory-rdflib-graph – Thomas Kimber Nov 10 '22 at 12:38
  • I need to check the updated documentation of both rdflib and owlready2. And fix the Deadlink too – UserK Nov 16 '22 at 12:00

0 Answers0