SWCLOS: A Semantic Web Reasoner on CLOS

OWL Subsystem



File OWL\owlerror.cl

OWL Error Module

IT Program Project in Japan:

This code is written by Seiji Koide at Galaxy Express Corporation, Japan, for the realization of the MEXT IT Program in Japan.

Copyright (c) 2003, 2004, 2006 by Galaxy Express Corporation
Copyright (c) 2007, 2008, 2009, 2010 Seiji Koide

owl-unsatiafiable [condition]

Top error for unsatisfiability in OWL universe

owl-unsatiafiable-warning [condition]

Top warning for unsatisfiability in OWL universe

oneof-condition-unsatiafiable [condition]

unsatisfiable in oneOf

oneof-condition-unsatiafiable-warning [condition]

unsatisfiable warning in oneOf

equivalentclass-condition-unsatiafiable [condition]

unsatisfiable in equivalentClasses

equivalentclass-condition-unsatiafiable-warning [condition]

unsatisfiable warning in equivalentClasses

disjointwith-condition-unsatiafiable [condition]

unsatisfiable in disjointWith

disjointwith-condition-unsatiafiable-warning [condition]

unsatisfiable warning in disjointWith

complementof-condition-unsatiafiable [condition]

unsatisfiable in complementOf

complementof-condition-unsatiafiable-warning [condition]

unsatisfiable warning in complementOf

sameas-condition-unsatiafiable [condition]

unsatisfiable in sameAs

sameas-condition-unsatiafiable-warning [condition]

unsatisfiable warning in sameAs

differentfrom-condition-unsatiafiable [condition]

unsatisfiable in differentFrom

differentfrom-condition-unsatiafiable-warning [condition]

unsatisfiable warning in differentFrom

cardinality-constraint-condition-unsatiafiable [condition]

unsatisfiable in cardinality

cardinality-constraint-condition-unsatiafiable-warning [condition]

unsatisfiable warning in cardinality

forall-condition-unsatisfiable [condition]

forall-condition-unsatisfiable-warning [condition]

exists-condition-unsatisfiable [condition]

exists-condition-unsatisfiable-warning [condition]

hasvalue-condition-unsatisfiable [condition]

hasvalue-condition-unsatisfiable-warning [condition]

Seiji Koide Nov-15-2010


File OWL\owlkernel.cl

OWL Kernel Module

IT Program Project in Japan:

This code is written by Seiji Koide at Galaxy Express Corporation, Japan, for the realization of the MEXT IT Program in Japan.

Copyright (c) 2003, 2004, 2006 by Galaxy Express Corporation
Copyright (c) 2007, 2008, 2009, 2010 Seiji Koide


Loading this file onto RDF modules creats the OWL universe as part of the RDF universe.



                                           ............................
                                           :        :                 :
 rdf-node --------------------rdfs:Class --:-----owl:Class --- owl:Restriction
     :                     /      : :......:     /
     :               ...../.......:             /
     :               :   /        :            /
     :               :  /  +------:-- owl:Thing
     :               : /  /       :
  gnode --- rdfs:Resource --- rdf:Property

  <--, /     super/sub class relation, the direction of super is right to left.
  ..., :     class/instance relation, the direction of class is upward and left to right.


Compatibility between RDF and OWL Universes in SWCLOS

W3C specifies two styles on the compatibility between RDF universe and OWL universe. One is called OWL Full style in which rdf:Class is identical to owl:Class, rdfs:Resource is identical to owl:Thing, and rdf:Property is identical to owl:ObjectProperty. Another is called DL style and in which the semantics does not follow RDF semantics. The class extensions between owl:Thing, owl:Class, and owl:ObjectProperty are mutually disjoint. See, http://www.w3.org/TR/owl-semantics/rdfs.html.

In SWCLOS implementation, owl:Thing is a subclass of rdfs:Resource, owl:Class is a subclass of rdfs:Class, and owl:ObjectProperty is a subclass of rdf:Property. Thus, OWL universe is included in RDF universe, and the semantics of RDF is realized in OWL unvierse due to the CLOS Object-Oriented ususal manner.

OWL Full Semantics (classes are also instances).

In OWL Full, every class can be an instance of metaclass(es). This is naturally realized in SWCLOS with owl:Class subclassing to rdfs:Class (eventually to cl:standard-class). In addition, we set owl:Class as subclass of owl:Thing (eventually to rdfs:Resource). Thus, classes in OWL (the extension of owl:Class) inherit the slots of rdf:Resource, rdfs:label, rdfs:comment, rdf:type, etc. from rdfs:Resource.

OWL Property Slot Definition

*default-slot-definition-class* [variable]

Every slot of which name corresponds to RDF property is defined as an instance of Property-direct-slot-definition. This variable is set to symbol gx::Property-direct-slot-definition in RDFS module and set to OwlProperty-direct-slot-definition in OWL module.

owl:Class and owl:Thing with Houskeeping Slots

Note that the following programming style is useful to use SWCLOS as APIs for applications that extend semantics of RDF(S) or OWL.

Before loading RDF(S) or OWL knowledge into SWCLOS, you can define the housekeeping or application specific methods at CLOS objects and classes in the ontology of application, then load the ontology in RDF(S) or OWL.

Adding function of SWCLOS in RDF semantics adds new definition without any collisions onto CLOS slot definitions and methods. As a result, you can obtain ontological knowledge and application methods around ontologies.

In case of no extension of OWL semantics, you can define application methods after loading OWL ontologies.

We add two new slots into resource objects, funprop-inverse that is the inverse pointer of a property of owl:FunctionProperty and inverse-funprop-inverse that is the inverse pointer of a property of owl:InverseFunctionProperty.

Class [class]

The meta class in OWL universe. This class is a subclass and instance of rdfs:Class.

Thing [class]

The top class in OWL universe. This class is a subclass of rdfs:Resource and instance of owl:Class.

%equivalent-classes-of c [function]

returns nil if no definition on owl:equivalentClass.

equivalent-classes-of c [function]

returns a list of equivalences to c. Note that this function returns one element list of c, when no equivalences defined.

owl-class-p obj [function]

Is this obj an instance of owl:Class? Note that owl:Class and owl:Restriction is not owl class.

%owl-class-subtype-p class [function]

If you are sure that class is a metaobject of CLOS, use this instead of (cl:subtypep class owl:Class).

owl-class? symbol [function]

Is this bound value to symbol is owl class?

%same-as-of x [function]

returns nil if no definition on owl:sameAs.

same-as-of x [function]

returns a list of sames as x. Note that this function returns one element list of x, when no same individuals defined.

Nothing [variable]

owl-thing-p obj [function]

Is this obj an instance of owl:Thing? Note that owl:Class and owl:Thing is not owl thing.

%owl-thing-subclass-p class [function]

If you are sure that class is a metaobject of CLOS, use this instead of (cl:subtypep class owl:Thing).

Note the domain & range of owl:equivalentProperty is rdf:Property rather than owl:ObjectProperty.

Object Property for owl:inverseOf Book-keeping

ObjectProperty [class]

This class defines an inverse slot of the inverse-of property.

equivalent-property-of c [function]

change-class (instance Property) (new-class Class) &rest initargs [method]

In case that new-class is owl:ObjectProperty, the domain of instance is retrieved and slot definitions named its domain for instance is changed to an instance of OwlProperty-direct-slot-definition.

Restriction Subclasses

Restriction [class]

owl:Restriction is a metaclass a subclass of owl:Class in OWL.

default-direct-superclasses (class Restriction) [method]

The default direct superclass of restrictions is rdfs:Resource.

allValuesFromRestriction [class]

A class for value restrictions is a subclass of owl:Restriction.

print-object (obj allValuesFromRestriction) stream [method]

name (object allValuesFromRestriction) [method]

someValuesFromRestriction [class]

print-object (obj someValuesFromRestriction) stream [method]

name (object someValuesFromRestriction) [method]

hasValueRestriction [class]

print-object (obj hasValueRestriction) stream [method]

name (object hasValueRestriction) [method]

cardinalityRestriction [class]

print-object (obj cardinalityRestriction) stream [method]

owl-cardinality-p x [function]

OneOf class

Note that oneOf elements may be in the RDF universe. Note that the domain of owl:oneOf is rdfs:Class. Namely, The owl:oneOf slot definition is attached to rdfs:Class.

print-object (obj Class) stream [method]

owl-oneof-p x [function]

Is this x an object that holds owl:oneOf data?

How to Calculate a Type Value in Effective Slot Definition in OWL

After the calculation of initargs as standard slot definition and rdf property slot definition, the type option is recalculated, if OWL module is loaded. Because, it may include existential restriction for slot value, and it must be treated in OWL semantics.

The form of type option is one of the followings.


 <fval> ::= t | <class-meta-object> | (and <fval> ...) |
            (forall <slot-name> <fval>) | (exists <slot-name> <fval>) |
            (fills <slot-name> <fval>)
            (<= <slot-name> <fval>)  | (>= <slot-name> <fval>)  |
            (= <slot-name> <fval>)

Here, class-meta-object is a class object which comes from direct slot definition in RDF, (and fval ...) is computed by excl::compute-effective-slot-definition-initargs method at standard slot definition, (forall slot-name fval) originates from owl:allValuesFrom constraint and (exists slot-name fval) originates from owl:someValuesFrom constraint. (fills slot-name fval) represents owl:hasValueRestriction.

On the other hand, (<= slot-name fval) is from owl:minCardinality, (>= slot-name fval) is from owl:maxCardinality, and (= slot-name fval) is from owl:cardinality.

To compute the most specific concepts which include the above special fval forms, most-specific-concepts-for-slotd-type, strict-supertype-p-for-slotd-type and strict-subtype-p-for-slotd-type are defined, which specifically process these fval with subsumed-p and owl-equivalent-p.

compute-effective-slot-definition-initargs (class Class) direct-slotds [method]

%compute-effective-slot-definition-initargs class class-name slot-name direct-slotds initargs [function]

If initargs in making an effective-slot-definition includes :maxcardinality or :mincardinality keyword, the slot-definition must be OwlProperty-direct-slot-definition.

effective-slot-definition-class (class Class) &rest initargs [method]

This method calls next method if there is no :maxcardinality keyword in initargs.

type-option-check-with-cardinality instance filler slotd oldval [function]

satisfy-filler x R y type maxc minc oldval slotd [function]

Default Super Class in OWL

If v is typed to owl:Class, then v is subtyped to owl:Thing.

In order to set up the anonymous class for (owl:Class (owl:complementOf owl:Nothing)) of owl:Thing (owl:Class owl:Thing (rdfs:label "Thing") (owl:unionOf owl:Nothing (owl:Class (owl:complementOf owl:Nothing)))) this rule must be defined before reading the OWL file.

default-direct-superclasses (class Class) [method]

make-instance (class (eql Class)) &rest initargs [method]

change-class (from Class) (to Thing) &rest initargs [method]

This is happen when from is class in RDF and it is changed into OWL.


Here OWL rdf file is read.


Note that (rdfs:Class owl:FunctionalProperty (rdfs:subClassOf rdf:Property)) (rdfs:Class owl:InverseFunctionalProperty (rdfs:subClassOf owl:ObjectProperty))

Then, we add owl:Functional&InverseFunctionalProperty

We add some new axioms for OWL.

For OWL Full, an owl class also inherit owl:Thing

%addForm for OWL

Calling sequence: %addForm (type slots role) When type is an undefined symbol as resource,
  1. If type is a symbol rdf:Description and role is a symbol owl:intersectionOf, owl:unionOf, then owl:Class is used for type. See, rule2a and rule2b.
  2. If role is a symbol owl:distinctMembers or owl:oneOf, then owl:Thing is used for type. See. rule3.

get-range-constraint-from role [function]

This is same as one in RDFS module except owl:intersectionOf, owl:unionOf returns owl:Class, and owl:oneOf returns owl:Thing instead of rdf:List.

change-class (from class) (to class) &rest initargs [method]

change-class (class Class) (new-class (eql Class)) &rest initargs [method]

change-class (class Class) (new-class Class) &rest initargs [method]

Seiji Koide Nov-15-2010


File OWL\owlsamedifferent.cl

OWL Same/Different Module

IT Program Project in Japan:

This code is written by Seiji Koide at Galaxy Express Corporation, Japan, for the realization of the MEXT IT Program in Japan.

Copyright (c) 2003, 2004, 2006 by Galaxy Express Corporation
Copyright (c) 2007, 2008, 2009, 2010 Seiji Koide

Functional Property

owl:FunctionalProperty is an instance of rdfs:Class.


 (rdfs:Class owl:FunctionalProperty
             (rdfs:label "FunctionalProperty")
             (rdfs:subClassOf rdf:Property))

owl:FunctionalProperty does not belong to OWL universe, and an instance of owl:FunctionalProperty may not belong to OWL universe.

functional-property? name [function]

returns true if name is an owl functional property name

functional-property-p obj [function]

Is this obj an instance of owl:FunctionalProperty?

Inverse Functional Property

owl:InverseFunctionalProperty is an instance of rdfs:Class.

 (rdfs:Class owl:InverseFunctionalProperty
             (rdfs:label "InverseFunctionalProperty")
             (rdfs:subClassOf owl:ObjectProperty))

An instance of owl:InversefunctionalProperty may not be an instance of owl:ObjectProperty. Then, the range value may not be owl:Thing and may be rdfs:Literal.

inverse-functional-property-p obj [function]

Is this obj an instance of owl:InverseFunctionalProperty?

functional-property-equal-p x y &key test [function]

inverse-functional-property-equal-p x y &key test [function]

sameAs

shared-initialize-after-for-sameAs instance newsames [function]

definitely-%owl-same-p x y &optional pairs [function]

returns true if x and y is defined as the same in OWL semantics. x and y should be neither a symbol nor an iri.

definitely-owl-same-p x y &optional pairs [function]

returns true if x and y is defined as the same in OWL semantics. x and y may be a symbol or an iri.

%owl-same-p (x Resource) (y Resource) &optional pairs [method]

Non-resolution version. This is used in owl-equalp and owl-equivalent-p.

definitely-%%owl-different-p x y [function]

definitely-%disjoint-p c1 c2 [function]

owl-different-p

different-from-of y [function]

definitely-%owl-different-p x y [function]

%owl-different-p x y [function]

owl-different-p x y [function]

Is x different from y as individual in semantics of OWL?

definitely-owl-different-p x y [function]

returns true if x and y are definitely different and have no possibility of unification.

differentFrom

shared-initialize-after-for-differentFrom instance differents [function]

Seiji Koide Nov-15-2010


File OWL\owlequivalentdisjoint.cl

OWL Equivalent/Disjoint Module

IT Program Project in Japan:

This code is written by Seiji Koide at Galaxy Express Corporation, Japan, for the realization of the MEXT IT Program in Japan.

Copyright (c) 2003, 2004, 2006 by Galaxy Express Corporation
Copyright (c) 2007, 2008, 2009, 2010 Seiji Koide

Equivalency as Class

owl:equivalentOf, owl:intersectionOf, owl:unionOf, owl:complementOf, and owl:oneOf are complete relation. Therefore, at these relation the equivalency as class at righthand side implies the equivalency as class at lefthand side.

equivalentClass

shared-initialize-after-for-equivalentClass class equivalentclasses [function]

owl:equivalentClass is a subproperty of rdfs:subClassOf, so the objects are automatically captured as subclasses in nature. However, this characteristics is very tricky and bad for construction of stable ontology. Therefore, the class is not asserted as subclass.

%intersection-equivalent x y [function]

If both x and y have an intersection of concepts and two sets of intersection are equivalent as class, then x and y is equivalent as class. If either or neither has an instersection, then returns false.

%union-equivalent x y [function]

If both x and y have an union of concepts and two sets of union are equivalent as class, then x and y is equivalent as class.

%complemently-equal x y [function]

%oneof-equivalent x-ones y-ones [function]

If two OneOf sets are set-equal, then both are equal as class. sets are test by owl-same-p.

%owl-restriction-equal c1 c2 [function]

%owl-equivalent-p-without-type-equivalents x y [function]

owl-equivalent-p x y [function]

returns true if x and y are equivalent classes.

definitely-owl-equivalent-p x y [function]

returns true if x and y are equivalent classes.

%owl-equivalent-p x y [function]

checks owl:equivalentOf.

%owl-equivalent-p-without-equivalents x y [function]

This subsubfunction prevents recursive call for %owl-equivalent-p.

%owl-equivalent-p-without-complements x y [function]

returns true if x and y are equivalent classes or equal literals, symbols, and objects. At first, x and y should be a class.

Disjointness

When equivalent classes are given for arguments as disjoint classes, the unsatisfiable error happens. Note that two concepts in disjointness cannot make intersection, and multiple classing.

shared-initialize-after-for-disjointWith class disjoints [function]

Not only from the disjoint statement, but also owl:intersectionOf values and owl:oneOf values decide the disjointness. Namely, if two values for such complete relational properties are disjoint, then the arguments are disjoint.

%owl-disjoint-p c1 c2 [function]

special rules of disjointness in OWL. This function is used internally in routines of default reasoning for disjointness. Namely, it returns nil nil if the disjointness is explicitly not stated.

check-simple-disjoint-pair-p-in-supers name supers [function]

simply checks the satifiability among supers of class.

simple-disjoint-pair-p-in-supers c1 c2 [function]

This predicate cannot be applicable to slot type option.

check-simple-disjoint-pair-p-in-slot-types class types [function]

simply checks the satifiability among slot type option types of class.

simple-disjoint-p-in-slot-types c1 c2 [function]

This should be called in computation of slot type option inheritance. So, the role or owl:onProperty of c1 and c2 must be equal.

%intersection-disjoint-p xinter yinter [function]

returns true if xinter and yinter are disjoint. This function returns true if either of args has intersection, and returns unknown if neither of args has intersection.

%restriction-disjoint-p c1 c2 [function]

disjointness in OWL universe is ????

disjoint-p c d [function]

returns true if c and d are disjoint in OWL.

%disjoint-p c d [function]


File OWL\NNF.cl

NNF transformation module

This program is borrowed from AIMA 2008, 2009 (c) Seiji Koide

conjuncts sentence [function]

Return a list of the conjuncts in this sentence.

disjuncts sentence [function]

Return a list of the disjuncts in this sentence.

+logical-connectives+ [constant]

+logical-quantifiers+ [constant]

atomic-clause? sentence [function]

An atomic clause has no connectives or quantifiers.

literal-clause? sentence [function]

A literal is an atomic clause or a negated atomic clause.

negative-clause? sentence [function]

A negative clause has NOT as the operator.

merge-disjuncts disjuncts [function]

Return a CNF expression for the disjunction.

eliminate-implications p [function]

has-variable? p [function]

->cnf p &optional vars [function]

Convert a sentence p to conjunctive normal form [p 279-280].

->inf p [function]

Convert a sentence p to implicative normal form [p 282].

cnf1->inf1 p [function]

logic sentence [function]

Canonicalize a sentence into proper logical form.

*new-variable-counter* [variable]

variable? x [function]

Is x a variable (a symbol starting with ?)?

new-variable var [function]

Create a new variable. Assumes user never types variables of form $X.9

concat-symbol &rest args [function]

Concatenate the args into one string, and turn that into a symbol.

skolemize p vars outside-vars [function]

Within the proposition P, replace each of VARS with a skolem constant, or if OUTSIDE-VARS is non-null, a skolem function of them.

skolem-constant name [function]

Return a unique skolem constant, a symbol starting with '$'.

Followings are by Seiji

skolem-constant-p x [function]

skolem-p x [function]

unskolemize sk [function]


File OWL\tunify.cl

Unification with Type

This program is encoded by Seiji Koide based non-typed unifier of "Paradigms of AI Programming: Case Studies in Common Lisp", by Peter Norvig, published by Morgan Kaufmann, 1992.

This program is integrated to SWCLOS, an OWL processor on CLOS. 2008,2009 (c) Seiji Koide

+fail+ [constant]

Indicates unification failure

+no-bindings+ [constant]

Indicates unification success, with no variables.

get-binding var bindings [function]

Find a (variable . value) pair in a binding list.

binding-var binding [function]

Get the variable part of a single binding.

binding-val binding [function]

Get the value part of a single binding.

lookup var bindings [function]

Get the value part (for var) from a binding list.

extend-bindings var val bindings [function]

Add a (var . val) pair to the head of a binding list.

occurs-in? var x bindings [function]

Does var occur anywhere inside x?

subst-bindings bindings x [function]

Substitute the value of variables in bindings into x, taking recursively bound variables into account.
binding := '(' key '.' value ')' key := variable | constant | skolem function | individual value := variable | constant | skolem function | individual cbinding := '(' ckey '.' cvalue ')' key := variable | constant | skolem function | class value := variable | constant | skolem function | class kbinding := '(' kkey '.' kvalue ')' key := variable | constant | skolem function | metaclass value := variable | constant | skolem function | metaclass

This bindings simulate the environment for lisp symbol bindings. The virtual value of this bindings supersedes the actual symbol value.

symbol-value+ key bindings [function]

simulates 'symbol-value' in lisp with bindings.

name+ object bindings [function]

class-of+ x bindings cbindings [function]

simulates class-of but cbindings is prior to actual class.

A variable is a symbol whose name starts with character #\?. See also NNF for variable? and new-variable.

make-binding var val [function]

variables-in exp [function]

Return a list of all the variables in EXP.

unique-find-anywhere-if predicate tree &optional found-so-far [function]

Return a list of leaves of tree satisfying predicate, with duplicates removed.

find-anywhere-if predicate tree [function]

Does predicate apply to any atom in the tree?

rename-variables x [function]

Replace all variables in x with new ones.

Followings are simulate owl-same-p, different-p, owl-equivalent-p, subtypep, disjoint-p on bindings and cbindings. These functions are used in the typep unification program.

owl-same-p+ x y bindings [function]

can x and y be regarded as same with bindings?

different-p+ x y bindings [function]

can x and y be regarded as different with bindings?

owl-equivalent-p+ c d cbindings [function]

can c and d be regarded as equivalent class with cbindings?

subtypep+ c d cbindings [function]

is c a subtype of d with cbindings? Note that cl:subtypep is used.

disjoint-class-p+ c d cbindings [function]

The bindings in lisp provide the base level bindings in unification. The bindings in unification provides situated bindings that change in situation. The unify implementation in "Paradigms of AI Programming" is just same as the symbol bindings in old lisp system by association list. So, the mechanism of old lisp binding is utialized for situated binding and classing in unification.

Typed Unification

unify x y &optional bindings cbindings kbindings [function]

tunify c d &optional cbindings kbindings [function]

ttunify c d &optional kbindings [function]

unify-var var x bindings cbindings kbindings [function]

tunify-var var x cbindings kbindings [function]

ttunify-var var x kbindings [function]

unify-skolem x y bindings cbindings [function]

Both x and y are skolem function that originate existential quantification. In SWCLOS, it represents a successor in a binary relation of (role predecessor successor).

unify-xskolem x y bindings cbindings &optional kbindings [function]

Only x is a skolem function that originate existential quantification.

unify-yskolem x y bindings cbindings &optional kbindings [function]

Only y is a skolem function that originate existential quantification.

unify-object x y bindings cbindings [function]

unify-class c d cbindings [function]

unifier x y [function]

Return something that unifies with both x and y (or fail).

File OWL\subsume.cl

Subsume Module

This code is written by Seiji Koide.

Copyright (c) 2009 Seiji Koide

Subsumption

subsumed-p c d [function]

tests whether c is subsumed by d in OWL semantics.

subsumed-p-without-equivalency cc dd [function]

subsumtion test without class equivalency of cc and dd for CLOS objects.

unfold-intersection conj [function]

returns unfolded concepts of conj, if conj is an intersection in OWL, otherwise returns conj itself.

intersection-subsumed-p c dintersections [function]

%intersection-subsumed-p c dintersections [function]

%intersection-restriction-subsumed-p cslots dprops dcards dcnsts [function]

satisfy-max-cardinality dmax model [function]

Models

models := ( model* ) model := ( bindings cbindings . cmax cmin atoms ) atoms := ( atom* ) atom := ( role predecessor successor ) predecessor and successor is a var.


generate-models-for-susumee-from-slot var role cmax cmin slotd models [function]

var is a role-predecessor.

create-models-for-subsumer-from-restrictions var role max min conjuncts models [function]

creates a model from universal var and restriction conjuncts. Note that all properties in conjuncts are is role.

clash-p bindings cbindings conjuncts [function]

tests conjuncts clashing or not.

add-conjunct-existentially role predecessor successor exist model models [function]

adds a new atom of (role predecessor successor:exist) into model, and returns a satisfiable model. Note this function is applied for existential quantification of successor.

impose-conjunct-existentially role predecessor successor type model models [function]

imposes a new atom of (role predecessor successor:type) onto each atom in atoms and returns a satisfiable model for bindings, cbindings, and atoms. Note that the cardinality of atoms do not increased but bindings may be extended and cbindings are extended. If the conjunction is clashed, this function returns nil.

generate-subsumee-models var role cmax cmin types alls exists fillers models [function]

generates updated models for var and role onto models with constraint cmax, cmin, types, alls, exists, and fillers of role-successor.

reduce-models cmax models [function]

reduce-atoms cmax bindings cbindings atoms [function]

generate-subsumer-models var role cmax types alls exists fillers models [function]

generates updated models for var and role onto models with constraint max caridinality cmax, types, alls, exists, and fillers of successor of var for role. If var is nil, then new-var is created inside.

generate-models-for-existential var role exists models [function]

exists are a list of types for (role var y1:type1), (role var y2:type2) ...

%satisfy-model cmodel dmax dmin dmodel [function]

subsumed-p-successors y1 bindings1 cbindings1 y2 bindings2 cbindings2 [function]

subsumed-p-in-satisfy x y [function]

owl-same-p-in-satisfy x y [function]

typep-in-satisfy x y [function]

Transitive Property

transitive-property-p obj [function]

Is this obj an instance of owl:TransitiveProperty?

transitive-property-subsumed-p c d [function]

%owl-subtypep type1 type2 [function]

same prodedure as %rdf-subtypep but calls subsumed-p instead-of %rdf-subtypep or %owl-subtypep. Conjuction is specially treated as same way of subsumed-p.

File OWL\OWL.cl

OWL Module

IT Program Project in Japan:

This code is written by Seiji Koide at Galaxy Express Corporation, Japan, for the realization of the MEXT IT Program in Japan.

Copyright (c) 2003, 2004, 2006 by Galaxy Express Corporation
Copyright (c) 2007, 2008, 2009 Seiji Koide

owl-equalp checks the equality of objects in OWL, namely it returns t, if

  1. owl-equivalent-p holds, if args are property.
  2. if args are restrictions, then if both of owl:onProperty values are equal and values are equal as owl:allValuesFrom or owl:someValuesFrom or owl:hasValue, and either both or neither cardinality restriction are also equal.
  3. owl-same-p holds.
  4. otherwise equal in the sense of rdf-graph equality.

owl-equalp x y [function]

returns true if x and y is equal in semantics of RDF(S) superimposed by OWL. This predicate checks x and y in classes as individuals.

Subsumption

(subsumed-p vin:DryWhiteWine vin:WhiteNonSweetWine) -> t

(subsumed-p food:Fruit food:EdibleThing)

%union-subsumed-p c d [function]

%intersection1-subsumed-p var conjuncts d [function]

This function directly computes conjuncts instead of C's intersection. This is useful to compute conjunction (and) without creating an intersection class.

%intersection12-subsumed-p var conjuncts dintersections [function]

%oneof1-subsumed-p c d [function]

%oneof2-subsumed-p c d [function]

oneof-subsumed-p c d [function]

collect-most-specific-concepts class instance [function]

This function is used for shared-initialize.

get-intersect-siblings class intersections [function]

returns a set of subclasses of all member of intersections, removing duplicates and ones that has same intersection as class.

get-union-spouses class unions [function]

returns a set of superclases of all member of unions, removing duplicates and ones that has same union as class.

get-superclasses-siblings class superclasses [function]

get-subclasses-siblings class subclasses [function]

subtypep-for-refining c1 c2 [function]

%intersection-refining-p c1 c2 [function]

%union-refining-p c1 c2 [function]

%oneof-refining-p c1 c2 [function]

%complement-refining-p c1 c2 [function]

owl:complementOf

shared-initialize-after-for-complementOf class complements [function]

intersectionOf

shared-initialize-after-for-intersectionOf class intersections [function]

intersection-p class [function]

intersection-of class [function]

check-intersection-refining-for-subclasses class superclasses [function]

refine-concept-by-intersection classes [function]

returns most specific concepts that include subs of classes as intersection's sub. Note that return values include initial values and newly added values.

unionOf Shared Initialize After Action

After defining a class with owl:unionOf slot,
  1. If the defined class class is a subclass of a superclass sib of a union member, class is inserted between the superclass sib and the union member.
  2. If the defined class class is not a subclass of a superclass sib of a union member, class is a sibling of sib.

shared-initialize-after-for-unionOf class unions [function]

check-union-refining-for-subclasses class subclasses [function]

change-class (instance Thing) (new-class (eql Class)) &rest initargs [method]

change-class (instance Thing) (new-class Class) &rest initargs [method]

Shared-initialize Before for owl:Class

shared-initialize (class Class) slot-names &rest initargs &key (name nil) [method]

Shared-initialize After for owl:Class

update-instance-for-different-class is called in change-class. Usually change-class is invoked by ensure-class without initargs. So, direct-superclasses is set by reinitialize-instance in ensure-class after change-class. The following routine is prepared only for direct invocation of change-class by users.

update-instance-for-different-class (previous Class) (current Class) &rest initargs [method]

ensures owl:Thing as superclasses in OWL universe. This routine is effective only if a user designates :direct-superclasses but no inheritance of owl:Thing.

shared-initialize (class Class) slot-names &rest initargs [method]

Symmetric Property

symmetric-property-p obj [function]

Is this obj an instance of owl:SymmetricProperty?

shared-initialize-before-in-OWL instance slot-names initargs [function]

shared-initialize (instance Resource) slot-names &rest initargs [method]

book-keeping for reification

Shared-initialize After for owl:Thing

shared-initialize (instance Thing) slot-names &rest initargs [method]

Warning: Entailed in refining: #vin:WhiteWine vin:StGenevieveTexasWhite to vin:WhiteNonSweetWine. owl:equivalentClass is a subproperty of rdfs:subClassOf, so the objects are automatically captured as subclasses in nature. However, this characteristics is very tricky and bad for construction of stable ontology. Because rdfs:subClassOf is substantial relation, but equivalentClass is temporal one. We treat equivalentClass in inference instead of subproperty of rdfs:subClassOf or superclass-subclass relation.

make-this-supers (class Class) superclasses [method]

returns an append list of MSCs of restrictions and MSCs of non restrictions in old-users and new-supers.

most-specific-concepts-for-restrictions classes [function]

Transitivity

transitive-p obj [function]

transitive-subp property sub super &optional visited [function]

strict-transitive-subp property sub super visited [function]

strict-transitive-superp property super sub [function]

strict-include-p property super sub [function]

most-specific-transitives property transitives [function]

Here after Bookkeeping Facilities

owl:AllDifferent

shared-initialize (instance AllDifferent) slot-names &rest initargs [method]

no-twin-p class instance [function]

%symbols2values lst [function]

owl:Restriction again

owl-restriction-p obj [function]

Is this obj an instance of owl:Restriction?

restriction-subtypep restriction1 restriction2 [function]

owl:intersectionOf is translated to super/subtype relation.

collect-all-subsumed-types (class Class) [method]

collect-all-instances-of (class Class) [method]

all-instances-generator (class Class) [method]

owl-complement-p c d [function]

%owl-complement-p cc dd [function]

ensure-class-using-class (class Class) name &rest args [method]

hasValue Restriction sets up an initial value of the slot.

shared-initialize (class hasValueRestriction) slot-names &rest initargs [method]

shared-initialize (class someValuesFromRestriction) slot-names &rest initargs [method]

shared-initialize (class allValuesFromRestriction) slot-names &rest initargs [method]

shared-initialize (class cardinalityRestriction) slot-names &rest initargs [method]

For owl:equivalentProperty

equivalentProperty-maintain instance slot-names &rest initargs [function]

equivalent-property-p x y [function]

Are x and y equivalent property in semantics of OWL?

most-specific-properties properties [function]

owl:inverseOf

%get-inverse-prop prop [function]

Property in OWL

shared-initialize (instance ObjectProperty) slot-names &rest initargs [method]

shared-initialize (instance SymmetricProperty) slot-names &rest initargs [method]

domain-value (property Property) [method]

domain-value (property ObjectProperty) [method]

range-value (property Property) [method]

range-value (property ObjectProperty) [method]

We construct every inference upon subsumption-basis. Subsumption is infered by structural subsumption algorithms, here.

union-of class [function]

complement-of class [function]

onproperty-of restriction [function]

Membership in OWL

The following is taken from http://www.w3.org/TR/owl-ref/#equivalentProperty-def.

"Property equivalence is not the same as property equality. Equivalent properties have the same "values" (i.e., the same property extension), but may have different intensional meaning (i.e., denote different concepts). Property equality should be expressed with the owl:sameAs construct. As this requires that properties are treated as individuals, such axioms are only allowed in OWL Full."

Since we consider the domain and range constraint and OWL onPorperty restrictions are intensional data of properties. we do not treat here the equivalent property. We do not implement sameAs functions for properties.

%%typep object type [function]

object and type is an object in RDF universe.

%typep-without-type-equivalents object type [function]

This is sub-subfunction for typep. This is only invoked in %%typep. This function tests type relation for each member of owl:sameAs group.

typep-without-sames-and-equivalents-in-owl object type [function]

object and type are in RDF universe and no direct class-instance relations. type may be a complex concept.

owl-intersection-type-p object intersections [function]

when every element in intersections satisfies a type of object then true. If any element does not satisfy obviously, then imediately returns with false. Otherwise, finally the result for all of intersections is true or unknown.

owl-union-type-p object unions [function]

owl-complement-type-p object complement [function]

slot-value

Cardinality check

cardinality-ok-p value (slotd OwlProperty-effective-slot-definition) [method]

simply checks value with cardinality constraint without models and returns true if no problems. It is expected that elements in value will be unified if false is returned.

SWCLOS Home Authors Lisp Code Overview