Search code examples
sparqlrdfowlrdfs

How can I create an owl:intersectionOf two owl:Classes?


For a school exercise, I have an RDF file and an OWL file.

There is an owl:Class Lecturer and an owl:Class Researcher. The intersection of both should be a Professor. I have put my RDF and OWL file below.

Problem is: when I do my query, no resource is of type Professor, while in the RDF file we can see that Laura should be a Professor.

Reduced version of rdf file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
<!ENTITY humans   "http://www.inria.fr/2007/09/11/humans.rdfs"> 
<!ENTITY xsd      "http://www.w3.org/2001/XMLSchema#"> ]> 
<rdf:RDF  
   xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
   xmlns:xsd ="&xsd;" 
   xmlns     ="&humans;#" 
   xml:base  ="&humans;-instances" > 
    <Person rdf:ID="Laura">
        <name>Laura</name>
    </Person>
    <Lecturer rdf:about="#Laura"/>
    <Researcher rdf:about="#Laura">
      <name>Laura</name>
    </Researcher>
</rdf:RDF>

Reduced version of owl file:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.inria.fr/2007/09/11/humans.rdfs"
xmlns:owl="http://www.w3.org/2002/07/owl#">

    <owl:Class rdf:ID="Person">
    </owl:Class>

    <owl:Class rdf:ID="Lecturer">
        <subClassOf rdf:resource="#Person"/>
    </owl:Class>

    <owl:Class rdf:ID="Researcher">
        <subClassOf rdf:resource="#Person"/>
    </owl:Class>

    <owl:Class rdf:id="Professor">
        <owl:intersectionOf rdf:parseType="Collection">
            <owl:Class rdf:about="#Lecturer"/>
            <owl:Class rdf:about="#Researcher"/>
        </owl:intersectionOf>
    </owl:Class>

</rdf:RDF>

The query I used was the defautl query:

 select * where {
   ?x ?p ?y
 }

But what I actually would expect to do is the following:

select * where {
   ?x a <http://www.inria.fr/2007/09/11/humans.rdfs#Professor>
}

I did look at this answer: Why do we need to use rdf:parseType="Collection" with owl:intersectionOf? but I don't understand in which way it should be used for my specific problem.

I hope somebody can help. By the way, it's my first post here, so let me know if something's missing.


Solution

  • Paraphrased from comments by @stanislav-kralin:

    Use correct capitalization of rdf:ID (not rdf:id), and enable "OWL-Max" reasoning when loading your RDF into GraphDB.