Racer Manual 1 6 PDF
Racer Manual 1 6 PDF
Racer Manual 1 6 PDF
Version 1.6
Volker Haarslev
Ralf Moller
{haarslev, moeller}@informatik.uni-hamburg.de
University of Hamburg, Computer Science Department
Vogt-Kolln-Str. 30, 22527 Hamburg, Germany
July 26, 2001
Contents
1 Introduction
2.1
System Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2
Sample Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3
Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1
Concept Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2
3.3
Role Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4
Concrete Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10
3.5
ABox Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
3.6
Inference Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12
3.7
13
14
TBox Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
in-tbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
init-tbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
ensure-tbox-signature . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
*current-tbox* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16
save-tbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16
4.2
find-tbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
tbox-name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
ABox Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
in-abox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
init-abox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
ensure-abox-signature . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
in-knowledge-base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
*current-abox* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
save-abox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
find-abox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
abox-name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
tbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
5.2
5.3
Built-in Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
*top*, top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
*bottom*, bottom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
Concept Axioms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
implies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
equivalent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
disjoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
define-primitive-concept . . . . . . . . . . . . . . . . . . . . . . . . . .
23
define-concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24
define-disjoint-primitive-concept . . . . . . . . . . . . . . . . . . . .
24
add-concept-axiom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
add-disjointness-axiom . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
Role Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
define-primitive-role . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
define-primitive-attribute . . . . . . . . . . . . . . . . . . . . . . . . .
27
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
add-concept-assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
forget-concept-assertion . . . . . . . . . . . . . . . . . . . . . . . . . .
29
related . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30
add-role-assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30
forget-role-assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . .
31
define-distinct-individual . . . . . . . . . . . . . . . . . . . . . . . . .
31
add-role-axioms
5.4
21
ii
state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
31
forget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
6 Reasoning Modes
32
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
*auto-realize* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
*auto-classify*
7.2
32
concept-satisfiable? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
concept-satisfiable-p . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33
concept-subsumes? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33
concept-subsumes-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33
concept-equivalent? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
concept-equivalent-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
concept-disjoint? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
concept-disjoint-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
concept-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
concept? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
concept-is-primitive-p . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
concept-is-primitive? . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
alc-concept-coherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
Role Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
role-subsumes? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
role-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
role? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
transitive-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
transitive? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
feature-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
feature? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
symmetric-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
symmetric? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39
reflexive-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39
reflexive? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39
atomic-role-inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39
role-inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40
40
role-subsumes-p
7.3
32
iii
classify-tbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40
check-tbox-coherence . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40
tbox-classified-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
tbox-classified? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
tbox-coherent? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
41
realize-abox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
abox-realized? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
ABox Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
abox-consistent-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
abox-consistent? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
43
check-abox-coherence . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
43
individual-instance? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
43
individual-instance-p . . . . . . . . . . . . . . . . . . . . . . . . . . . .
44
individuals-related? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
44
individuals-related-p . . . . . . . . . . . . . . . . . . . . . . . . . . . .
44
individual-equal? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
individual-not-equal? . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
individual-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
individual? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
tbox-coherent-p
7.4
abox-realized-p
7.5
8 Retrieval
8.1
46
TBox Retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46
taxonomy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46
concept-synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46
atomic-concept-synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . .
47
concept-descendants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
47
atomic-concept-descendants . . . . . . . . . . . . . . . . . . . . . . . . .
47
concept-ancestors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
atomic-concept-ancestors . . . . . . . . . . . . . . . . . . . . . . . . . .
48
concept-children . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
atomic-concept-children . . . . . . . . . . . . . . . . . . . . . . . . . . .
49
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
49
atomic-concept-parents . . . . . . . . . . . . . . . . . . . . . . . . . . . .
49
role-descendants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
49
atomic-role-descendants . . . . . . . . . . . . . . . . . . . . . . . . . . .
50
concept-parents
iv
8.2
role-ancestors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
50
atomic-role-ancestors . . . . . . . . . . . . . . . . . . . . . . . . . . . .
50
role-children . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
51
atomic-role-children . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
51
role-parents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
51
atomic-role-parents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52
loop-over-tboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52
all-tboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52
all-atomic-concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52
all-roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53
all-features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53
all-transitive-roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53
describe-tbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53
describe-concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
describe-role . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
ABox Retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
individual-direct-types . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
most-specific-instantiators . . . . . . . . . . . . . . . . . . . . . . . .
55
individual-types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
55
instantiators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
55
concept-instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
55
retrieve-concept-instances . . . . . . . . . . . . . . . . . . . . . . . . .
56
individual-fillers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
56
retrieve-individual-fillers . . . . . . . . . . . . . . . . . . . . . . . .
56
retrieve-related-individuals . . . . . . . . . . . . . . . . . . . . . . . .
57
related-individuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
57
retrieve-individual-filled-roles . . . . . . . . . . . . . . . . . . . . .
58
retrieve-direct-predecessors . . . . . . . . . . . . . . . . . . . . . . . .
58
loop-over-aboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
58
all-aboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
59
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
59
all-concept-assertions-for-individual . . . . . . . . . . . . . . . . . .
59
all-role-assertions-for-individual-in-domain . . . . . . . . . . . . .
59
all-role-assertions-for-individual-in-range . . . . . . . . . . . . . .
60
all-concept-assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . .
60
all-role-assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
60
describe-abox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
61
describe-individual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
61
all-individuals
62
62
63
63
vi
Introduction
The RACER1 system is a knowledge representation system that implements a highly optimized tableaux calculus for a very expressive description logic. It oers reasoning services
for multiple TBoxes and for multiple ABoxes as well. The system implements the description logic ALCQHI R+ also known as SHIQ (see [Horrocks et al. 2000]). This is the basic
logic ALC augmented with qualifying number restrictions, role hierarchies, inverse roles,
and transitive roles.
RACER supports the specication of general terminological axioms. A TBox may contain
general concept inclusions (GCIs), which state the subsumption relation between two concept terms. Multiple denitions or even cyclic denitions of concepts can be handled by
RACER.
RACER supports most of the functions specied in the Knowledge Representation System
Specication (KRSS), for details see [Patel-Schneider and Swartout 93].
RACER is implemented in ANSI Common Lisp and has been developed at the University
of Hamburg.
The RACER system can be obtained from the following web site:
http://kogs-www.informatik.uni-hamburg.de/~race/
2.1
System Installation
2.2
Sample Session
All the les used in this example are in the directory "racer:examples;". The queries are
in the le "family-queries.lisp".
;;;===============================================================
;;; the following forms are assumed to be contained in a
;;; file "racer:examples;family-tbox.lisp".
;;; initialize the TBox "family"
(in-tbox family)
1
RACER stands for Reasoner for ABoxes and Concept Expressions Renamed
;;;===============================================================
;;; the following forms are assumed to be contained in a
;;; file "racer:examples;family-abox.lisp".
;;; initialize the ABox smith-family and use the TBox family
(in-abox smith-family family)
;;; supply the signature for this ABox
(signature :individuals (alice betty charles doris eve))
betty:mother
haschild
has-sister
haschild
alice:mother
haschild
hassibling
eve
;;;
some ABox queries
;;; Is Doris a woman?
CL-USER(7): (individual-instance? doris woman)
T
;;; Of which concepts is Eve an instance?
CL-USER(8): (individual-types eve)
((SISTER) (WOMAN) (PERSON) (HUMAN) (*TOP* TOP))
;;; get all direct types of eve
CL-USER(9): (individual-direct-types eve)
(SISTER)
;;; get all descendants of Alice
CL-USER(10): (individual-fillers alice has-descendant)
(DORIS EVE CHARLES BETTY)
;;; get all instances of the concept sister
CL-USER(11): (concept-instances sister)
(DORIS BETTY EVE)
In the Appendix dierent versions of this knowledge base can be found. In Appendix A,
on page 62, you nd a version in KRSS syntax and in Appendix B, on page 63, a version
where the TBox and ABox are integrated.
2.3
Naming Conventions
Concept term
Concept name
Individual name
Object name
Role term
Role name
Attribute name
ABox name
TBox name
name
S
GNL
LCN
abox
tbox
n
real
integer
All names are Lisp symbols, the concepts are symbols or lists. Please note that for macros
in contrast to functions the arguments should not be quoted.
The API is designed to the following conventions. For most of the services oered by
RACER, macro interfaces and function interfaces are provided. For macro forms, the TBox
or ABox arguments are optional. If no TBox or ABox is specied, the *current-tbox* or
*current-abox* is taken, respectively. However, for the functional counterpart of a macro
the TBox or ABox argument is not optional. For functions which do not have macro counterparts the TBox or ABox argument may or may not be optional. Furthermore, if an
argument tbox or abox is specied in this documentation, a name (a symbol) can be used
as well.
In description logic systems a knowledge base is consisting of a TBox and an ABox. The
conceptual knowledge is represented in the TBox and the knowledge about the instances of a
domain is represented in the ABox. For more information about the description logic SHIQ
supported by RACER see [Horrocks et al. 2000]. Note that RACER assumes the unique
name assumption for ABox individuals (see also [Haarslev and M
oller 2000] where the logic
supported by RACERs precursor RACE is described). The unique name assumption does
not hold for the description logic SHIQ as introduced in [Horrocks et al. 2000].
3.1
Concept Language
The content of RACER TBoxes includes the conceptual modeling of concepts and roles as
well. The modelling is based on the signature, which consists of two disjoint sets: the set of
concept names C, also called the atomic concepts, and the set R containing the role names2 .
Starting from the set C complex concept terms can be build using several operators. An
overview over all concept- and role-building operators is given in Figure 4.
Boolean terms build concepts by using the boolean operators.
Negation
Conjunction
Disjunction
DL notation
C
C1
. . .
Cn
C1 . . . Cn
RACER syntax
(not C )
(and C1 . . . Cn )
(or C1 . . . Cn )
Qualied restrictions state that role llers have to be of a certain concept. Value restrictions assure that the type of all role llers is of the specied concept, while exist restrictions
require that there be a ller of that role which is an instance of the specied concept.
Exists restriction
Value restriction
DL notation
R.C
R.C
RACER syntax
(some R C )
(all R C )
Number restrictions can specify a lower bound, an upper bound or an exact number for
the amount of role llers each instance of this concept has for a certain role. Only roles that
are not transitive and do not have any transitive subroles are allowed in number restrictions
(see also the comments in [Horrocks-et-al. 99a, Horrocks-et-al. 99b]).
2
The signature does not have to be specied explicitly in RACER knowledge bases - the system can
compute it from the all the used names in the knowledge base - but specifying a signature may help avoiding
errors caused by typos!
CN
*top*
*bottom*
(not C )
(and C1 . . . Cn )
(or C1 . . . Cn )
(some R C )
(all R C )
(at-least n R)
(at-most n R)
(exactly n R)
(at-least n R C )
(at-most n R C )
(exactly n R C )
(> aexpr aexpr )
(>= aexpr aexpr )
(< aexpr aexpr )
(<= aexpr aexpr )
(= aexpr aexpr )
(min AN integer )
(max AN integer )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RN
(inv RN )
Figure 4: RACER concept and role terms (for the attribute expressions aexpr see below).
At-most restriction
At-least restriction
Exactly restriction
Qualied at-most restriction
Qualied at-least restriction
Qualied exactly restriction
DL notation
nR
nR
=nR
n R.C
n R.C
= n R.C
RACER syntax
(at-most n R)
(at-least n R)
(exactly n R)
(at-most n R C )
(at-least n R C )
(exactly n R C )
Actually, the exactly restriction (exactly n R) is an abbreviation for the concept term
(and (at-least n R) (at-most n R)) and (exactly n R C ) is an abbreviation for
the concept term (and (at-least n R C ) (at-most n R C ))
There are two concepts implicitly declared in every TBox: the concept top () denotes the
top-most concept in the hierarchy and the concept bottom () denotes the inconsistent
concept, which is a subconcept to all other concepts. Note that () can also be expressed
as C C (C
C ). In RACER is denoted as *top* and is denoted as *bottom*3 .
3
For KRSS compatibility reasons RACER also supports the synonym concepts top and bottom.
aexpr
AN
real
(+ aexpr1 aexpr1 )
aexpr1
|
|
|
aexpr1
real
AN
(* real AN )
|
|
3.2
subsequent axioms. The terminology of a RACER TBox may also contain several axioms
for a single concept. So if a second axiom about the same concept is given, it is added and
does not overwrite the rst axiom.
3.3
Role Declarations
In contrast to concept axioms, role declarations are unique in RACER. There exists just one
declaration per role name in a knowledge base. If a second declaration for a role is given,
an error is signaled. If no signature is specied, undeclared roles are assumed to be neither
a feature nor a transitive role and they do not have any superroles.
The set of all roles (R) includes the set of features (F) and the set of transitive roles (R+ ).
The sets F and R+ are disjoint. All roles in a TBox may also be arranged in a role hierarchy.
The inverse of a role name RN can be either explicitly declared via the keyword :inverse
(e.g. see the description of define-primitive-role in Section 5.3, page 25) or referred to
as (inv RN ).
Features (also called attributes) restrict a role to be a functional role, e.g. each individual
can only have up to one ller for this role.
Transitive Roles are transitively closed roles. If two pairs of individuals IN 1 and IN 2 and
IN 2 and IN 3 are related via a transitive role R, then IN 1 and IN 3 are also related
via R.
Role Hierarchies dene super- and subrole-relationships between roles. If R1 is a superrole of R2 , then for all pairs of individuals between which R2 holds, R1 must hold too.
In the current implementation the specied superrole relations may not be cyclic. If a role
has a superrole, its properties are not in every case inherited by the subrole. The properties
of a declared role induced by its superrole are shown in Figure 6. The table should be read
as follows: For example if a role RN 1 is declared as a simple role and it has a feature RN 2
as a superrole, then RN 1 will be a feature itself.
Superrole RN 1
Subrole RN 1
declared as
element of:
R
R
R+
F
R
R+
F
R+
R
R+
F
F
F
F
KRSS
(define-primitive-role RN
(define-primitive-role RN
RACER Syntax
(define-primitive-role RN
(define-primitive-role RN
(domain C ))
(range D))
:domain C )
:range D)
DL notation
( RN.) C
( RN.D)
DL notation
( RN.) C
( RN.D)
3.4
Concrete Domains
Racer supports reasoning over the integers and over the reals. Names for values from these
concrete domains are called objects. Individuals can be associated with objects via so-called
attributes names (or attributes for short). Note that the set of attributes must be disjoint
to the set of roles (and the set of features). Attributes can be declared in the signature of
a TBox (see below). The following example is an extension of the family TBox introduced
above.
...
(signature
:atomic-concepts (... teenager)
:roles (...)
:attributes ((integer age)))
...
(equivalent teenager (and human (min age 16)))
(equivalent old-teenager (and human (min age 18)))
...
Asking for the children of teenager reveals that old-teenager is a teenager. A further
extensions demonstrates the usage of the real concrete domain.
...
(signature
:atomic-concepts (... teenager)
:roles (...)
:attributes ((integer age)
(real temperature-celsius)
(real temperature-fahrenheit)))
...
10
(equivalent
(equivalent
(equivalent
(equivalent
...
3.5
ABox Assertions
An ABox contains assertions about individuals. The set of individual names (or individuals
for brevity) I is the signature of the ABox. The set of individuals must be disjoint to the
set of concept names and the set of role names. There are two kinds of assertions:
Concept assertions state that an individual IN is an instance of a specied concept C .
11
Role assertions state that an individual IN 1 is a role ller for a role R with respect to
an individual IN 2 .
Attribute assertions state that an object ON is a ller for a role R with respect to an
individual IN .
Constraints state relationships between objects of the concrete domain.
In RACER the unique name assumption holds, this means that all individual names used
in an ABox refer to distinct domain objects, therefore two names cannot refer to the same
domain object. Note that the unique name assumption does not hold for object names.
In the RACER system each ABox refers to a TBox. The concept assertions in the ABox
are interpreted with respect to the concept axioms given in the referenced TBox. The role
assertions are also interpreted according to the role declarations stated in that TBox. When
a new ABox is built, the TBox to be referenced must already exist. The same TBox may
be referred to by several ABoxes. If no signature is used for the TBox, the assertions in the
ABox may use new names for roles4 or concepts5 which are not mentioned in the TBox.
3.6
Inference Modes
After the declaration of a TBox or an ABox, RACER can be instructed to answer queries.
Processing the knowledge base in order to answer a query may take some time. The standard
inference mode of RACER ensures the following behavior: Depending on the kind of query,
RACER tries to be as smart as possible to locally minimize computation time (lazy inference
mode). For instance, in order to answer a subsumption query w.r.t. a TBox it is not necessary
to classify the TBox. However, once a TBox is classied, answering subsumption queries
for atomic concepts is just a lookup. Furthermore, asking whether there exists an atomic
concept in a TBox that is inconsistent (tbox-coherent-p) does not require the TBox to be
classied, either. In the lazy mode of inference (the default), RACER avoids computations
that are not required concerning the current query. In some situations, however, in order to
globally minimize processing time it might be better to just classify a TBox before answering
a query (eager inference mode).
A similar strategy is applied if the computation of the direct types of individuals is requested.
RACER requires as precondition that the corresponding TBox has to be classied. If the
lazy inference mode is enabled, only the individuals involved in a direct types query are
realized.
The inference behavior of RACER can be controlled by setting the value of the variables
*auto-classify* and *auto-realize* for TBox and ABox inference, respectively. The
lazy inference mode is activated by setting the variables to the keyword :lazy. Eager
inference behavior can be enforced by setting the variables to :eager. The default value for
each variable is :lazy-verbose, which means that RACER prints a progress bar in order
to indicate the state of the current inference activity if it might take some time. If you want
4
These roles are treated as roles that are neither a feature, nor transitive and do not have any superroles.
New items are added to the TBox. Note that this might lead to surprising query results, e.g. the set
of subconcepts for contains concepts not mentioned in the TBox in any concept axiom. Therefore we
recommend to use a signature declaration (see below).
5
These concepts are assumed to be atomic concepts.
12
this for eager inferences, use the value :eager-verbose. If other values are encountered,
the user is responsible for calling necessary setup functions (not recommended).
We recommend that TBoxes and ABoxes should be kept in separate les. If an ABox is
revised (by reloading or reevaluating a le), there is no need to recompute anything for the
TBox. However, if the TBox is placed in the same le, reevaluating a le presumably causes
the TBox to be reinitialized and the axioms to be declared again. Thus, in order to answer
an ABox query, recomputations concerning the TBox might be necessary. So, if dierent
ABoxes are to be tested, they should probably be located separately from the associated
TBoxes in order to save processing time.
During the development phase of a TBox it might be advantageous to call inference services
directly. For instance, during the development phase of a TBox it might be useful to check
which atomic concepts in the TBox are inconsistent by calling check-tbox-coherence. This
service is usually much faster than calling classify-tbox. However, if an application problem can be solved, for example, by checking whether a certian ABox is consistent or not (see
the function abox-consistent-p), it is not necessary to call either check-tbox-coherence
or classify-tbox. For all queries, RACER ensures that the knowledge bases are in the appropriate states. This behavior usually guarantees minimum runtimes for answering queries.
3.7
13
This section documents the functions for managing TBoxes and ABoxes and for specifying
queries.
4.1
TBox Management
in-tbox
macro
Description: The TBox with the specied name is taken or a new TBox with that name
is generated and bound to the variable *current-tbox*.
Syntax: (in-tbox TBN &key (init t))
Arguments: TBN
init
Remarks: Usually this macro is used at top of a le containing a TBox. This macro
can also be used to create new TBoxes.
The specied TBox is the *current-tbox* until in-tbox is called again or
the variable *current-tbox* is manipulated directly.
Examples: (in-tbox peanuts)
(implies Piano-Player Character)
.
.
.
See also: Macro signature on page 14.
init-tbox
function
Description: Generates a new TBox or initializes an existing TBox and binds it to the variable *current-tbox*. During the initialization all user-dened concept axioms and role declarations are deleted, only the concepts *top* and *bottom*
remain in the TBox.
Syntax: (init-tbox tbox &optional (class tbox))
Arguments: tbox
class
- TBox object
- class inheriting from the class tbox
Values: tbox
Remarks: This is the way to create a new TBox object.
14
signature
macro
Syntax: (signature &key (atomic -concepts nil) (roles nil) (individuals nil))
Arguments: atomic -concepts - is a list of all the concept names, specifying C.
roles - is a list of all role declarations, thereby also specifying R.
individuals - is a list of individual names, specifying I.
Remarks: Usually this macro is used at top of a le directly after the macro
in-knowledge-base, in-tbox or in-abox.
Actually it is not necessary in RACER to specify the signature, but it helps
to avoid errors due to typos.
Examples: Signature for a TBox:
(signature
:atomic-concepts (Character Baseball-Player . . . )
:roles ((has-pet)
(has-dog :parents (has-pet) :domain human :range dog)
(has-coach :feature t)))
Signature for an ABox:
(signature :individuals (Charlie-Brown Snoopy . . . ))
Signature for a TBox and an ABox:
(signature
:atomic-concepts (Character Baseball-Player . . . )
:roles ((has-pet)
(has-dog :parents (has-pet) :domain human :range dog)
(has-coach :feature t))
:individuals (Charlie-Brown Snoopy . . . ))
See also: Section Sample Session, on page 2 and page 3.
For role denitions see define-primitive-role, on page 25.
ensure-tbox-signature
function
Description: Denes the signature for a TBox and initializes the TBox.
Syntax: (ensure-tbox-signature tbox &key (atomic -concepts nil)
(roles nil))
Arguments: tbox
- is a TBox name or a TBox object.
atomic -concepts - is a list of all the concept names, specifying C.
roles - is a list of all role declarations, thereby also specifying R.
15
*current-tbox*
special-variable
Description: The variable *current-tbox* refers to the current TBox object. It is set by
the function init-tbox or by the macro in-tbox.
save-tbox
function
- TBox object
syntax - indicates the syntax of the TBox (only :krss is currently implemented).
transformed - if bound to t the TBox is saved in the format after preprocessing by RACER.
if -exists - species the action taken if a le with the specied name already
exists. All keywords for the Lisp function with-open-file are supported. The default is :supersede.
if -does -not -exist - species the action taken if a le with the specied
name does not yet exist. All keywords for the Lisp function
with-open-file are supported. The default is :create.
Values: TBox object
Remarks: A le may contain several TBoxes.
The usual way to load a TBox le is to use the Lisp function load.
Examples: (save-tbox "project:TBoxes;tbox-one.lisp")
(save-tbox "project:TBoxes;final-tbox.lisp"
(find-tbox tbox-one) :if-exists :error)
16
nd-tbox
function
Description: Returns a TBox object with the given name among all TBoxes.
Syntax: (find-tbox TBN &optional (errorp t))
Arguments: TBN
tbox-name
function
- TBox object
4.2
ABox Management
in-abox
macro
Description: The ABox with this name is taken or generated and bound to
*current-abox*. If a TBox is specied, the ABox is also initialized.
Syntax: (in-abox ABN &optional (TBN (tbox-name *current-tbox*)))
Arguments: ABN
TBN
- ABox name
- name of the TBox to be associated with the ABox.
17
init-abox
function
Description: Initializes an existing ABox or generates a new ABox and binds it to the
variable *current-abox*. During the initialization all assertions and the
link to the referenced TBox are deleted.
Syntax: (init-abox abox &optional (tbox *current-tbox*)
(class standard-abox))
Arguments: abox
tbox
class
- class of the new ABox object, that must inherit from the class
standard-abox.
ensure-abox-signature
function
Description: Denes the signature for an ABox and initializes the ABox.
Syntax: (ensure-abox-signature abox &key (individuals nil))
Arguments: abox
- ABox object
18
in-knowledge-base
macro
- TBox name
ABN
- ABox name
*current-abox*
special-variable
Description: The variable *current-abox* refers to the current ABox object. It is set by
the function init-abox or by the macros in-abox and in-knwoledge-base.
19
save-abox
function
- ABox object
syntax - indicates the syntax of the TBox (only :krss is currently implemented).
transformed - if bound to t the ABox is saved in the format it has after
preprocessing by RACER.
if -exists - species the action taken if a le with the specied name already
exists. All keywords for the Lisp function with-open-file are supported. The default is :supersede.
if -does -not -exist - species the action taken if a le with the specied
name does not yet exist. All keywords for the Lisp function
with-open-file are supported. The default is :create.
Values: ABox object
Remarks: A le may contain several ABoxes.
The usual way to load an ABox le is to use the Lisp function load.
Examples: (save-abox "project:ABoxes;abox-one.lisp")
(save-abox "project:ABoxes;final-abox.lisp"
(find-abox abox-one) :if-exists :error)
nd-abox
function
Description: Finds an ABox object with a given name among all ABoxes.
Syntax: (find-abox ABN &optional (errorp t))
Arguments: ABN
Renaming an ABox:
(setf (find-abox abox2) abox1)
abox-name
function
- ABox object
tbox
function
- ABox object
Knowledge base declarations include concept axioms and role declarations for the TBox and
the assertions for the ABox. The TBox object and the ABox object must exist before the
functions for knowledge base declarations can be used. The order of axioms and assertions
does not matter because forward references can be handled by RACER.
The macros for knowledge base declarations add the concept axioms and role declarations
to the *current-tbox* and the assertions to the *current-abox*.
5.1
Built-in Concepts
*top*, top
concept
Description: The name of most general concept of each TBox, the top concept ().
Syntax: *top*
Remarks: The concepts *top* and top are synonyms. These concepts are elements of
every TBox.
21
*bottom*, bottom
concept
Description: The name of the incoherent concept, the bottom concept ().
Syntax: *bottom*
Remarks: The concepts *bottom* and bottom are synonyms. These concepts are elements of every TBox.
5.2
Concept Axioms
This section documents the macros and functions for specifying concept axioms. The different concept axioms were already introduced in section 3.2.
Please note that the concept axioms define-primitive-concept, define-concept and
define-disjoint-primitive-concept have the semantics given in the KRSS specication
only if they are the only concept axiom dening the concept CN in the terminology. This
is not checked by the RACER system.
implies
macro
22
equivalent
macro
disjoint
macro
dene-primitive-concept
KRSS macro
- concept name
- concept term
23
dene-concept
KRSS macro
- concept name
- concept term
Remarks: Please note that in RACER, denitions of a concept do not have to be unique.
Several denitions may be given for the same concept.
Examples: (define-concept Grandmother
(and Mother (some has-child Parent)))
dene-disjoint-primitive-concept
KRSS macro
- concept name
GNL
24
add-concept-axiom
function
- TBox object
C1 , C2 - concept term
inclusion -p - boolean indicating if the concept axiom is an inclusion axiom
(GCI) or an equality axiom. The default is to state an inclusion.
Values: tbox
Remarks: RACER imposes no constraints on the sequence of concept axiom declarations with add-concept-axiom, i.e. forward references to atomic concepts
for which other concept axioms are added later are supported in RACER.
add-disjointness-axiom
function
- TBox object
CN
- concept name
GN
- group name
Values: tbox
5.3
Role Declarations
25
dene-primitive-role
- role name
dene-primitive-attribute
- attribute name
27
add-role-axioms
function
5.4
Assertions
28
instance
KRSS macro
- individual name
- concept term
add-concept-assertion
function
- ABox object
- individual name
- concept term
Values: abox
Examples: (add-concept-assertion (find-abox peanuts-characters)
Lucy Person)
(add-concept-assertion (find-abox peanuts-characters)
Snoopy (and Dog Cartoon-Character))
forget-concept-assertion
function
- ABox object
- individual name
- concept term
Values: abox
Remarks: For answering subsequent queries the index structures for the ABox will be
recomputed, i.e. some queries might take some time (e.g. those queries that
require the realization of the ABox).
Examples: (forget-concept-assertion (find-abox peanuts-characters)
Lucy Person)
(forget-concept-assertion (find-abox peanuts-characters)
Snoopy (and Dog Cartoon-Character))
29
related
KRSS macro
Description: Builds a role assertion, asserts that two individuals are related via a role (or
feature).
Syntax: (related IN 1 IN 2 R)
Arguments: IN 1
IN 2
add-role-assertion
function
- ABox object
IN 1
IN 2
- role term
Values: abox
Examples: (add-role-assertion (find-abox peanuts-characters)
Charlie-Brown Snoopy has-pet)
(add-role-assertion (find-abox peanuts-characters)
Linus Lucy (inv has-brother))
30
forget-role-assertion
function
- ABox object
IN 1
IN 2
- role term
Values: abox
Remarks: For answering subsequent queries the index structures for the ABox will be
recomputed, i.e. some queries might take some time (e.g. those queries that
require the realization of the ABox).
Examples: (forget-role-assertion (find-abox peanuts-characters)
Charlie-Brown Snoopy has-pet)
(forget-role-assertion (find-abox peanuts-characters)
Linus Lucy (inv has-brother))
dene-distinct-individual
KRSS macro
Description: This statement asserts that an individual is distinct to all other individuals
in the ABox.
Syntax: (define-distinct-individual IN )
Arguments: IN
Values: IN
Remarks: Because the unique name assumption holds in RACER, all individuals are
distinct. This function is supplied to be compatible with the KRSS specication.
state
KRSS macro
31
forget
macro
Reasoning Modes
*auto-classify*
special-variable
*auto-realize*
special-variable
7.1
concept-satisable?
macro
- concept term.
- TBox object
concept-satisable-p
function
- concept term.
- TBox object
concept-subsumes?
KRSS macro
C2
tbox
- TBox object
concept-subsumes-p
function
C2
tbox
- TBox object
33
concept-equivalent?
macro
Description: Checks if the two concepts are equivalent in the given TBox.
Syntax: (concept-equivalent? C1 C2 &optional (tbox *current-tbox*))
Arguments: C1 , C2 - concept term
tbox
- TBox object
Values: Returns t if C1 and C2 are equivalent concepts in tbox and nil otherwise.
Remarks: For testing whether two concept terms are equivalent with respect to a TBox
tbox .
See also: Function atomic-concept-synonyms,
concept-subsumes-p, on page 33.
on
page
47,
and
concept-equivalent-p
function
function
Description: Checks if the two concepts are equivalent in the given TBox.
Syntax: (concept-equivalent-p C1 C2 tbox )
Arguments: C1 , C2 - concept terms
tbox
- TBox object
Values: Returns t if C1 and C2 are equivalent concepts in tbox and nil otherwise.
Remarks: For testing whether two concept terms are equivalent with respect to a TBox
tbox . If the equality is to be tested without reference to a TBox, nil can be
used.
See also: Function atomic-concept-synonyms,
concept-subsumes-p, on page 33.
on
page
47,
and
function
concept-disjoint?
macro
Description: Checks if the two concepts are disjoint, e.g. no individual can be an instance
of both concepts.
Syntax: (concept-disjoint? C1 C2 &optional (tbox *current-tbox*))
Arguments: C1 , C2 - concept term
tbox
- TBox object
Values: Returns t if C1 and C2 are disjoint with respect to tbox and nil otherwise.
Remarks: For testing whether two concept terms are disjoint with respect to a TBox
tbox . If the disjointness is to be tested without reference to a TBox, nil can
be used.
34
concept-disjoint-p
function
Description: Checks if the two concepts are disjoint, e.g. no individual can be an instance
of both concepts.
Syntax: (concept-disjoint-p C1 C2 tbox )
Arguments: C1 , C2 - concept term
tbox
- TBox object
Values: Returns t if C1 and C2 are disjoint with respect to tbox and nil otherwise.
Remarks: For testing whether two concept terms are disjoint with respect to a TBox
tbox . If the disjointness is to be tested without reference to a TBox, nil can
be used.
concept-p
function
- concept name
- TBox object
concept?
macro
- concept name
- TBox name
concept-is-primitive-p
function
- concept name
- TBox object
concept-is-primitive?
macro
- concept name
- TBox name
alc-concept-coherent
function
Description: Tests the satisability of a K(m) , K4(m) or S4(m) formula encoded as an ALC
concept.
Syntax: (alc-concept-coherent C &key (logic :K))
Arguments: C
logic
- concept term
- species the logic to be used.
:K - modal K(m) ,
:K4 - modal K4(m) all roles are transitive,
:S4 - modal S4(m) all roles are transitive and reexive.
If no logic is specied, the logic :K is chosen.
Remarks: This function can only be used for ALC concept terms, so number restrictions
are not allowed.
7.2
Role Queries
role-subsumes?
KRSS macro
R2
TBN
- TBox name
36
role-subsumes-p
function
R2
tbox
- TBox object
role-p
function
- role term
- TBox object
role?
macro
- role term
- TBox name
transitive-p
function
- role term
- TBox object
37
transitive?
macro
- role term
- TBox name
feature-p
function
- role term
- TBox object
feature?
macro
- role term
- TBox name
symmetric-p
function
- role term
- TBox object
38
symmetric?
macro
- role term
- TBox name
reexive-p
function
- role term
- TBox object
reexive?
macro
- role term
- TBox name
atomic-role-inverse
function
- role term
- TBox object
39
role-inverse
macro
- role term
- TBox name
7.3
classify-tbox
function
- TBox object
check-tbox-coherence
function
Description: This function checks if there are any unsatisable atomic concepts in the
given TBox.
Syntax: (check-tbox-coherence &optional (tbox *current-tbox*))
Arguments: tbox
- TBox object
Values: Returns a list of all atomic concepts in tbox that are not satisable, i.e. an
empty list (NIL) indicates that there is no additional synonym to bottom.
Remarks: This function does not compute the concept hierarchy. It is much faster
than classify-tbox, so whenever it is sucient for your application use
check-tbox-coherence. This function is supplied in order to check whether
an atomic concept is satisable during the development phase of a TBox.
There is no need to call the function check-tbox-coherence if, for instance,
a certain ABox is to be checked for consistency (with abox-consistent-p).
40
tbox-classied-p
function
- TBox object
Values: Returns t if the specied TBox has been classied, otherwise it returns nil.
tbox-classied?
macro
- TBox name
Values: Returns t if the specied TBox has been classied, otherwise it returns nil.
tbox-coherent-p
function
Description: This function checks if there are any unsatisable atomic concepts in the
given TBox.
Syntax: (tbox-coherent-p &optional (tbox *current-tbox*))
Arguments: tbox
- TBox object
tbox-coherent?
macro
Description: Checks if there are any unsatisable atomic concepts in the current or specied TBox.
Syntax: (tbox-coherent? &optional (TBN (tbox-name *current-tbox*)))
Arguments: TBN
- TBox name
7.4
41
realize-abox
function
Description: This function checks the consistency of the ABox and computes the mostspecic concepts for each individual in the ABox.
Syntax: (realize-abox &optional (abox *current-abox*))
Arguments: abox
- ABox object
Values: abox
Remarks: This Function needs to be executed before queries can be posed. If the TBox
has changed and is classied again the ABox has to be realized, too.
abox-realized-p
function
- ABox object
abox-realized?
macro
- ABox name
7.5
ABox Queries
abox-consistent-p
function
Description: Checks if the ABox is consistent, e.g. it does not contain a contradiction.
Syntax: (abox-consistent-p &optional (abox *current-abox*))
Arguments: abox
- ABox object
42
abox-consistent?
macro
- ABox name
check-abox-coherence
function
- ABox object
individual-instance?
KRSS macro
- individual name
- concept term
abox
- ABox object
43
individual-instance-p
function
- individual name
- concept term
abox
- ABox object
individuals-related?
macro
Description: Checks if two individuals are directly related via the specied role.
Syntax: (individuals-related? IN 1 IN 2 R
&optional (abox *current-abox*))
Arguments: IN 1
IN 2
- role term
abox
- ABox object
individuals-related-p
function
Description: Checks if two individuals are directly related via the specied role.
Syntax: (individuals-related-p IN 1 IN 2 R abox )
Arguments: IN 1
IN 2
- role term
abox
- ABox object
44
individual-equal?
KRSS macro
Description: Checks if two individual names refer to the same domain object.
Syntax: (individual-equal? IN 1 IN 2 &optional (abox *current-abox*))
Arguments: IN 1 , IN 2 - individual name
abox
- abox object
Remarks: Because the unique name assumption holds in RACER this macro always
returns nil for individuals with dierent names. This macro is just supplied
to be compatible with the KRSS.
individual-not-equal?
KRSS macro
Description: Checks if two individual names do not refer to the same domain object.
Syntax: (individual-not-equal? IN 1 IN 2
&optional (abox *current-abox*))
Arguments: IN 1 , IN 2 - individual name
abox
- abox object
Remarks: Because the unique name assumption holds in RACER this macro always
returns t for individuals with dierent names. This macro is just supplied to
be compatible with the KRSS.
individual-p
function
- individual name
- ABox object
individual?
macro
- individual name
- ABox name
Retrieval
If the retrieval refers to concept names, RACER always returns a set of names for each
concept name. A so called name set contains all synonyms of an atomic concept in the
TBox.
8.1
TBox Retrieval
taxonomy
function
- TBox object
concept-synonyms
macro
Description: Returns equivalent concepts for the specied concept in the given TBox.
Syntax: (concept-synonyms CN
&optional (tbox (tbox-name *current-tbox*)))
Arguments: CN
tbox
- concept name
- TBox object
atomic-concept-synonyms
function
Description: Returns equivalent concepts for the specied concept in the given TBox.
Syntax: (atomic-concept-synonyms CN tbox )
Arguments: CN
tbox
- concept name
- TBox object
concept-descendants
KRSS macro
Description: Gets all atomic concepts of a TBox, which are subsumed by the specied
concept.
Syntax: (concept-descendants C
&optional (TBN (tbox-name *current-tbox*)))
Arguments: C
TBN
- concept term
- TBox name
atomic-concept-descendants
function
Description: Gets all atomic concepts of a TBox, which are subsumed by the specied
concept.
Syntax: (atomic-concept-descendants C tbox )
Arguments: C
tbox
- concept term
- TBox object
47
concept-ancestors
KRSS macro
Description: Gets all atomic concepts of a TBox, which are subsuming the specied concept.
Syntax: (concept-ancestors C
&optional (TBN (tbox-name *current-tbox*)))
Arguments: C
TBN
- concept term
- TBox name
atomic-concept-ancestors
function
Description: Gets all atomic concepts of a TBox, which are subsuming the specied concept.
Syntax: (atomic-concept-ancestors C tbox )
Arguments: C
tbox
- concept term
- TBox object
concept-children
KRSS macro
Description: Gets the direct subsumees of the specied concept in the TBox.
Syntax: (concept-children C
&optional (TBN (tbox-name *current-tbox*)))
Arguments: C
TBN
- concept term
- TBox name
48
atomic-concept-children
function
Description: Gets the direct subsumees of the specied concept in the TBox.
Syntax: (atomic-concept-children C tbox )
Arguments: C
tbox
- concept term
- TBox object
concept-parents
KRSS macro
Description: Gets the direct subsumers of the specied concept in the TBox.
Syntax: (concept-parents C
&optional (TBN (tbox-name *current-tbox*)))
Arguments: C
TBN
- concept term
- TBox name
atomic-concept-parents
function
Description: Gets the direct subsumers of the specied concept in the TBox.
Syntax: (atomic-concept-parents C tbox )
Arguments: C
tbox
- concept term
- TBox object
role-descendants
KRSS macro
Description: Gets all roles from the TBox, that the given role subsumes.
Syntax: (role-descendants R
&optional (TBN (tbox-name *current-tbox*)))
Arguments: R
TBN
- role term
- TBox name
49
atomic-role-descendants
function
Description: Gets all roles from the TBox, that the given role subsumes.
Syntax: (atomic-role-descendants R tbox )
Arguments: R
tbox
- role term
- TBox object
role-ancestors
KRSS macro
Description: Gets all roles from the TBox, that subsume the given role in the role hierarchy.
Syntax: (role-ancestors R
&optional (TBN (tbox-name *current-tbox*)))
Arguments: R
TBN
- role term
- TBox name
atomic-role-ancestors
function
Description: Gets all roles from the TBox, that subsume the given role in the role hierarchy.
Syntax: (atomic-role-ancestors R tbox )
Arguments: R
tbox
- role term
- TBox object
50
role-children
macro
Description: Gets all roles from the TBox that are directly subsumed by the given role in
the role hierarchy.
Syntax: (role-children R
&optional (TBN (tbox-name *current-tbox*)))
Arguments: R
TBN
- role term
- TBox name
atomic-role-children
function
Description: Gets all roles from the TBox that are directly subsumed by the given role in
the role hierarchy.
Syntax: (atomic-role-children R tbox )
Arguments: R
tbox
- role term
- TBox object
role-parents
KRSS macro
Description: Gets the roles from the TBox that directly subsume the given role in the role
hierarchy.
Syntax: (role-parents R &optional (TBN (tbox-name *current-tbox*)))
Arguments: R
TBN
- role term
- TBox name
51
atomic-role-parents
function
Description: Gets the roles from the TBox that directly subsume the given role in the role
hierarchy.
Syntax: (atomic-role-parents R tbox )
Arguments: R
tbox
- role term
- TBox object
loop-over-tboxes
function
all-tboxes
function
all-atomic-concepts
function
- TBox object
52
all-roles
function
Description: Returns all roles and features from the specied TBox.
Syntax: (all-roles &optional (tbox *current-tbox*))
Arguments: tbox
- TBox object
all-features
function
- TBox
all-transitive-roles
function
- TBox object
describe-tbox
function
53
describe-concept
function
Description: Generates a description for the specied concept used in the specied TBox
or in the ABox and its TBox.
Syntax: (describe-concept CN &optional (tbox -or -abox *current-tbox*)
(stream *standard-output*))
Arguments: tbox -or -abox - TBox object or ABox object
CN
- concept name
describe-role
function
Description: Generates a description for the specied role used in the specied TBox or
ABox.
Syntax: (describe-role R &optional (tbox -or -abox *current-tbox*)
(stream *standard-output*))
Arguments: tbox -or -abox - TBox object or ABox object
R
8.2
ABox Retrieval
individual-direct-types
KRSS macro
- individual name
- ABox name
54
most-specic-instantiators
function
- individual name
- ABox object
individual-types
KRSS macro
- individual name
- ABox name
instantiators
function
- individual name
- ABox object
concept-instances
KRSS macro
Description: Gets all individuals from an ABox that are instances of the specied concept.
Syntax: (concept-instances C
&optional (ABN (abox-name *current-abox*)))
Arguments: C
ABN
- concept term
- ABox name
retrieve-concept-instances
function
Description: Gets all individuals from an ABox that are instances of the specied concept.
Syntax: (retrieve-concept-instances C abox )
Arguments: C
abox
- concept term
- ABox object
individual-llers
KRSS macro
Description: Gets all individuals that are llers of a role for a specied individual.
Syntax: (individual-fillers IN R
&optional (ABN (abox-name *current-abox*)))
Arguments: IN
- role term
ABN
- ABox name
retrieve-individual-llers
function
Description: Gets all individuals that are llers of a role for a specied individual.
Syntax: (retrieve-individual-fillers IN R abox )
Arguments: IN
- role term
abox
- ABox object
56
retrieve-related-individuals
function
Description: Gets all pairs of individuals that are related via the specied relation.
Syntax: (retrieve-related-individuals R abox )
Arguments: R
abox
- role term
- ABox object
related-individuals
macro
Description: Gets all pairs of individuals that are related via the specied relation.
Syntax: (related-individuals R
&optional (ABN (abox-name *current-abox*)))
Arguments: R
ABN
- role term
- ABox name
57
retrieve-individual-lled-roles
function
Description: This function gets all roles that hold between the specied pair of individuals.
Syntax: (retrieve-individual-filled-roles IN 1 IN 2 abox ).
Arguments: IN 1
IN 2
abox
- ABox object
retrieve-direct-predecessors
function
Description: Gets all individuals that are predecessors of a role for a specied individual.
Syntax: (retrieve-direct-predecessors R IN abox )
Arguments: R
- role term
IN
abox
- ABox object
loop-over-aboxes
function
58
all-aboxes
function
all-individuals
function
- ABox object
all-concept-assertions-for-individual
function
Description: Returns all concept assertions for an individual from the specied ABox.
Syntax: (all-concept-assertions-for-individual IN
&optional (abox *current-abox*))
Arguments: IN
abox
- individual name
- ABox object
all-role-assertions-for-individual-in-domain
function
Description: Returns all role assertions for an individual from the specied ABox in which
the individual is the role predecessor.
Syntax: (all-role-assertions-for-individual-in-domain IN
&optional (abox *current-abox*))
Arguments: IN
abox
- individual name
- ABox object
all-role-assertions-for-individual-in-range
function
Description: Returns all role assertions for an individual from the specied ABox in which
the individual is a role successor.
Syntax: (all-role-assertions-for-individual-in-range IN
&optional (abox *current-abox*))
Arguments: IN
abox
- individual name
- ABox object
all-concept-assertions
function
- ABox object
all-role-assertions
function
- individual name
- ABox object
60
describe-abox
function
- ABox object
describe-individual
function
Description: Generates a description for the individual from the specied ABox.
Syntax: (describe-individual IN &optional (abox *current-abox*)
(stream *standard-output*))
Arguments: IN
abox
- individual name
- ABox object
61
The following knowledge base is specied in KRSS syntax. It is a version of the knowledge
base used in the Sample Session, on page 1.
A.1
;;;===============================================================
;;; the following forms are assumed to be contained in a
;;; file "racer:examples;family-tbox-krss.lisp".
;;; initialize the TBox family
(in-tbox family :init t)
;;; the roles
(define-primitive-role has-child :parents (has-descendant))
(define-primitive-role has-descendant :transitive t)
(define-primitive-role has-sibling)
(define-primitive-role has-sister :parents (has-sibling))
(define-primitive-role has-brother :parents (has-sibling))
(define-primitive-attribute has-gender)
;;; domain & range restrictions for roles
(implies top (all has-child person))
(implies (some has-child top) parent)
(implies (some has-sibling top) (or sister brother))
(implies top (all has-sibling (or sister brother)))
(implies top (all has-sister (some has-gender female)))
(implies top (all has-brother (some has-gender male)))
;;; the concepts
(define-primitive-concept person
(and human (some has-gender (or female male))))
(define-disjoint-primitive-concept female (gender) top)
(define-disjoint-primitive-concept male (gender) top)
(define-primitive-concept woman (and person (some has-gender female)))
(define-primitive-concept man (and person (some has-gender male)))
(define-concept parent (and person (some has-child person)))
(define-concept mother (and woman parent))
(define-concept father (and man parent))
(define-concept grandmother
(and mother
(some has-child
(some has-child person))))
62
(define-concept
(define-concept
(define-concept
(define-concept
A.2
;;;===============================================================
;;; the following forms are assumed to be contained in a
;;; file "racer:examples;family-abox-krss.lisp".
;;; initialize the ABox smith-family and use the TBox family
(in-abox smith-family family)
;;; Alice is the mother of Betty and Charles
(instance alice mother)
(related alice betty has-child)
(related alice charles has-child)
;;; Betty is mother of Doris and Eve
(instance betty mother)
(related betty doris has-child)
(related betty eve has-child)
;;; Charles is the brother of Betty (and only Betty)
(instance charles brother)
(related charles betty has-sibling)
;;; closing the role has-sibling for charles
(instance charles (at-most 1 has-sibling))
;;; Doris has the sister Eve
(related doris eve has-sister)
;;; Eve has the sister Doris
(related eve doris has-sister)
63
(equivalent
(equivalent
(equivalent
(equivalent
64
References
[Buchheit et al. 93] M. Buchheit, F.M. Donini & A. Schaerf, Decidable Reasoning in Terminological Knowledge Representation Systems, in Journal of Articial Intelligence
Research, 1, pp. 109-138, 1993.
[Haarslev and M
oller 2000] Haarslev, V. and M
oller, R. (2000), Expressive ABox reasoning
with number restrictions, role hierarchies, and transitively closed roles, in Proceedings
of Seventh International Conference on Principles of Knowledge Representation and
Reasoning (KR2000), Cohn, A., Giunchiglia, F., and Selman, B., editors, Breckenridge, Colorado, USA, April 11-15, 2000, pages 273284.
[Horrocks-et-al. 99a] I. Horrocks, U. Sattler, S. Tobies, Practical Reasoning for Description Logics with Functional Restrictions, Inverse and Transitive Roles, and Role Hierarchies, Proceedings of the 1999 Workshop Methods for Modalities (M4M-1), Amsterdam, 1999.
[Horrocks-et-al. 99b] I. Horrocks, U. Sattler, S. Tobies, A Description Logic with Transitive
and Converse Roles, Role Hierarchies and Qualifying Number Restrictions, Technical
Report LTCS-99-08, RWTH Aachen, 1999.
[Horrocks et al. 2000] Horrocks, I., Sattler, U., and Tobies, S. (2000). Reasoning with individuals for the description logic SHIQ. In MacAllester, D., editor, Proceedings of the
17th International Conference on Automated Deduction (CADE-17), Lecture Notes in
Computer Science, Germany. Springer Verlag.
[Patel-Schneider and Swartout 93] P.F. Patel-Schneider, B. Swartout Description Logic
Knowledge Representation System Specication from the KRSS Group of the ARPA
Knowledge Sharing Eort, November 1993. The paper is available as:
http://www-db.research.bell-labs.com/user/pfps/papers/krss-spec.ps
65
Index
bottom, 20
*auto-classify*, 30
*auto-realize*, 30
*bottom*, 20
*current-abox*, 17
*current-tbox*, 14
*top*, 19
abox-consistent-p, 40
abox-consistent?, 41
abox-name, 19
abox-realized-p, 40
abox-realized?, 40
add-concept-assertion, 27
add-concept-axiom, 23
add-disjointness-axiom, 23
add-role-assertion, 28
add-role-axioms, 26
alc-concept-coherent, 34
all-aboxes, 57
all-atomic-concepts, 50
all-concept-assertions, 58
all-concept-assertions-for-individual,
57
all-features, 51
all-individuals, 57
all-role-assertions, 58
all-role-assertions-for-individual-in-domain, 57
all-role-assertions-for-individual-in-range, 58
all-roles, 51
all-tboxes, 50
all-transitive-roles, 51
assertion, 9
atomic-concept-ancestors, 46
atomic-concept-children, 47
atomic-concept-descendants, 45
atomic-concept-parents, 47
atomic-concept-synonyms, 45
atomic-role-ancestors, 48
atomic-role-children, 49
atomic-role-descendants, 48
atomic-role-inverse, 37
atomic-role-parents, 50
attribute, 8, 23
66
check-abox-coherence, 41
check-tbox-coherence, 38
classify-tbox, 38
concept axioms, 7
concept denition, 8
concept equation, 8
concept term, 6
concept-ancestors, 46
concept-children, 46
concept-descendants, 45
concept-disjoint-p, 33
concept-disjoint?, 32
concept-equivalent-p, 32
concept-equivalent?, 32
concept-instances, 53
concept-is-primitive-p, 33
concept-is-primitive?, 34
concept-offspring, 46
concept-p, 33
concept-parents, 47
concept-satisfiable-p, 31
concept-satisfiable?, 30
concept-subsumes-p, 31
concept-subsumes?, 31
concept-synonyms, 44
concept?, 33
conjunction of roles, 9
define-concept, 22
define-disjoint-primitive-concept,
22
define-distinct-individual, 29
define-primitive-attribute, 25
define-primitive-concept, 21
define-primitive-role, 24
delete ABox, 18
delete TBox, 14
describe-abox, 59
describe-concept, 52
describe-individual, 59
describe-role, 52
describe-tbox, 51
disjoint, 21
disjoint concepts, 8, 21, 22
range restriction, 9
realize-abox, 40
reflexive-p, 37
reflexive?, 37
related, 28
related-individuals, 55
rename ABox, 18
rename TBox, 14
retraction, 11
retrieve-concept-instances, 54
retrieve-direct-predecessors, 56
retrieve-individual-filled-roles,
56
retrieve-individual-fillers, 54
retrieve-related-individuals, 55
role hierarchy, 9
role-ancestors, 48
role-children, 49
role-descendants, 47
role-inverse, 38
role-offspring, 48
role-p, 35
role-parents, 49
role-subsumes-p, 35
role-subsumes?, 34
role?, 35
domain restriction, 9
ensure-abox-signature, 16
ensure-tbox-signature, 13
equivalent, 21
exists restriction, 7
feature, 8, 23, 25
feature-p, 36
feature?, 36
find-abox, 18
find-tbox, 15
forget, 30
forget-concept-assertion, 27
forget-role-assertion, 29
GCI, 7, 20
implies, 20
in-abox, 15
in-knowledge-base, 17
in-tbox, 12
individual-direct-types, 52
individual-equal?, 43
individual-fillers, 54
individual-instance-p, 42
individual-instance?, 41
individual-not-equal?, 43
individual-p, 43
individual-types, 53
individual?, 43
individuals-related-p, 42
individuals-related?, 42
inference modes, 10
init-abox, 16
init-tbox, 12
instance, 27
instantiators, 53
save-abox, 18
save-tbox, 14
signature, 6
signature, 13
state, 29
subrole, 23, 25
superrole, 23, 25
symmetric-p, 36
symmetric?, 37
taxonomy, 44
tbox, 19
tbox-classified-p, 39
tbox-classified?, 39
tbox-coherent-p, 39
tbox-coherent?, 39
tbox-name, 15
top, 19
transitive role, 9, 23
transitive-p, 35
transitive?, 36
load ABox, 17
load TBox, 14
loop-over-aboxes, 56
loop-over-tboxes, 50
most-specific-instantiators, 53
name set, 44
number restriction, 7
primitive concept, 8
67
68