12.  OWL in SWCLOS

The OWL Web Ontology Languages, which are the extension of RDF and RDFS, are the W3C Recommendation for Web Ontology description. There are three sub-languages of OWL, that is, OWL Light, OWL DL, and OWL Full. The OWL Light specification is prepared for an easy realization by implementers. However, the capability of ontology description is lower than other OWL languages. The capability of ontology description of OWL DL is underpinned by Description Logic (DL). The satisfiability checking and the entailment rules by DL is very powerful and useful to describe a consistent ontology, but the inference on datatype is out of scope of DL, and ones cannot treat classes as an instance of some class in the same way of RDFS. OWL Full provides full power for ontology description, where the class is not discriminated to the instance, and ones can treat classes as instance in the same way as RDFS. In the framework of logics, it is difficult to implement the OWL Full metamodeling capability, because it requires second order logic or higher.

SWCLOS is a language for Object-Oriented Programming (OOP) that is built on top of CLOS. CLOS allows ones metamodeling, namely, programmers can treat classes as instance of some class. Thus, if you are familiar with meta-programming of CLOS, you can encode metamodeling of ontology in SWCLOS. With SWCLOS you will obtain the performance of OWL Full.

12.1  OWL Extension of RDF and RDFS

In theory, OWL is an extension of RDF and RDFS. Therefore, any OWL file, including the OWL specification file that is described in RDF/XML, must be readable as RDF rather than OWL. In practice, we can obtain, with the OWL specification file owl.rdf from W3C, OWL entities as RDF resource objects in the RDF universe. See the following demonstration, in which only RDFS module of SWCLOS has been loaded initially.

cg-user(1): (in-package gx-user)
#<The gx-user package>
gx-user(2): (read-rdf-file #'addRdfXml "OWL/OWL.RDF")
Warning: Entail by rdf1: owl:imports rdf:type rdf:Property.
Warning: Entail by rdf1: owl:versionInfo rdf:type rdf:Property.
Warning: Entail by rdf1: owl:priorVersion rdf:type rdf:Property.
Warning: Implicit range entailment: owl:Ontology rdf:type rdfs:Class.
Warning: Entail by rdf1: owl:unionOf rdf:type rdf:Property.
Warning: Entail by rdf1: owl:complementOf rdf:type rdf:Property.
:done
gx-user(3): (pprint (get-form owl:Thing))
(owl:Class owl:Thing (rdfs:label "Thing")
           (owl:unionOf owl:Nothing
                        (owl:Class (owl:complementOf owl:Nothing))))
gx-user(4): (pprint (get-form owl:Nothing))
(owl:Class owl:Nothing (rdf:about #<uri http://www.w3.org/2002/07/owl#Nothing>)
           (rdfs:label "Nothing")
           (owl:complementOf owl:Thing))
gx-user(5): (typep owl:Class rdfs:Class)
t
t
gx-user(6): (subtypep owl:Class rdfs:Class)
t
t
gx-user(7): (subtypep owl:Class rdfs:Resource)
t
t
gx-user(8): (subtypep owl:Thing rdfs:Resource)
t
t
gx-user(9): (subtypep owl:Class owl:Thing) ; note that this is incorrect.
nil
t

In this demonstration, after boot up SWCLOS without OWL modules, invoking read-rdf-file caused to load owl.rdf file. Some results by reading owl.rdf were demonstrated with get-form on owl:Thing and owl:Nothing.

However, this ontology does not result any capability upon OWL entailments and includes some ambiguities of inclusiveness between the RDF universe and the OWL universe. An OWL reasoner must be equipped with OWL semantics so as to realize many OWL entailments as well as clear-cut relation between the RDF universe and the OWL universe. OWL module of SWCLOS provides OWL functionalities with the owl.rdf file. After this section, OWL realization on SWCLOS is explained.

12.2  Description Logic and OWL in SWCLOS

The syntax and semantics of Description Logic (DL) is compactly described at Appendix of The Description Logic Handbook from Cambridge Press. In this section, OWL DL semantics is explained partly using DL terminologies and partly using OWL terminologies. Note that the following remarks.

Terminologies in DL Description in S-expression of SWCLOS
concept class
role property
top concept owl:Thing
bottom concept owl:Nothing
concept inclusion (owl:Class C (rdfs:subClassOf D))
concept equality (owl:Class C (owl:equivalentClass D))
role inclusion (rdf:Property R (rdfs:subPropertyOf S))
role equality (rdf:Property R (owl:equivalentProperty S))
intersection of concepts (owl:intersectionOf C1 ... Cn)
union of concepts (owl:unionOf C1 ... Cn)
negation of concepts (owl:complementOf C)
value restriction (owl:Restriction (owl:onPropertyOf R) (owl:allValuesFrom C))
limited existential quantification (owl:Restriction (owl:onPropertyOf R) (owl:someValuesFrom owl:Thing))
full existential quantification (owl:Restriction (owl:onPropertyOf R) (owl:someValuesFrom C))
at-least number restriction (owl:Restriction (owl:onPropertyOf R) (owl:minCardinality n))
at-most number restriction (owl:Restriction (owl:onPropertyOf R) (owl:maxCardinality n))
exact number restriction (owl:Restriction (owl:onPropertyOf R) (owl:cardinality n))
same-as agreement (owl:Thing u1 (owl:sameAs u2))
one-of (owl:Thing (owl:oneOf I1 ... In))

To define a concept in OWL, defConcept is used instead of defResource in RDFS. However, both macros generate completely same forms. The purpose of ‘defConcept’ macro is just syntax sugar for OWL. See the following example after loading OWL module, where the concept Woman and Man are defined. In addition, an anonymous class that stands for the concept of negation of Woman, is defined. Since the negation of Woman represents a set of all individuals of Man, the concept Man is defined as the intersection of Person and the negation of Woman. The following demonstration also shows the entailment of intersection of concepts.

gx-user(7): (defConcept Woman (owl:intersectionOf Person Female))
Warning: Range entailX3 by owl:intersectionOf: Person rdf:type owl:Class.
Warning: Range entailX3 by owl:intersectionOf: Female rdf:type owl:Class.
#<owl:Class Woman>
gx-user(8): (defConcept Man
                        (owl:intersectionOf
                          Person
                          (owl:Class (owl:complementOf Woman))))
#<owl:Class Man>
gx-user(9): (defIndividual John_Doe (rdf:type Man))
#<Man John_Doe>
gx-user(10): (defIndividual Jane_Doe (rdf:type Woman))
#<Woman Jane_Doe>
gx-user(11): (typep John_Doe Female)
nil
t
gx-user(12): (typep Jane_Doe Female)
t
t

The concept that is not defined but referred is called atomic concept, e.g., Person and Female in the above demonstration, while a complex concept is defined using other concepts (complex or atomic), e.g., Woman and Man. The atomic concept in SWCLOS exists as object but does not have slot values except rdfs:subClassOf and owl:equivalentClass.

12.3  OWL Property Restrictions

A complex concept is often composed of concepts and restrictions. A restriction, which is an instance of owl:Restriction, works as constraint for a specific property and a specific concept. A property restriction is anonymous and has only two slots of owl:onPropertyOf and restriction types, i.e., owl:allValuesFrom, owl:someValuesFrom, owl:hasValue, owl:maxCardinality, owl:minCardinality, and owl:cardinality.

In the following example, the concept Mother is defined as the intersection of Woman and the restriction such that the property hasChild must exist in Woman individuals and one value of the property hasChild must be an instance of Person at least.

gx-user(13): (defConcept Mother
                         (owl:intersectionOf
                           Woman
                           (owl:Restriction (owl:onProperty hasChild)
(owl:someValuesFrom Person))))
Warning: Range entailX3 by owl:onProperty: hasChild rdf:type rdf:Property.
#<owl:Class Mother>
gx-user(14): (defConcept Father
                         (owl:intersectionOf
                           Man
                           (owl:Restriction (owl:onProperty hasChild)
                                            (owl:someValuesFrom Person))))
#<owl:Class Father>

The property restriction in the intersection is useful to make a sub concept that is specialized by the property restriction. In the above case, the concept Mother is defined as Woman who has the slot hasChild, in which one slot value at least must be an instance of a Person. Exactly speaking on the above demonstration, it is possible to have something but Person in the hasChild slot in the above definition. Note that it is needed to add the value restriction (owl:allValuesFrom) on hasChild for Person, if you want to restrict that all of children must be a Person, exactly in OWL semantics.

Note that owl:Restriction in OWL is specialized to subclass restrictions in SWCLOS, i.e., owl:hasValueRestriction, owl:someValuesFromRestriction, owl:allValuesFromRestriction, or owl:cardinalityRestriction. The reason is mainly for human readability of an anonymous object of owl:Restriction. Using this subclassing of owl:Restriction, SWCLOS provides the customization of printing restrictions. See the followings.

gx-user(15): (-> Father owl:intersectionOf)
(#<owl:Class Man> #<hasChild.Person>)

In CLOS, we have the type option in the slot definition. Therefore, we have implemented the allValuesFrom functionality and the someValuesFrom functionality through this type option in the slot definition as well as the range value constraint in RDFS. Furthermore, in order to implement the cardinality constraint, we set two new slot option, maxcardinality and mincardinality in the slot definition as OwlProperty-slot-definition.

12.4  Substantial and non-Substantial Relationship

Whereas the subsumption relationship is decided with only rdfs:subClassOf in RDFS, the subsumption decidability is very complicated in OWL. There are many properties that rule subsumption, such as rdfs:subClassOf, owl:intersectionOf, owl:unionOf, owl:equivalentClass, owl:equivalentProperty on rdf:type, rdfs:subPropertyOf on rdf:type, etc. From the viewpoint of DL, they have same strength for subsumption decidability. However, from the viewpoint of Ontology Engineering, generally we have to discriminate substantial ones and non-substantial ones for subsumption. For instance, the wife and husband relation is weaker than man-person or woman-person relation. The former is not substantial but the latter is substantial.

On the other hand, from the viewpoint of CLOS, rdfs:subClassOf relation is mapped onto class-subclass relation, and a CLOS object as rdfs:subClassOf property value is also placed in the direct-superclasses list slot in the class metaobject. Then, in case that a property prop1 is a subproperty of rdfs:subClassOf, or a equivalent property of rdfs:subClassOf, whether or not should we place the property value into the direct-superclasses list in the class to which the property prop1 is attached? In other words, what property should cause the structural variation in CLOS superclass-subclass relation, and what property should not cause the structural variation? For instance, food:Wine is equivalent to vin:Wine, and food:Wine in Food Ontology does not have any slots, and vin:Wine in Wine Ontology has many slots. If we add vin:Wine into the direct-superclasses list of food:Wine, then food:Wine inherits all slot definitions in the superclasses of vin:Wine. So, should we put the same slots as vin:Wine to food:Wine or not? In SWCLOS, we specified that rdfs:subClassOf, owl:intersectionOf, and owl:unionOf should cause the structural variation of CLOS, but other properties such as owl:equivalentClass, owl:equivalentProperty, including subproperties and equivalent properties of rdfs:subClass, owl:intersectionOf, and owl:unionOf, should not cause the structural variation. The predicate gx:subtypep supports the subsumption by class-subclass relation in RDFS semantics, and subsumed-p reasons the subsumption using other subsumption-related properties in OWL.

From the standpoint of ontology engineering, the effects of substantial properties may propagate to other entities, but the result of non-substantial properties should not cause any side effects in ontology. Thus, such discrimination rule of substantial and non-substantial subsumption allows ones to add and delete the relation of rdfs:subPropertyOf, owl:equivalentClass, etc., and keeps easy to maintain ontologies.

12.5  Axiomatic Complete Relations

Among many properties in OWL, only four properties, i.e., owl:intersectionOf, owl:unionOf, owl:complementOf, and owl:oneOf make axiomatic complete relations as if and only if condition. In other words, these properties define complete equivalency upon the binary relation of concepts. For example, the following states the definition of WhiteBordeaux, and if something is a Bordeaux and WhiteWine, it should be concluded to be a WhiteBordeaux.

gx-user(2): (defpackage vin)
#<The vin package>
gx-user(3): (defConcept vin::WhiteBordeaux
              (rdf:type owl:Class)
              (owl:intersectionOf vin::Bordeaux vin::WhiteWine))
Warning: Range entailX3 by owl:intersectionOf: vin::Bordeaux rdf:type owl:Class.
Warning: Range entailX3 by owl:intersectionOf: vin::WhiteWine rdf:type owl:Class.
#<owl:Class vin:WhiteBordeaux>
gx-user(4): (defIndividual aWine (rdf:type vin:Bordeaux vin:WhiteWine))
Warning: Multiple classing with
         (#<owl:Class vin:Bordeaux> #<owl:Class vin:WhiteWine>)
         for #<vin:Bordeaux aWine>
#<vin:WhiteBordeaux aWine>

Similarly, the following assertion defines WineColor, which has the enumerative membership of White, Rose, and Red of complete relation, so that it states that the instance of WineColor is exactly one of the three, and not to be the others.

gx-user(5): (defConcept vin::WineColor (rdf:type owl:Class)
                        (owl:oneOf vin::White vin::Rose vin::Red))
#<owl:Class vin:WineColor>
gx-user(6): vin:White
#<vin:WineColor vin:White>

Therefore, it is not necessary to mind Open World Assumption upon such axiomatic complete relation properties. If we find the contents of the definition body matches the database, then we may conclude the definition is applicable to the database without a worry about other statements.

See the following example. SWCLOS concludes that QueenElizabethII should be a woman, because there is a terminology that a person who has gender female is a woman, and it is asserted that QueenElizabethII is an instance of Person and hasGender Female. Here, note that SWCLOS proactively made the entailment without demand or query from users.

gx-user(2): (defConcept Person (rdf:type owl:Class)
                        (owl:intersectionOf
                          Human
                          (owl:Restriction (owl:onProperty hasGender)
                          (owl:cardinality 1))))
Warning: Range entailX3 by owl:intersectionOf: Human rdf:type owl:Class.
Warning: Range entailX3 by owl:onProperty: hasGender rdf:type rdf:Property.
#<owl:Class Person>
gx-user(3): (defConcept Woman (rdf:type owl:Class)
                        (owl:intersectionOf
                          Person
                          (owl:Restriction (owl:onProperty hasGender)
                          (owl:hasValue Female))))
#<owl:Class Woman>
gx-user(4): (defIndividual QueenElizabethII (rdf:type Person)
                           (hasGender Female))
Warning: Entailed in refining: #<Person QueenElizabethII> to Woman.
#<Woman QueenElizabethII>


Author:
Seiji Koide. Copyright (c) 2005, 2006 GALAXY EXPRESS CORPORATION. Feb. 2006
Copyright (c) 2007-2010 Seiji Koide. Oct.2010