OWL instance participation logic

2019-06-05 08:25发布

In OWL:

  • There is a class X and the properties P1, P2, and P3, each of which has domain X.

I want to say:

  • Every instance of X must at least participate in a relation with one of the properties P1 or P3.
  • Every instance of X which participates in a relation with P2 must also participate in a relation with P1.
  • But every instance of X may only participate in relations with P1 and P2 or in relations with P3.

Maybe it is easier to understand with some syntax and labels:

:Chronology a owl:Class ;
    rdfs:label "X" ;
:hasBegin a owl:DatatypeProperty ;
    rdfs:label "P1" ;
    rdfs:domain :Chronology .
:hasEnd a owl:DatatypeProperty ;
    rdfs:label "P2" ;
    rdfs:domain :Chronology .
:hasNoBeginNoEnd a owl:DatatypeProperty ;
    rdfs:label "P3" ;
    rdfs:domain :Chronology .

I understand the concept of anonymous classes and restrictions but nothing really seems to fit.

标签: logic rdf owl
1条回答
beautiful°
2楼-- · 2019-06-05 09:04

You have a few different constraints here, but they can all be represented in OWL. Let us address the constraints one at a time.

  • Every instance of X must at least participate in a relation with one of the properties P1 or P3.

This says that for every x, either there is a y such that P1(x,y), or there is a z such that P2(x,z). In OWL, this is expressed by

X SubClassOf ((P1 some Thing) or (P2 some Thing))

The class expression P1 some Thing represents the class of things that are related by P1 to some entity. Similarly for P2 some Thing. The subClassOf axiom as a whole says that “if something is an X, then it is either a P1 some Thing or a P2 some Thing.” (You could also use P min 1 instead of P some Thing, if you wanted to. It is not a significant difference.)

  • Every instance of X which participates in a relation with P2 must also participate in a relation with P1.

This says that for every x, if there is a y such that P2(x,y), then there is also a z such that P1(x,z). Another way of saying this is that “for every x, if x is an X and there is a y such that P2(x,y), then there is also a z such that P1(x,z).” This can be expressed by another subclass axiom:

(X and (P2 some Thing)) SubClassOf (P1 some Thing)

(For the sake of generality, I used X and (P2 some Thing) on the left side of this subclass axiom. In this specific case, since X is the domain of P2, we can infer that P2 some Thing is a subclass of X, so we could also have used just P2 some Thing on the left.)

  • But every instance of X may only participate in relations with P1 and P2 or in relations with P3.

This says that if some x is an X and there is a y such that P3(x,y), then there is no z such that P1(x,z) or P2(x,y), and vice versa. You can represent this in a few ways. You could use two subclass axioms:

(X and (P3 some Thing))                      SubClassOf ((P1 max 0) and (P2 max 0))
(X and ((P1 some Thing) or (P2 some Thing))) SubClassOf (P3 max 0)

You could also use a single disjoint class axiom (notice that X appears on both sides)

(X and (P3 some Thing)) DisjointWith (X and ((P1 some Thing) or (P2 some Thing)))

(As I noted in the previous case, since the domain of the properties is X, the class X and (P3 some Thing) is equivalent to P3 some Thing. The left side of these subclass axioms could also be simply P3 some Thing and (P1 some Thing) or (P2 some Thing), and the classes in the disjoint axioms could be P3 some Thing and (P1 some Thing) or (P2 some Thing).)

Here's what the classes and axioms in the ontology looks like (in the N3 format):

:X    a       owl:Class ;
      rdfs:subClassOf
              [ a       owl:Class ;
                owl:unionOf ([ a       owl:Restriction ;
                            owl:onProperty :P1 ;
                            owl:someValuesFrom owl:Thing
                          ] [ a       owl:Restriction ;
                            owl:onProperty :P2 ;
                            owl:someValuesFrom owl:Thing
                          ])
              ] .

[]    a       owl:Class ;
      rdfs:subClassOf
              [ a       owl:Restriction ;
                owl:onProperty :P1 ;
                owl:someValuesFrom owl:Thing
              ] ;
      owl:intersectionOf (:X [ a       owl:Restriction ;
                  owl:onProperty :P2 ;
                  owl:someValuesFrom owl:Thing
                ]) .

[]    a       owl:Class ;
      owl:disjointWith
              [ a       owl:Class ;
                owl:intersectionOf (:X [ a       owl:Restriction ;
                            owl:onProperty :P3 ;
                            owl:someValuesFrom owl:Thing
                          ])
              ] ;
      owl:intersectionOf (:X [ a       owl:Class ;
                  owl:unionOf ([ a       owl:Restriction ;
                              owl:onProperty :P1 ;
                              owl:someValuesFrom owl:Thing
                            ] [ a       owl:Restriction ;
                              owl:onProperty :P2 ;
                              owl:someValuesFrom owl:Thing
                            ])
                ]) .

Commentary on Blank Node Usage

As pointed out in the comments, the ontology above uses class expressions represented by blank nodes as the subjects of the two "general class axioms", i.e., the subclass axioms that related two class expressions, neither of which is a simple class identifier. The original OWL Web Ontology Language Reference includes, in Appendix E: Rules of Thumb for OWL DL Ontologies:

Avoid orphan blank nodes In general, blank nodes occurring in the graph either represent unnamed individuals, or should be exactly one of the following:

  • The object of an rdfs:subClassOf, owl:equivalentClass, owl:disjointWith, owl:someValuesFrom, owl:allValuesFrom or rdf:type triple.
  • The subject of an rdf:type triple with object owl:AllDifferent.
  • An element in an rdf:List.

Orphan blank nodes, i.e. those which are not the object of a triple are, in general, not allowed (other than the owl:AllDifferent case described above).

At first glance, it would seem that the ontology provided above violates this, because the "general class axioms" (class axioms whose subject is not a class identifier) have class expressions as their subject. However, section 3.2 Class Axioms gives the syntax of, e.g., rdfs:subClassOf axioms as

AXIOM SCHEMA: class description rdfs:subClassOf class description

That section also includes the note:

NOTE: In OWL Lite the subject of an rdfs:subClassOf statement must be a class identifier. The object must be either a class identifier or a property restriction.

This suggests that Appendix E is mistaken in omitting certain cases where "orphan blank nodes" are allowed. That suggestion isn't normative, of course; it opens with the introduction:

The following rules give an informal characterization of the conditions for an RDF graph to be a DL ontology. This is not intended to replace the characterization given in S&AS, but instead gives some general pointers — the idea is that if you stick to these guidelines, you're more likely to produce OWL DL ontologies. [emphasis added]

For confirmation, we need to look at section 8. OWL Full, OWL DL and OWL Lite, which describes the precise constructs that are allowed in OWL Full, OWL DL, and Owl Lite ontologies. That section reiterates that, in OWL Lite,

the subject of rdfs:subClassOf triples be class names and the object of rdfs:subClassOf triples be class names or restrictions;

but puts no such restrictions on OWL DL ontologies. Section 8 does require, for OWL DL ontologies, that

All axioms must be well-formed, with no missing or extra components, and must form a tree-like structure. The last constraint implies that all classes and properties that one refers to are explicitly typed as OWL classes or properties, respectively.

This points out that

[] rdfs:subClassOf :Foo . 

is not valid OWL DL, but that

[] a owl:Class ; 
   rdfs:subClassOf :Foo .

is (provided that :Foo is an owl:Class, of course). The non-normative Appendix E simply missed a case where "orphan blank nodes" can be used. General class axioms don't get used all that often, except when some particularly complicated sentences need to be represented, so it's not a hard mistake to make.

For some more information about general class axioms, see Being complex on the left-hand-side: General Concept Inclusions.

查看更多
登录 后发表回答