Search code examples
rdfowlontologyprotege

Can an ObjectProperty have a DatatypeProperty?


I'm trying to describe a graph using OWL. Let's say I want two classes workshop and location, and an edge between them hasLocation. Can I have a property on hasLocation which will denote the time that workshop occurred at location? I tried to define this using Protege but it seems one can only define properties on classes.


Solution

  • You could use annotations or punning.

    However, annotation or data property will be a property of the hasLocation property itself, and not of its particular occurences. That is a key difference between RDF/OWL and LPG.

    I'd suggest to use more or less common modelling techniques. In Turtle:

    @prefix : <http://www.semanticweb.org/1226761/ontologies/2018/10/untitled-ontology-6#> .
    @prefix owl: <http://www.w3.org/2002/07/owl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    
    [ rdf:type owl:Ontology ] .
    
    :Workshop rdf:type owl:Class .
    :Location rdf:type owl:Class .
    :SpatioTemporalExtent rdf:type owl:Class . 
    
    :hasLocation rdf:type owl:ObjectProperty ;
                 rdfs:domain :SpatioTemporalExtent ;
                 rdfs:range :Location .
    
    :hasSpatioTemporalExtent rdf:type owl:ObjectProperty ;
                             rdfs:domain :Workshop ;
                             rdfs:range :SpatioTemporalExtent .
    
    :hasTime rdf:type owl:DatatypeProperty ;
             rdfs:domain :SpatioTemporalExtent ;
             rdfs:range xsd:dateTime . 
    
    :workshop1 rdf:type owl:NamedIndividual , :Workshop ;
               :hasSpatioTemporalExtent :extent11 .    
    
    :extent11 rdf:type owl:NamedIndividual , :SpatioTemporalExtent ;
              :hasLocation :city1 ;
              :hasTime "2018-05-11T00:00:00"^^xsd:dateTime .
    
    :city1 rdf:type owl:NamedIndividual , :Location .
    

    Alternatively, with anonymous individuals:

    :workshop1 rdf:type owl:NamedIndividual , :Workshop ;
               :hasSpatioTemporalExtent [rdf:type :SpatioTemporalExtent ;
                                         :hasLocation :city1 ;
                                         :hasTime "2018-05-11T00:00:00"^^xsd:dateTime .
                                        ] .
    

    Do you know what is the reasoning behind not allowing properties on edges?

    RDF means Resource Description Framework. It was initially intended for publishing data on the Web. Resources should have URIs (well, unless they are literals). Property occurences are not considered to be ontologically solid enough to have such strong identifiers. For example, their number is relatively large… In English, for comparison, one'd rather say "I love you" than "I love-5 you".

    Blank nodes (with their weak identifiers) in the predicate position could resolve this issue. So the question remains why blank nodes are not allowed in the predicate position (even for Tim Berners-Lee, though not for Manu Sporny).

    I suppose that the reason is the desire to not leave first order ground for good, bearing in mind 'natural' translation of the a b c triple into FOL as something like b(a,c). Then [] b c could be translated as ∃x b(x,c), but what about a [] c?