Search code examples
rdfsparqlowlprotege

Infer teacher-student relationships via courses?


I have created an ontology about a university, like the one discussed in this series of YouTube videos.

There are classes and instances of students, professors and courses. There are "studies" and "teaches" properties that relate students and professors to their classes.

<ObjectPropertyAssertion>
    <ObjectProperty IRI="#teaches"/>
    <NamedIndividual IRI="#Cadbury"/>
    <NamedIndividual IRI="#EL101"/>
</ObjectPropertyAssertion>

<ObjectPropertyAssertion>
    <ObjectProperty IRI="#studies"/>
    <NamedIndividual IRI="#Hechinger"/>
    <NamedIndividual IRI="#EL101"/>
</ObjectPropertyAssertion>

Is determining that Hechinger is a student of Cadbury something that I should be able to do with OWL reasoning or inference in Protege?


Solution

  • Is determining that Hechinger is a student of Cadbury something that I should be able to do with OWL reasoning or inference in Protege?

    If you have a isStudentOf property, then you can define the axioms that would make this inference work. E.g., in this case, you'd want to assert that the chain

            studiesteaches-1

    is a subproperty of isStudentOf. That is, if a student studies a course, and then course is taught by some professor, then the student is a student of that professor. Here's what it looks like in Protege:

    subproperty chain axiom

    inference

    Here's the ontology, which you can load into Protege:

    @prefix :      <urn:ex:#> .
    @prefix ex:    <urn:ex:#> .
    @prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix owl:   <http://www.w3.org/2002/07/owl#> .
    @prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
    @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
    
    ex:isStudentOf  a               owl:ObjectProperty ;
            owl:propertyChainAxiom  ( ex:studies _:b0 ) .
    
    ex:studies  a   owl:ObjectProperty .
    
    _:b0    owl:inverseOf  ex:teaches .
    
    ex:EL101  a     owl:Thing , owl:NamedIndividual .
    
    <urn:ex:>  a    owl:Ontology .
    
    ex:Hechinger  a     owl:Thing , owl:NamedIndividual ;
            ex:studies  ex:EL101 .
    
    ex:teaches  a   owl:ObjectProperty .
    
    ex:Cadbury  a       owl:Thing , owl:NamedIndividual ;
            ex:teaches  ex:EL101 .