rl18
rl18

Reputation: 41

DataProperties in Subclass expression

I tried working with the OWL2-RL rules build into graphdb. I am obviously doing something wrong or understood something wrong. Here is my toy ontology.

<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/rlehmann/ontologies/2017/10/untitled-ontology-182#"
     xml:base="http://www.semanticweb.org/rlehmann/ontologies/2017/10/untitled-ontology-182"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:untitled-ontology-182="http://www.semanticweb.org/rlehmann/ontologies/2017/10/untitled-ontology-182#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:ontology="http://www.some/ontology/">
    <owl:Ontology rdf:about="http://www.semanticweb.org/rlehmann/ontologies/2017/10/untitled-ontology-182"/>

    <!-- http://www.some/ontology/hasValue -->
    <owl:DatatypeProperty rdf:about="http://www.some/ontology/hasValue">
         <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    </owl:DatatypeProperty>

    <!-- http://www.some/ontology/ClassA -->
    <owl:Class rdf:about="http://www.some/ontology/ClassA"/>

    <!-- http://www.some/ontology/InvA -->
    <owl:NamedIndividual rdf:about="http://www.some/ontology/InvA">
        <rdf:type rdf:resource="http://www.some/ontology/ClassA"/>
        <ontology:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#string">StringValue</ontology:hasValue>
    </owl:NamedIndividual>

    <!-- http://www.some/ontology/InvB -->
    <owl:NamedIndividual rdf:about="http://www.some/ontology/InvB">
        <ontology:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#string">FooBar</ontology:hasValue>
    </owl:NamedIndividual>


    <owl:Restriction>
        <owl:onProperty rdf:resource="http://www.some/ontology/hasValue"/>
        <owl:someValuesFrom rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
        <rdfs:subClassOf rdf:resource="http://www.some/ontology/ClassA"/>
    </owl:Restriction>
</rdf:RDF>

If I did not misunderstand Table 2 in OWL2-Profiles this ontology should be in OWL2 RL profile. I would expect "InvB" to be classified as type ClassA. But it doesn't. It actually does with reasoners (HermiT, Pellet, ...) but not with Rules (Drools, Graphdb) is this a gap in the specification.

How can my Ontology be "repaired" or is there any workaround?

Cheers,

Robert

Upvotes: 2

Views: 190

Answers (1)

rl18
rl18

Reputation: 41

Not using anonymous classes on the left-hand side of the GCI is not an option for our application. And yes object properties work perfectly.

After some research we actually found out, that it can never work that way. In the GraphDB .pie file that corresponds to the RL-Profile there is only a notion to some rules "// These are not implemented (and probably not implementable)". This includes the rule "dt-type2" defined in OWL2 RL Section 4.3 Table 8. RDF section 3.1 gives the actual answer why this is not supposed to work.

  1. RDF Graphs

    An RDF graph is a set of RDF triples.

    3.1 Triples

    An RDF triple consists of three components:

    • the subject, which is an IRI or a blank node

    • the predicate, which is an IRI

    • the object, which is an IRI, a literal or a blank node

"FooBar"^^xsd:string rdf:type xsd:string this is simply not allowed but obviously required.

We are quite uncertain what the guys at w3c had in mind besides RDF?!

As it is now, this kind of inference will not work in GraphDB at all (and on no rule engines in general?). But it is not the fault of GraphDB but merely a gap in the specification chain.

However, we did a workaround in our ontology that solves the problem and is working for us. We simply

  • defined new concepts for the data types we use
  • Transformed all DataProperties to ObjectProperties
  • introduces new DataType properties with domain one of the new datatype concepts and range xsd:xyz. For example Property:hasStringValue Domain:string Range:xsd:string

This works for us.

Upvotes: 2

Related Questions