Equal relationship between ontology properties
Asked Answered
L

1

1

I have 2 properties, e.g. 'hasColor' and 'hasFinish'. I want to express with ontology that in case of ontology class A are properties 'hasColor' and 'hasFinish' equal (owl:equivalentProperty). But in case of ontology class B the properties 'hasColor' and 'hasFinish' are NOT equal.

How can I achieve this?

One way probably is to create 'hasColor' and 'hasFinish' properties with class A as a range and set them to be equal. Then create another ones 'hasColor' and 'hasFinish' properties with class B as a range and without equal relationship. But is it right approach?

Leoni answered 24/11, 2013 at 23:42 Comment(1)
When you say that they're not equal for Class B, do you mean that they must not have the same value (e.g., you can't have b1 hasFinish x; hasColor x) or just that they don't necessarily have the same value (e.g., that b2 hasFinish x; hasColor y (with x != y) is permitted)? Two relations can be distinct, but still have overlap. On top of that, you might not require that two relations are the same, but they might, in fact, end up having the same extension.Extravasate
E
2

It's not entirely clear yet what you mean by making two properties un-equal. By default, two properties can be distinct, so you don't really have to do anything special to let them be unequal. If the question is clarified, though, perhaps more information can be added about that.

It's not entirely trivial to say that, e.g.,

∀a,x . A(a) → (hasFinish(a,x) ⇔ hasColor(a,x))

in OWL, but you can do it. If you want to say this for all classes, you can, as you pointed out, use owl:equivalentProperty. Now, when you say that p is an equivalent property to r, you could also say that

p ⊑ r
r ⊑ p

that is, that each of p and r are subproperties of the other. In OWL 2 (but, unfortunately, not OWL 2 DL, as Antoine Zimmermann pointed out in the comments), you can assert that a given property is a superproperty of a chain of properties, e.g.,

hasFather • hasBrother ⊑ hasUncle

which says that if someone has a father who has a brother, then that father's brother is that person's uncle.

There's also a concept called rolification, which has been described more in OWL 2 rolification, which is the process of creating a property corresponding to a class that relates each individual of that class to itself. For you class A, there would be a relation RA that relates each A to itself, and only relates those instances. If you then look at a property chain like

RA • hasFinish

you'll notice that it's really the subproperty of hasFinish where the first argument is an A. This means that you can say that hasFinish and hasColor are the same for the class A by making two subproperty assertions:

RA • hasColor ⊑ hasFinish
RA • hasFinish ⊑ hasColor

These assume that individuals of type A are the subjects of these statements. If A is actually the range here, then you'd just use

∀a,x . A(a) → (hasFinish(x,a) ⇔ hasColor(x,a))
hasColor • RA ⊑ hasFinish
hasFinish • RA ⊑ hasColor

To get the property RA, you need to add the definition

A ≡ ∃RA.Self

to your ontology. In Protégé, this would look like:

enter image description here enter image description here enter image description here

and the resulting ontology looks like (in RDF/XML):

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns="http://example.org/ep#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <owl:Ontology rdf:about="http://example.org/ep"/>
  <owl:Class rdf:about="http://example.org/ep#A">
    <owl:equivalentClass>
      <owl:Restriction>
        <owl:onProperty>
          <owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/>
        </owl:onProperty>
        <owl:hasSelf rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
        >true</owl:hasSelf>
      </owl:Restriction>
    </owl:equivalentClass>
  </owl:Class>
  <owl:ObjectProperty rdf:about="http://example.org/ep#hasFinish">
    <owl:propertyChainAxiom rdf:parseType="Collection">
      <owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/>
      <owl:ObjectProperty rdf:about="http://example.org/ep#hasColor"/>
    </owl:propertyChainAxiom>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://example.org/ep#hasColor">
    <owl:propertyChainAxiom rdf:parseType="Collection">
      <owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/>
      <owl:ObjectProperty rdf:about="http://example.org/ep#hasFinish"/>
    </owl:propertyChainAxiom>
  </owl:ObjectProperty>
</rdf:RDF>

and in Turtle:

@prefix :      <http://example.org/ep#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

:hasFinish  a                   owl:ObjectProperty ;
        owl:propertyChainAxiom  ( :R_A :hasColor ) .

:A      a                    owl:Class ;
        owl:equivalentClass  [ a               owl:Restriction ;
                               owl:hasSelf     true ;
                               owl:onProperty  :R_A
                             ] .

:hasColor  a                    owl:ObjectProperty ;
        owl:propertyChainAxiom  ( :R_A :hasFinish ) .

<http://example.org/ep>
        a       owl:Ontology .

:R_A    a       owl:ObjectProperty .
Extravasate answered 25/11, 2013 at 17:23 Comment(9)
Hi Joshua, thanks for answer, I'm gonna study it to know more about ontologies. However I realized my question was not clear. I ment property equality (owl:sameAs construct) instead of equivalence (owl:equivalentProperty construct). So I want to say that if Instance is of Class A then properties hasColor and hasFinish are equal (owl:sameAs) - I treat them as a properties with same meaning, but if these properties are used with Individual of Class B, then I want to treat them as a different properties with different meaning. I think that this is probably not possible to do with owl syntax?Leoni
Joshua, excellent answer. Note, however, than the construction you use is not in OWL 2 DL. Consequently, some reasoners may not be able to make inferences with it (e.g., Pellet, HermiT). Other reasoners may be able to deal with this construction but only by being incomplete.Lentissimo
user3024710, from your comment here, I have the impression that you misunderstand the notion of owl:sameAs. A thing x is owl:sameAs a thing y if x and y are interchangeable names of just one thing, in all possible situations. There is no context dependent sameAs.Lentissimo
@AntoineZimmermann Hmm, I'd been trying to keep in in OWL 2 DL; can you elaborate on which part isn't in OWL 2 DL? Is it something about the complexity of the properties in the property chain?Extravasate
@AntoineZimmermann Ah, I just ran it through the validator; it's the cycle in the subproperty chains. However, this seems to imply that if we use just one direction, we can get "if c hasColor d, and d is an A, then c also hasFinish d." We just can't have both directions at the same time.Extravasate
@Leoni To extend AntoineZimmermann's comment, owl:sameAs is for relating individuals, not properties. From its definition (emphasis added): "The built-in OWL property owl:sameAs links an individual to an individual. Such an owl:sameAs statement indicates that two URI references actually refer to the same thing: the individuals have the same "identity"." The properties aren't individuals, so you wouldn't relate them with owl:sameAs. While my answer isn't within OWL 2 DL, as AntoineZimmermann pointed out, it does have the effect…Extravasate
@Leoni that whereever you have x hasColor y && y is an A you also have x hasFinish y and vice versa, but only in the case where y is an A. This seems like what you wanted; if the object is an element of a particular class, then the same subject and object are related by the other property. That's exactly what it means to say that the two properties, as restricted to a particular range, are equivalent.Extravasate
Isn't hasUncle ⊑ hasFather • hasBrother backwards? Everything else I've read shows it as hasFather • hasBrother ⊑ hasUncle. Am I missing something?Clostridium
@JimL. Yup, it's a typo. I'll fix it. All the screenshots in the question show it the other way around. And OWL doesn't let you do it with the subproperty chain as the superclass anyhow. (It would be tough, since it would mean that "if hasUncle(x,y), then there exists some z such that hasFather(x,z) and hasBrother(z,y)."Extravasate

© 2022 - 2024 — McMap. All rights reserved.