Kris-Manual

Bernhard Hollunder, Armin Laux, Hans-Jürgen Profitlich, Thomas Trenz

German Research Center for Artificial Intelligence (DFKI) Stuhlsatzenhausweg 3, D-66123 Saarbrücken, Germany e-mail: ⟨last name⟩@dfki.uni-sb.de

Draft version, please do not distribute!

Contents

1 About the kris System 5

2 Concept Descriptions 6

3 Sample Session 7

4 Knowledge Base Management 10

4.1 TBox structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 *current-tkb* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 *all-tkbs* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 load-tkb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 save-tkb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 make-tkb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 init-tkb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 expand-tkb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.2 ABox structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 *current-akb* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 *all-akbs* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 load-akb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 save-akb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 make-akb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 init-akb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 expand-akb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5 TBox Definitions and ABox Assertions 16

5.1 TBox Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 def{prim}concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 def{prim}concept-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 disjoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 disjoint-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 defset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 defset-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 defprimrole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 defprimrole-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 defprimattribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 defprimattribute-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

5.2 ABox Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 defindividual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 defindividual-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 assertion-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

6 TBox Inferences 20 classify-tkb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 direct-supers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 all-supers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 direct-subs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 all-subs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 equivalences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 satisfiable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 subsumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 equivalent-concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 disjoint-concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 classify-concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 add-concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 add-concept-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 delete-concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 7 ABox Inferences 26

consistent-akb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

realize-akb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

realize-individual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

retrieve-instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

is-instance-of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

most-specific-concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

individual-concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

add-assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

add-assertion-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

add-triple-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

delete-assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

8 TBox Information Retrieval 30

get-concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

get-role . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

@ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

classified-tkb? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

get-all-concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

get-all-roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

what-Is? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

is-enum-elem? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

is-enum-type? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

is-primitive? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

is-concept? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

is-role? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

is-feature? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

system-defined? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

user-defined? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

9 ABox Information Retrieval 35

get-individual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

checked-on-consistency? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

realized-akb? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 get-all-individuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

get-object-description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

get-role-successors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

get-role-predecessors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

get-role-between . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

1 About the kris System

How to obtain kris The kris system can be obtained via anonymous ftp from server ftp.dfki.uni-sb.de.

Get the file /pub/tacos/KRIS/kris.tar.gz and use
• gunzip kris.tar.gz and
• tar xvf Kris.tar

to obtain the following directories/files:

directory Kris

def-kris.lisp
inits.lisp
Convert.lisp

directory ABox

ABox-Macros.lisp
abox-structure.lisp
abox-objects.lisp
generic.lisp
abox-load-and-save.lisp
expand-akb.lisp
consistency.lisp
akb-realize.lisp
Interface.lisp
Tacos-System.lisp

directory TBox

Kris-Macros.lisp
tbox-structure.lisp
tbox-objects.lisp
generic.lisp
k-partition.lisp
satisfiability.lisp
expand-and-simplify.lisp
tbox-load-and-save.lisp
tbox-classify.lisp
input-syntax.lisp

directory RBox

naive.lisp
directory ConcreteDomains
CD-Structure.lisp
CD-Nat.lisp

2 Concept Descriptions

This section introduces the concept language provided by kris. Assume that we have three alphabets of symbols, called primitive concepts, primitive roles, and primitive attributes.

The special concept names *TOP* and *BOTTOM* are called top concept and bottom concept. The sets of concepts is inductively defined as follows. Every primitive concept is a concept. Now let C, C_{1}, …, C_{k} be concepts already defined, R be a primitive role, f, f_{1}, …, f_{l}, g_{1}, …, g_{m} be primitive attributes, and let n be a nonnegative integer. Then the following expressions are concepts:^{1}

conjunction: (and C_{1} … C_{k})

“male persons who are rich”: (and PERSON MALE RICH)

disjunction: (or C_{1} … C_{k})

“male or female persons”: (and PERSON (or MALE FEMALE))

negation: (not C)

“persons who are not male”: (and PERSON (not MALE))

exists-restriction on roles: (some R C)

“persons having a female child”: (and PERSON (some Child FEMALE))

value-restriction on roles: (all R C)

“persons for which all children are rich”: (and PERSON (all Child RICH))

number-restrictions: (atleast n R), (atmost n R)

“persons with least four friends”: (and PERSON (atleast 4 Friends)) “mothers with at most three children”: (and MOTHER (atmost 3 Child))

exists-restriction on attributes: (some f C)

“persons whose father is rich”: (and PERSON (some Has father RICH))

agreements on attribute chains: (equal (compose f_{1} … f_{l}) (compose g_{1} … g_{m})) “individuals whose father and grandfather have the same first name”:

     (equal (compose Father First name) (compose Father Father First name))

disagreements on attribute chains: (not-equal (compose f_{1} … f_{l}) (compose g_{1} … g_{m})) “individuals whose father and grandfather have not the same first name”:

     (not-equal (compose Father First name) (compose Father Father First name))

Referring to elements of an enumertation type Suppose that e_{1}, … e_{j} are (some) elements of an enumeration type. Then the following expression is a concept:

set-of: (set-of e_{1} … e_{j})

“cars that are either red or blue”:

     (and CAR (some Has-colour (set-of blue green)))

1In the following examples we suppose that PERSON, MALE, FEMALE, RICH, MOTHER are names for (primitive) concepts, Child, Friend are names for primitive roles, and Has father, Has wife, First name, Has-colour are names for primitive attributes.

Referring to integers in concept expressions In order to refer to (nonnegative integers in concept expressions one can use binary predicates such as >= or =.

predicates on the nonnegative integers: predicate <expression-1> <expression-2>

where predicate is >=, >, =, <=, <, or <>, and <expression-i> is either an attribute chain or a nonnegative integer. “persons who are at least 18 years old”:

     (and PERSON (>= age 18))

“men whose wife is older than their fathers”:

     (and MAN (>= (compose Has-wife Age) (compose Has-father Age)))

3 Sample Session

;;;=====================================================================
;;; these definitions are assumed to be contained
;;; in a file "person.tbox"
(defprimattribute Age)        ; introduces a name for an attribute
(defprimattribute Hair-colour)
(defset Colour (red white black brown))
                              ; defines an enumeration type
(defprimconcept HUMAN (and (>= age 0) (some Hair-Colour Colour)))
                              ; every human has an age and a hair colour
(defprimconcept MALE)
(defprimconcept FEMALE)
(disjoint MALE FEMALE)        ; no individual is both male and female
(defconcept MAN (and HUMAN MALE))
(defconcept WOMAN (and HUMAN FEMALE))
(defprimrole Child)           ; introduces a name for a role
(defconcept MOTHER (and WOMAN (some Child HUMAN)))
(defconcept FATHER (and MAN (some Child HUMAN)))
(defconcept PARENT (or MOTHER FATHER))
(defconcept GRANDPARENT (and PARENT (some Child PARENT)))
(defconcept PARENT-WITH-THREE-CHILDREN (and PARENT (atleast 3 Child)))
(defconcept FATHER-WITH-SONS-ONLY (and PARENT (all Child MALE)))
;;; end of file "person.tbox"
;;;=====================================================================

;;;=====================================================================
;;; these assertions are assumed to be contained

;;; in a file "person.abox"
(assertion Tom MAN)
(assertion Tom Peter Child)
(assertion Tom Harry Child)
(assertion Peter HUMAN)
(assertion Harry HUMAN)
(assertion Mary (and MOTHER PARENT-WITH-SONS-ONLY))
(assertion Mary Tom Child)
(assertion Mary Chris Child)
;;; end of file "person.abox"
;;;=====================================================================

; load the TBox "person.tbox"
> (load-tkb "person")
Loading TBox './person.tbox'
#<tkb /home/winoserv-1/hollunde/Lisp/Checks/person.tbox>
; compute all subsumption relationship between the concepts in the TBox
> (classify-tkb)
T
; get the subsumers for FATHER
> (all-supers 'father)
(c[HUMAN] c[PARENT] c[MALE] c[*TOP*] c[MAN])
; returns all concepts that subsume FATHER.
; Note that the LISP-structures of the concepts are returned.
; get the immediate subsumers for FATHER
> (direct-supers 'FATHER)
(c[MAN] c[PARENT])
; get the subsumees for FATHER
> (all-subs 'FATHER)
(c[*BOTTOM*] c[FATHER-WITH-SONS-ONLY])
; get the immediate subsumees for FATHER
> (direct-subs 'FATHER)
(c[FATHER-WITH-SONS-ONLY])
; some subsumption tests ...
> (subsumes 'MOTHER 'GRANDPARENT)
NIL
> (subsumes MOTHER '(and FEMALE GRANDPARENT))
T
> (subsumes '(and HUMAN (some Child MALE) (some Child PARENT))
            '(and HUMAN (some Child (and MALE PARENT))))
T

> (subsumes '(and HUMAN (some Child (and MALE PARENT)))
            '(and HUMAN (some Child MALE) (some Child PARENT)))
NIL
> (subsumes '(and human (>= Age 18)) (and father (>= Age 31)))
T
; concepts that cannot have any instances ...
> (satisfiable '(and MOTHER FATHER))
NIL
> (satisfiable '(and HUMAN (some Child (and MALE FEMALE))))
NIL
; but ...
> (satisfiable '(and HUMAN (all Child (and MALE FEMALE))))
T
; concepts that are equivalent, i.e., which subsume each other
> (equivalent-concepts '(and HUMAN (all Child (and MALE PARENT)))
                       '(and HUMAN (all Child MALE) (all Child PARENT)))
; concepts that are disjoint
> (disjoint-concepts 'grandparent '(human (all child (not parent))))
T
; add another concept to the TBox and classify it automatically
> (add-concept GRANDFATHER (AND FATHER (some Child PARENT)))
c[GRANDFATHER]
; get the immediate subsumees for FATHER
> (direct-subs 'FATHER)
(c[FATHER-WITH-SONS-ONLY] c[GRANDPARENT])
; get the descriptions of some definitions ...
> (description 'father)
(AND MAN (SOME CHILD HUMAN))
> (description 'Colour)
(OR RED WHITE BLACK BROWN)

(load-akb "person")
; the ABox uses automatically the definitions from the
; previously loaded TBox
> (consistent-akb)
T
; compute for each individual occurring in the ABox the
; most specific concepts
> (realize-akb :output-mode :names)
Realizing object TOM
Realizing object PETER

Realizing object HARRY
Realizing object MARY
Realizing object CHRIS
T
((CHRIS NIL) (MARY NIL) (HARRY NIL) (PETER NIL) (TOM NIL))
; show the most specific concepts for TOM and MARY
> (most-specific-concepts 'TOM)
(c[FATHER])
> (most-specific-concepts 'MARY)
(c[GRANDPARENT] c[MOTHER])
; retrieve all parents with at least two children
> (retrieve-instances '(and PARENT (atleast two Child)))
(MARY TOM)
; belongs an individual to some concept
> (is-instance-of 'tom '(and FATHER (all Child MALE)))
NIL
> (is-instance-of 'mary '(and MOTHER (all Child MALE)))
T
> (is-instance-of 'chris 'male)
T
; get all concepts which contain Mary
> (individual-concepts 'Mary)
(c[PARENT] c[WOMAN] c[*TOP*] c[FEMALE] c[HUMAN] c[MOTHER] c[GRANDPARENT])
; add another assertion and compute the most specific concepts
> (add-assertion Tom Jane Child)
T
> (add-assertion Jane WOMAN)
T
> (most-specific-concepts 'Tom)
(c[PARENT-WITH-THREE-CHILDREN] c[FATHER])
> (is-instance-of 'Tom '(and FATHER (some Child WOMAN)))
T

4 Knowledge Base Management

The following functions can be used to create structures for TBoxes (resp. ABoxes) and to load concept/role definitions (resp. assertions).

4.1 TBox structures

*current-tkb* variable

Purpose: Pointer to current TBox.

*all-tkbs* variable

Purpose: List of all created TBoxes.
Remarks: Every TBox created by make-tkb is added to this list.

load-tkb macro

Purpose: Loads a TBox from a file.

Syntax: filename &key (tkb *current-tkb*)(verbose T) (reload NIL) (overwrite NIL)

Arguments:

The function tries to find a file containing a TBox. tkb is filled with the definitions from the file filename. verbose specifies whether there should be a note about the loading (value non-NIL) or not (value NIL). If a classified TBox was saved, reload specifies that the classified TBox should be loaded (value NIL) or that just the definitions should be loaded (value non-NIL).

Return: The TBox is returned.

Remarks:

The function does not change the value of *current-tkb* if tkb is specified. If the loaded TBox has the same name as *current-tkb*, the user is asked whether *current-tkb* should be overwritten or not. In this case the referenced ABox is bound to the loaded TBox.

Example:

           (load-tkb "TBox-one" :overwrite t)

Loads a TBox from file TBox-one.tbox.

See also: save-tkb, p. 12

save-tkb function

Purpose: Saves a TBox on a file.

Syntax: &optional (filename nil) &key (tkb *current-tkb*) (write-info T)

Arguments:

The TBox tkb is saved on a file. To get a complete pathname, filename is used. If tkb is already classified, write-info specifies whether the classified tkb should be saved on an info-file (value non-NIL) or not (value NIL).

Remarks: Not yet implemented.
Return: The pathname of the written file is returned.

Example:

           (save-tkb :tkb TBox-one :filename "family")

Saves TBox TBox-one on file ”family”.

See also: load-tkb, p. 11 save-akb, p. 14

make-tkb function

Purpose: Creates a new TBox.

Syntax: name

Arguments: name is the name for the TBox.
Remarks: *all-tkbs* is changed accordingly.
Return: Returns the TBox.

Example:

           (make-tkb "TBox-one.tbox")

Creates a TBox with name TBox-one.tbox.

See also: init-tkb, p. 13 expand-tkb, p. 13

init-tkb function

Purpose: Initializes a TBox.

Syntax: &optional (tkb *current-tkb*)

Arguments: tkb is a TBox.

Remarks:

The definitions of the TBox tkb are deleted. *TOP* and *BOTTOM* are the only concepts after the initialization.

See also: expand-tkb, p. 13

expand-tkb function

Purpose: Expands a TBox.

Syntax: tkb

Arguments: tkb is a TBox.
Remarks: @@@

4.2 ABox structures

*current-akb* variable

Purpose: Pointer to current ABox.

*all-akbs* variable

Purpose: List of all created ABoxes.
Remarks: Every ABox created by make-akb is added to this list.

load-akb function

Purpose: Loads an ABox from a file.

Syntax: filename &key (akb *current-akb*)(tkb *current-tkb*)(verbose T) (reload NIL) (fkb NIL) (rkb NIL) (overwrite NIL)

Arguments:

The function tries to find a file containing an ABox. filename is the name of the ABox. tkb (default *current-tkb*) is the related TBox. verbose specifies whether there should be a note about the loading (value non-NIL) or not (value NIL). If a realized ABox was saved, reload specifies that the realized ABox is loaded (value NIL) or that juts the assertions are loaded (value non-NIL).

Return: The ABox is returned.

Remarks:

The function does not change the value of *current-akb* if akb is specified. If the loaded ABox has the same name as *current-akb*, the user is asked whether *current-akb* should be overwritten or not. In this case the referenced TBox is bound to the loaded ABox.

Example:

           (load-akb "ABox-one")

Loads ABox assertions contained in file ABox-one.abox.

See also: save-akb, p. 14

save-akb function

Purpose: Saves an ABox on a file.

Syntax: &optional(filename nil) &key (akb *current-akb*) (write-info T)

Arguments:

The ABox akb is saved on a file. To get a complete pathname, filename is used. If akb is already realized, write-info specifies whether the realized akb should be saved on an info-file (value non-NIL or not (value NIL).

Remarks: Not yet implemented.

Return: The pathname of the written file is returned.

Example:

           (save :filename "ABox-one")

Saves *current-akb* on file ABox-one.

See also: load-akb, p. 14 save-tkb, p. 12

make-akb function

Purpose: Creates a new ABox.

Syntax: file-name (tkb *current-tkb*)

Arguments: file-name is the name of the ABox. tkb (default: *current-tkb*) is the related TBox.

Remarks: *all-akbs* is changed accordingly.
Return: Returns the ABox.

Example:

           (make-akb :file-name "ABox-one.abox")

Creates an ABox with name ABox-one.abox.

See also: init-akb, p. 15 expand-akb, p. 15

init-akb function

Purpose: Initializes an ABox.

Syntax: &optional (akb *current-akb*)

Remarks: All entries of the ABox are deleted.
See also: make-akb, p. 15

expand-akb function

Purpose: Expands an ABox.

Syntax: akb

Remarks: @@@

5 TBox Definitions and ABox Assertions

5.1 TBox Definitions

def{prim}concept macro

Purpose: Defines a concept.

Syntax: concept-name &optional (concept-description *TOP*) (tkb *current-tkb*)

Arguments:

Defines a concept in TBox tkb with name concept-name, which is a symbol and definition concept-description, which is a concept (cf. section 2).

Return: The function returns the structure of the concept definition.
Remarks: There is no automatic classification of the new concept concept-name.

Examples:

           (defprimconcept MALE)
           (defconcept GRANDPARENT (and HUMAN (some child PARENT)))

See also: defprimrole, p. 18 defprimattribute, p. 18 add-concept, p. 25

def{prim}concept-f function

Purpose: Function to define a concept.

Remarks:

For details see def{prim}concept. In contrast to def{prim}concept all arguments have to be quoted.

Examples:

           (defprimconcept-f 'MALE)
           (defconcept-f 'PARENT '(or FATHER MOTHER))

disjoint macro

Purpose: States disjointness axioms between concepts.

Syntax: concept-name-1 … concept-name-k &optional (tkb *current-tkb*)

Arguments:

Asserts that concept-name-1, …, concept-name-k do not have common instances.

Remarks: concept-name-i must have been introdcued with the macro defprimconcept or the function defprimconcept-f.

Examples: (disjoint 'MALE 'FEMALE)

disjoint-f function

Purpose: Function to state disjointness axioms.

Remarks:

For details see disjoint. In contrast to disjoint all arguments have to be quoted.

defset macro

Purpose: Defines an enumeration type.

Syntax: enumeration-type (element-1 … element-l) &optional (tkb *current-tkb*)

Arguments:

Defines an enumeration type with name enumeration-type and the elements element-1, …, element-l.

Examples: (defset COLOUR (RED BLUE YELLOW))

defset-f function

Purpose: Function to define an enumertation type.
Remarks: For details see defset. In contrast to defset all arguments have to be quoted.

defprimrole macro

Purpose: Introduces a name for a role.

Syntax: role-name (tkb *current-tkb*)

Arguments: Introduces a role in TBox tkb with name role-name.
Return: The function returns the structure of the role.

Examples: (defprimrole child)

See also: defprimattribute, p. 18

defprimrole-f function

Purpose: Function to introduce a name for a role.

Remarks:

For details see defprimrole. In contrast to defprimrole all arguments have to be quoted.

defprimattribute macro

Purpose: Defines an attribute.

Syntax: attribute-name (tkb *current-tkb*)

Arguments: Defines an attribute in TBox tkb with name attribute-name.
Return: The function returns the structure of the attribute definition.

Example: (defprimattribute name-of)

See also: defprimrole, p. 18

defprimattribute-f function

Purpose: Function to define an attribute.

Remarks:

For details see defprimattribute. In contrast to defprimattribute all arguments must be quoted.

5.2 ABox Assertions

defindividual macro

Purpose: Used to assert facts about an individual.

Syntax: description &optional relations (akb *current-akb*)

Arguments: description is a concept description. relation is a list of lists whose first element is the name of a role and the other elements are individuals.

Example: (defindividual mary

               (and MOTHER STUDENT)
               ((has-child Peter Tom)
                (married-to Harry)))

See also: assertion, p. 20

defindividual-f function

Purpose: Function to assert facts about an individual.

Remarks:

For details see defindividual. In contrast to defindividual all arguments must be quoted.

See also: defindividual, p. 19

assertion macro

Purpose:

Asserts a relation between an individual and a concept or between two individuals of an ABox.

Syntax: one two &optional three (akb *current-akb*)

Arguments:

There are two possibilities: one, the name of an individual, is asserted to be an instance of two, a concept description. Or, it is asserted that the relation with name three holds between one and two, which are names of individuals. akb is an ABox.

Example:

           (assertion Tom MAN)
           (assertion Mary Tom CHILD)
           (assertion Mary (and WOMAN (some Child MALE)))

See also: add-assertion, p. 29

assertion-f function

Purpose: Function to assert facts about individuals.

Remarks:

For details see assertion. In contrast to assertion all arguments must be quoted.

6 TBox Inferences

classify-tkb function

Purpose: Classifies a TBox.

Syntax: &key (tkb *current-tkb*) (Mode :Nothing) (write-info NIL) (Compatible-Con-cepts NIL)

Arguments:

Computes the subsumption hierarchy, i.e., all subsumption relationships between the concepts in the TBox tkb. write-info specifies whether the classified tkb should be saved on an info-file (value non-NIL) or not (value NIL). mode specifies the amount of comments during the classification:

:nothing no comments

:stars character for every classified concept

:count number of subsumption and satisfiability tests

:names names of the concepts

Example: (classify-tkb :mode :stars)

See also: direct-subs, p. 22 all-subs, p. 22 direct-supers, p. 21 all-supers, p. 21

direct-supers function

Syntax: concept &key (tkb *current-tkb*) (class 'ALL) (mode :DISJ)

Arguments: concept is a name or a structure of a concept. tkb is a TBox structure.
Return: The function returns a list of all direct predecessors of concept concept.
Remarks: The TBox must have be classified with classify-tkb.

See also: direct-subs, p. 22 all-subs, p. 22 all-supers, p. 21

all-supers function

Syntax: concept &key (tkb *current-tkb*) (class 'ALL) (mode :DISJ)

Arguments: concept is a name or a structure of a concept. tkb is a TBox structure.
Return: The function returns a list of all predecessors of concept concept.
Remarks: The TBox must have be classified with classify-tkb.

See also: direct-subs, p. 22 all-subs, p. 22 direct-supers, p. 21

direct-subs function

Syntax: concept &key (tkb *current-tkb*) (class 'ALL) (mode :DISJ)

Arguments: concept is a name or a structure of a concept. tkb is a TBox structure.
Return: The function returns a list of all direct successors of concept concept.
Remarks: The TBox must have be classified with classify-tkb.

See also: direct-supers, p. 21 all-subs, p. 22 all-supers, p. 21

all-subs function

Syntax: concept &key (tkb *current-tkb*) (class 'ALL) (mode :DISJ)

Arguments: concept is a name or a structure of a concept. tkb is a TBox structure.
Return: The function returns a list of all successors of concept concept.
Remarks: The TBox must have be classified with classify-tkb.

See also: direct-subs, p. 22 all-supers, p. 21 direct-supers, p. 21

equivalences function

Syntax: concept &key (tkb *current-tkb*) (class 'ALL) (mode :DISJ)

Arguments: concept is a name or a structure of a concept. tkb is a TBox structure.

Return:

The function returns a list of all concepts which are equivalent to concept concept.

Remarks: The TBox must have be classified with classify-tkb.
See also: equivalent-concepts, p. 24

satisfiable function

Purpose: Checks the satisfiability of a concept description.

Syntax: description &optional (tkb *current-tkb*)

Arguments: description is a concept or a concept description possibly referring to concepts and roles in tkb.

Return: The functions returns T iff description is satisfiable w.r.t. TBox tkb.

Examples:

           (satisfiable '(and WOMAN (ATMOST 0 children)))
           Checks if (and WOMAN (ATMOST 0 children)) is satisfiable. If WOMAN is not

defined in TBox-one, it is considered as a primitive concept.

subsumes function

Purpose: Checks the subsumption relation between two concept descriptions.

Syntax: concept1 concept2 &optional (tkb *current-tkb*)

Arguments: concept1 and concept2 are concepts of TBox tkb or concept descriptions possibly referring to concepts defined in tkb.

Return: The function returns T iff concept1 subsumes concept2 w.r.t. TBox tkb.

Examples: (subsumes '(and FEMALE PERSON) 'WOMAN)

See also: classify-tkb, p. 20 classify-concept, p. 24

equivalent-concepts function

Purpose: Checks if two concepts or concept descriptions are equivalent.

Syntax: description1 description2 &optional (tkb *current-tkb*)

Arguments: description1 and description2 are concepts or concept descriptions possibly referring to concepts and roles in tkb.

Return:

The functions returns T iff description1 is equivalent to description2 w.r.t. TBox tkb, i.e., if they subsume each other.

See also: equivalences, p. 22 subsumes, p. 23

disjoint-concepts function

Purpose: Checks if two concepts or concept descriptions are disjoint.

Syntax: description1 description2 &optional (tkb *current-tkb*)

Arguments: description1 and description2 are concept descriptions possibly referring to concepts and roles in tkb.

Return:

The functions returns T iff description1 and description2 are disjoint w.r.t. TBox tkb, i.e., if their conjunction is not satisfiable.

classify-concept function

Purpose: Classifies a concept description.

Syntax: description &optional (tkb *current-tkb*)

Arguments: description is a concept or a concept description with references only to terms in TBox tkb.

Return:

The function returns the result of classifying description in three values, supers, subs, and indicator, with the following meaning:

supers: a list of all concepts which strictly subsume description,

subs: a list of all concepts which are strictly subsumed by description,

equivalent: a list of equivalent concepts.

Remarks: The TBox must have be classified with classify-tkb.

Examples:

           (classify-concept '(and HUMAN FATHER))

If concepts HUMAN and FATHER are defined in tkb, they refer to tkb, otherwise they are considered as concept-names not further defined.

See also: classify-tkb, p. 20

add-concept macro

Purpose: Defines a new concept and classifies it into the TBox taxonomy.

Syntax: concept-name description &key (tkb *current-tkb*) (primitive NIL)

Arguments: concept-name, concept-description and tkb are as in def{prim}concept. If primitive is t, the concept definition is considered as a primitive one (cf. defprimconcept), otherwise it is a complete definition (cf. defconcept).

Return: The structure representing the new concept is returned.

Remarks:

In contrast to def{prim}concept, the new concept is automatically classified into the subsumption hierarchy of TBox tkb.

Example:

           (add-concept 'WOMAN '(and HUMAN FEMALE))

Adds the new concept WOMAN and classifies *current-tkb*.

See also: def{prim}concept, p. 16 delete-concept, p. 26

add-concept-f function

Purpose: Function to define a concept.

Remarks:

For details see add-concept. In contrast to add-concept all arguments have to be quoted.

delete-concept function

Purpose: Deletes a concept and classifies the resulting TBox.

Syntax: concept-name

Arguments: concept-name is as in defconcept.
Return: The function returns T iff every description in tkb is satisfiable.
Remarks: Not yet implemented.

Example: (delete-concept 'WOMAN)

See also: def{prim}concept, p. 16 add-concept, p. 25

7 ABox Inferences

consistent-akb function

Purpose: Checks the consistency of an ABox.

Syntax: &key (akb *current-akb*)

Arguments: akb is an ABox.
Return: The functions returns T iff the ABox akb is consistent.

realize-akb function

Purpose: Realizes all individuals of an ABox.

Syntax: &key (akb *current-akb*) (:Output-mode :STARS) (reuse-MSC T) (write-info NIL) (compatible-concepts NIL) (class 'ALL) (mode :DISJ)

Arguments:

All individuals of ABox akb are realized, i.e., for each individual the set of most specific concepts (in the related TBox) is determined. write-info specifies whether the realized akb should be saved on an info-file (value non-NIL) or not (value NIL). :Output-mode specifies the amout of comments during the realization process; possible value are :nothing, :stars,

:count, and :names.

:class can be used to specify which kind of concepts should be considered during the realization process; possibly values either 'ALL or a list containing (some of) the following value: user, standard, primitive, concept,

system, enum-type, enum-elem. :mode is either :DISJ or :CONJ.

Example:

(realize-akb :Output-mode :nothing)

Realizes all individuals in *current-akb*.

See also: realize-individual, p. 27 retrieve-instances, p. 27

realize-individual function

Purpose: Realizes a single individual.

Syntax: individual &key (akb *current-akb*)(reuse-MSC T) (class 'ALL) (mode :DISJ)

Arguments:

The most specific concepts which individual satisfies are determined w.r.t. the related TBox of akb.

Return: The functions returns a list of the most specific concepts.

Example: (realize-individual 'Peter)

See also: is-instance-of, p. 28 most-specific-concepts, p. 28

retrieve-instances function

Purpose: Finds all instances of a concept.

Syntax: concept &key (akb *current-akb*)(class 'STANDARD) (mode :DISJ)

Arguments: concept is a concept or a concept description possibly referring to the TBox related to akb.

Return:

The function returns all individuals that satisfy the description of concept concept in ABox akb.

See also: is-instance-of, p. 28 most-specific-concepts, p. 28 realize-individual, p. 27

is-instance-of function

Purpose: Checks if the instantiation relation holds between an individual and a concept.

Syntax: individual concept &optional (akb *current-akb*)

Arguments: individual is an individual of ABox akb, concept is a concept or a concept description possibly referring to the TBox related to akb.

Return: The function returns T iff individual is an instance of concept.

Example: (is-instance-of 'Peter 'HUMAN)

See also: most-specific-concepts, p. 28

most-specific-concepts function

Syntax: individual &key (akb *current-akb*) (class 'ALL) (mode :DISJ)

Arguments: individual occurs in the ABox akb.

Return:

The function returns a list of the most specific concepts the individual individual is instance of.

Remarks: The ABox must have be realized with realize-akb or realize-individual.

See also: realize-individual, p. 27 is-instance-of, p. 28

individual-concepts function

Syntax: individual &key (akb *current-akb*) (class 'ALL) (mode :DISJ)

Arguments: individual occurs in the ABox akb.

Return: The function returns a list of all concepts the individual is instance of.
Remarks: The ABox must have be realized with realize-akb or realize-individual.

add-assertion macro

Purpose:

Asserts a relation between an individual and a concept or between two individuals in an ABox and realizes all individuals.

Syntax: one two &optional three (akb *current-akb*)

Arguments:

There are two possibilities: one, the name of an individual, is asserted to be an instance of two, a concept description or a concept, or it is asserted that the relation with name three holds between one and two, which are names of individuals. akb is an ABox.

Remarks: The individual is automatically realized.

Examples:

           (add-assertion 'Peter '(AND MAN (SOME child PERSON)))
           (add-assertion 'Peter 'Hugo 'friends)

See also: assertion, p. 20 delete-assertion, p. 30 defindividual, p. 19 defindividual-f, p. 19

add-assertion-f function

Purpose: Function to assert a relation between an individual and a concept.

Syntax: one two &key (akb *current-akb*)

Remarks:

For details see add-assertion. In contrast to add-assertion all arguments have to be quoted.

add-triple-f function

Purpose: Function to assert a relation between an individual and a concept.

Syntax: one two three &key (akb *current-akb*)

Remarks:

For details see add-assertion. In contrast to add-assertion all arguments have to be quoted.

delete-assertion function

Purpose:

Deletes a relation between an individual and a concept or between two individuals in an ABox and realizes the resulting ABox.

Syntax: one two &optional three &key (akb *current-akb*)

Arguments:

There are two possibilities: one, the name of an individual, is asserted to be an instance of two, a concept description or a concept, or, it is asserted that the relation with name three holds between one and two, which are names of individuals. akb is an ABox. All arguments may refer to an existing TBox or ABox.

Remarks: Not yet implemented.

Examples:

           (delete-assertion 'Peter 'FATHER)
           (delete-assertion 'Peter 'John 'child)

See also: add-assertion, p. 29 assertion, p. 20 defindividual, p. 19

8 TBox Information Retrieval

get-concept function

Syntax: name &optional (tkb *current-tkb*)

Arguments: name is an atom. tkb is a TBox structure.

Return:

Returns the concept with name name in TBox tkb or NIL if the concept doesn’t exist.

Remarks: The function can also be invoked by the readermacro ‘@’.
See also: @, p. 31ATmacro

get-role function

Syntax: name &optional (tkb *current-tkb*)

Arguments: name is an atom. tkb is a TBox structure.
Return: Returns the role with name name in TBox tkb or NIL if the role doesn’t exist.
Remarks: The function can also be invoked by the readermacro ‘@’.
See also: @, p. 31

@ readermacro Purpose:

Given a name and an optional type returns the structure representing an object with this name.

Syntax: @⟨char⟩[⟨name⟩] Arguments:

⟨name⟩ is the name of the object and ⟨char⟩ indicates its type:

character type  function
c, C concept get-concept
r, R  role (attribute) get-role
i, I individual get-individual

Depending on the character, the appropriate function is invoked.

Examples: @c[MAN], @[MAN] or, @MAN returns c[MAN]

classified-tkb? function

Syntax: &optional (tkb *current-tkb*)

Arguments: tkb is a TBox structure.
Return: Returns T iff the TBox in tkb is classified.
See also: classify-tkb, p. 20

get-all-concepts function

Syntax: &key (tkb *current-tkb*)(class 'ALL) (mode :DISJ)

Arguments: tkb is a TBox structure.
Return: Returns all concepts of TBox tkb.

get-all-roles function

Syntax: &optional (tkb *current-tkb*)(class 'ALL) (mode :DISJ)

Arguments: tkb is a TBox structure.
Return: Returns all roles of TBox tkb.

what-Is? macro

Syntax: structure

Arguments: structure is either a concept or role definition.

Return:

Returns the type of the structure, which is one of the following values: ENUM-ELEM, ENUM-TYPE, CONCEPT, PRIMITIVE, FEATURE, ROLE.

is-enum-elem? macro

Syntax: structure

Arguments: structure is a concept definition.
Return: Returns T iff structure is of type ENUM-ELEM.

is-enum-type? macro

Syntax: structure

Arguments: structure is a concept definition.
Return: Returns T iff structure is of type ENUM-TYPE.

is-primitive? function

Syntax: structure

Arguments: structure is a concept definition.
Return: The function returns T iff structure is a primitive concept.

is-concept? function

Syntax: structure

Arguments: structure is a concept definition.
Return: The function returns T iff structure is a concept.

is-role? macro

Syntax: role-or-attribute &optional (tkb *current-tkb*)

Arguments: role-or-attribute is a structure.
Return: The function returns T iff role-or-attribute is a role.

is-feature? macro

Syntax: role-or-attribute &optional (tkb *current-tkb*)

Arguments: role-or-attribute is a structure..
Return: The function returns T iff role-or-attribute is a feature.

system-defined? function

Syntax: structure &optional (tkb *current-tkb*)

Arguments: structure is a concept definition or an object definition.
Return: The function returns T iff structure was automatically defined by the system.
See also: user-defined?, p. 34

user-defined? function

Syntax: structure &optional (tkb *current-tkb*)

Arguments: structure is a concept definition or an object definition.
Return: The function returns T iff structure was explicitly defined by the user.
See also: system-defined?, p. 34

name function Syntax: structure

Arguments: Possible structures are concept, individual or role.
Return: The function returns the name of structure.

Example: (name @c[HUMAN])

description function

Syntax: structure

Arguments: Possible structures are concept, individual or role.

Return:

The function returns the description of concept (resp. role) concept role; if structure is an individual, then all its assertions are returned.

9 ABox Information Retrieval

get-individual function

Syntax: name &optional (akb *current-akb*)

Arguments: name is an atom. akb is a ABox structure.

Return:

Returns the individual with name name in ABox akb or NIL if the individual doesn’t exist.

Remarks: The function can also be invoked by the readermacro ‘@’.
See also: @, p. 31

checked-on-consistency? function

Syntax: &optional (akb *current-akb*)

Return: The function returns T iff akb has already been checked on consistency.
See also: consistent-akb, p. 26

realized-akb? function

Syntax: &optional (akb *current-akb*)

Arguments: akb is an ABox structure.
Return: Returns T iff the ABox in akb is realized.
See also: realize-akb, p. 26

get-all-individuals function

Syntax: &key (akb *current-akb*) (class 'ALL) (mode :DISJ)

Arguments: akb is an ABox structure. :class can be used to specify which kind of individuals should be returned; possibly values either 'ALL or a list containing (some of) the following value: standard, abstract, concrete,

             internal-help. :mode is either :DISJ or :CONJ.

Return:

Returns all individuals of ABox akb which are of the class specified by :class and :mode.

get-object-description function

Syntax: individual &optional (akb *current-akb*)

Arguments: individual is an atom. akb is an ABox structure.
Return: The function returns the description of individual.
Remarks: NYI

get-role-successors function

Syntax: individual role &key (akb *current-akb*) (class 'ALL) (mode :DISJ)

Arguments: individual is an individual, role the name of a role or a feature chain.

Return:

The function returns a list of all individuals which are role fillers of individual w.r.t. role role (resp the feature chain).

Examples:

           (get-role-successors 'Hugo 'child)
           (get-role-successors 'Hugo '(compose f1 f2))

See also: get-role-predecessors, p. 37

get-role-predecessors function

Syntax: individual role &key (akb *current-akb*) (class 'ALL) (mode :DISJ)

Arguments: individual is an individual, role the name of a role or a feature chain.

Return:

The function returns a list of all individuals of which a individual w.r.t. role role (resp the feature chain) is a role filler.

See also: get-role-successors, p. 36

get-role-between function

Syntax: individual1 individual2 &key (akb *current-akb*) (class 'ALL) (mode :DISJ)

Arguments: individual1 and individual2 are individuals in the ABox akb.

Return:

The function returns a list of names of all roles such that individual2 is a role filler of individual1 w.r.t. these roles.

Remarks: Not yet implemented.

Index

*all-akbs*, 13
*all-tkbs*, 11
*current-akb*, 13
*current-tkb*, 11
add-assertion, 29
add-assertion-f, 29
add-concept, 25
add-concept-f, 25
add-triple-f, 29
all-subs, 22
all-supers, 21
assertion, 20
assertion-f, 20
checked-on-consistency?, 35
classified-tkb?, 31
classify-concept, 24
classify-tkb, 20
consistent-akb, 26
defattribute, 18
defattribute-1, 19
defconcept, 16
defconcept-1, 16
defindividual, 19
defindividual-f, 19
defprimattribute, 18
defprimattribute-1, 19
defprimconcept, 16
defprimconcept-1, 16
defprimrole, 18
defprimrole-1, 18
defrole, 18
defrole-1, 18
delete-assertion, 30
delete-concept, 26
description, 35
direct-subs, 22
direct-supers, 21
disjoint-concepts, 24
equivalences, 22
equivalent-concepts, 24
expand-akb, 15

                                        expand-tkb, 13
                                        get-all-concepts, 32
                                        get-all-individuals, 36
                                        get-all-roles, 32
                                        get-concept, 30
                                        get-individual, 35
                                        get-object-description, 36
                                        get-role, 31
                                        get-role-between, 37
                                        get-role-predecessors, 37
                                        get-role-successors, 36
                                        individual-concepts, 28
                                        init-akb, 15
                                        init-tkb, 13
                                        is-concept?, 33
                                        is-enum-elem?, 32
                                        is-enum-type?, 33
                                        is-feature?, 34
                                        is-instance-of, 28
                                        is-primitive?, 33
                                        is-role?, 33
                                        load-akb, 14
                                        load-tkb, 11
                                        make-akb, 15
                                        make-tkb, 12
                                        most-specific-concepts, 28
                                        name, 34
                                        realize-akb, 26
                                        realize-individual, 27
                                        realized-akb?, 36
                                        retrieve-instances, 27
                                        satisfiable, 23
                                        save-akb, 14
                                        save-tkb, 12
                                        subsumes, 23
                                        system-defined?, 34
                                        user-defined?, 34
                                        what-Is?, 32