Tralgar
Tralgar

Reputation: 1

OWL : how to restrict range with some values in an other property

I have a class Selfie, an objectProperty personPicture (domain Picture, range Person) to explain who is on the picture, and a dc:creator. I want to say that a selfie must have at least 1 personPicture, and the dc:creator should be someone in the list of personPicture. I tried :

<owl:Class rdf:about="http://www.semanticweb.org/leo/ontologies/album#Selfie">
    <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/leo/ontologies/album#Picture"/>
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="http://www.semanticweb.org/leo/ontologies/album#personPicture"/>
            <owl:minQualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:minQualifiedCardinality>
            <owl:onClass rdf:resource="http://www.semanticweb.org/leo/ontologies/album#Person"/>
        </owl:Restriction>
    </rdfs:subClassOf>
</owl:Class>

but it doesn't work. I can have a selfie without personPicture and I absolutely don't know how to do the second trick!

Upvotes: 0

Views: 362

Answers (1)

Joshua Taylor
Joshua Taylor

Reputation: 85853

Your axioms are easier to read in Manchester syntax, where they are:

    Selfie SubClassOf Picture
    Selfie SubClassOf personPicture min 1 Person

The second says that each Selfie is related to at least one Person by the property personPicture. That's consistent with a dataset like:

    x a Selfie .

Even though it doesn't specify which Person x is related to by personPicture, a reasoner will correctly infer that there is one. That's part of the open-world assumption that is adopted in OWL. Just because something isn't know does not mean that it is false.

As for your second condition, I'm not sure that you can express it in OWL. You might be able to the axiom that "if a picture's creator is in the picture, then the picture is a Selfie", but that's the other direction from what you're asking.

Upvotes: 3

Related Questions