14.  OWL APIs

14.1  Subsumption in OWL

We discriminate the substantial inclusiveness on concepts that is decided through rdfs:subClassOf, owl:intersectionOf, and owl:unionOf, against the non-substantial inclusiveness, that can be reasoned out by entailment rules and a subsumption inference engine. The former is calculated through the CLOS class-subclass relationship, and the latter is deduced by the subsumption algorithm described below in SWCLOS. The top concept in the OWL universe, owl:Thing, substantially subsumes every concept of OWL vocabulary in the CLOS class-subclass relation or OWL reasoning, but the bottom concept, owl:Nothing, is virtually subsumed by other concepts only through this algorithm. We extended and modified the basic structural subsumption algorithm, that is described in “The Description Logic Handbook” [DLH], to one that contains disjunction (owl:unionOf), negation (owl:complementOf), equivalency (owl:sameAs and owl:equivalentOf), functional and inverse-functional relation (owl:FunctionalProperty and owl:InverseFunctionalProperty), symetric relation (owl:SymmetricProperty), the value restriction (owl:allValuesFrom), the full existential restriction (owl:someValuesFrom), the filler restriction (owl:hasValue), and the number restriction (owl:maxCardinality, owl:minCardinality, and owl:cardinality).

The algorithm is summarized as follows, for two concepts C and D;

  1. If C is the bottom, then it returns true.
  2. If D is the top, then it returns true.
  3. If D is the bottom, then it returns false.
  4. If C is a subclass of D in CLOS, then it returns true.
  5. If D is a subclass of C in CLOS, then it returns false.
  6. If C and D is the same as individual, then it returns true.
  7. If C and D have oneOf slots and Cfs members are subset of Dfs members, then it returns true, otherwise false.
  8. For some (cc) of equivalent classes of C and some (dd) of equivalent classes of D;
  9. For some (cc) of same individuals of C and some (dd) of same individuals of D;

The algorithm for intersections is summarized as follows.

  1. Firstly, D is unfolded on the intersection of concepts. Namely, if an element of intersections is also the concept of intersections, all members of the intersection are retrieved and the flattened list of all intersection elements is made.
  2. Secondly, C’s class precedence list (cpl), that is, a list of all super concepts of C including itself is computed.
  3. If every concept member (except property restrictions) of intersections of unfolded D subsumes some concept member of C’s cpl, then go to the next step, otherwise false.
  4. If no restrictions of unfolded D, then returns true. Otherwise, go to the next step, namely model generation and testing process.
  5. Generate possible models of C and every models are checked if some of them satisfy the D’s restrictions.

The algorithm of generation models and typed unification theory, which is used in model matching, is more complicated and difficult for beginers of SWCLOS. This advanced topic is shown in Phd theses.

The following demonstrates the function of this algorithm.

gx-user(7): (subsumed-p vin:DryWhiteWine vin:WhiteNonSweetWine)
t
t
gx-user(8): (get-form vin:WhiteNonSweetWine)
(owl:Class vin:WhiteNonSweetWine
  (owl:intersectionOf vin:WhiteWine
    (owl:allValuesFromRestriction (owl:onProperty vin:hasSugar)
      (owl:allValuesFrom (OneOf (owl:oneOf vin:Dry vin:OffDry))))))
gx-user(9): (get-form vin:DryWhiteWine)
(owl:Class vin:DryWhiteWine
  (owl:intersectionOf vin:DryWine vin:WhiteWine))
gx-user(10): (get-form vin:DryWine)
(owl:Class vin:DryWine
  (owl:intersectionOf vin:Wine
    (owl:hasValueRestriction (owl:onProperty vin:hasSugar)
                             (owl:hasValue vin:Dry))))

subsumed-p C D
[Function]
returns true if concept C  is subsumed by D.

14.2  Membership in OWL

We extended the membership checking algorithm in OWL and it is implemented to gx:typep. The followings demonstrate some membership relations among classes and things in OWL after loading Wine Ontology.

gx-user(15): (typep vin:ElyseZinfandel vin:Zinfandel)
t
t
gx-user(16): (typep vin:ElyseZinfandel owl:Thing)
t
t
gx-user(17): (owl-thing-p vin:ElyseZinfandel)
t
gx-user(18): (typep vin:Zinfandel owl:Class)
t
t
gx-user(19): (typep vin:Zinfandel owl:Thing)
t
t
gx-user(20): (owl-class-p vin:Zinfandel)
t
gx-user(21): (owl-class-p owl:Class)
nil
gx-user(22): (owl-class-p owl:Restriction)
nil
gx-user(23): (owl-thing-p owl:Class)
nil
gx-user(24): (owl-thing-p owl:Restriction)
nil
gx-user(25): (owl-class-p owl:Thing)
t
gx-user(26): (owl-thing-p owl:Thing)
t
gx-user(27): (owl-class-p owl:Nothing)
t
gx-user(28): (owl-thing-p owl:Nothing)
nil

An individual (instance) that is typed to owl:Thing and a concept (class) that is typed to owl:Class belong to the OWL universe. However, note that owl:Class and owl:Restriction are not members in OWL universe. Also note that owl:Thing itself belongs to OWL universe but owl:Nothing does not, even though the class of owl:Nothing is owl:Class as well as owl:Thing, because owl:Nothing is complement of owl:Thing.

owl-class-p obj
[Function]
This is almost same as ‘(cl:typep obj owl:Class)’ but a little bit faster and concise expression.

owl-thing-p obj
[Function]
This is almost same as ‘(cl:typep obj owl:Thing)’ but a little bit faster and concise expression.

typep object type
[Function]
tests the membership of object to type in the semantics of OWL.

14.3  The Most Specific Concepts

Computing the most specific concepts in a set of concepts is basic operation in DL and SWCLOS. We use this routine very often in SWCLOS.

most-specific-concepts classes
[Function]
returns the most specific concepts in RDF(S) and OWL semantics, or classes minus duplicates and superclasses of other classes in classes. This function internally uses subsumed-p and owl-equivalent-p. Note that this function does not check disjointness of classes.

References

[DLH] Baader, F., et al. (eds.): The Description Logic Handbook, Cambridge, (2003).
[Horst] ter Horst, H. J.: Combining RDF and Part of OWL with Rules: Semantics, Decidability, Complexity. The Semantic Web - ISWC2005, pp.668-684, Springer (2005).
[Koide04] Koide, S., Kawamura, M.: SWCLOS: A semantic web processor on common lisp object system. In: 3rd International Semantic Web Conference (ISWC2004), Demos. (2004), http://iswc2004.semanticweb.org/demos/32/.
[Koide05] Koide, S., Aasman, J., Haflich, S.: OWL vs. object oriented programming. In: Workshop on SemanticWeb Enabled Software Engineering (SWESE) at the 4th International Semantic Web Conference (ISWC 2005), Galway, Ireland (November 2005), http://www.mel.nist.gov/msid/conferences/SWESE/propository/8owl-vs-OOP.rdf.
[Koide06] Koide, S., Takeda, H.: OWL-Full reasoning from an object oriented perspective. In: Asian Semantic Web Conf., ASWC2006, Springer (2006) 263?277, http://wwwkasm.nii.ac.jp/papers/takeda/06/koide06aswc.pdf.
[Koide09] Koide, S., Takeda, H.: Meta-circularity and mop in common lisp for OWL Full. In: ELW f09: Proceedings of the 6th European Lisp Workshop, New York, NY, USA, ACM (2009) 28?34.
Author:
Seiji Koide. Copyright (c) 2005, 2006 GALAXY EXPRESS CORPORATION. Feb. 2006
Copyright (c) 2007-2010 Seiji Koide. Oct.2010