The Description Logic Plugin
The Description Logic Plugin interfaces OWL ontologies by
using a description logic reasoner. It provides three atoms—two
for retrieving concept resp. role members and one for
testing the DL-KB for consistency.
&dlC[KB,a,b,c,d,Q](X)
Input:
KB
web address or file path of the OWL Ontology.
a
name of a binary predicate whose extension denotes addition to a concept.
b
name of a binary predicate whose extension denotes addition to the complement of a concept.
c
name of a ternary predicate whose extension denotes addition to a role.
d
name of a ternary predicate whose extension denotes addition to the complement of a role.
Q
name of a concept to be queried.
Output:
X
individuals of concept Q
This looks more difficult than it actually is. For a simple query, all you need is the first and the last input argument.
student(X) :- &dlC["http://example.org/univ.owl",a,b,c,d,"student"](X).
Provided that a, b, c, and d do not occur elsewhere in the hex-program, this rule would do nothing else than putting all members of student into the predicate student.
Now imagine you want to extend the concept freshman by "John Doe" before actually querying student:
student(X) :- &dlC["http://example.org/univ.owl",a,b,c,d,"student"](X).
a(freshman,"John Doe").
Thus, at the second position of its input list, the external atom expects a binary predicate, whose first argument denotes the concept to be extended and the second the actual individuals to be aded to the concept. Naturally, this can become very versatile:
student(X) :- &dlC["http://example.org/univ.owl",a,b,c,d,"student"](X).
a(freshman,X) :- attends(X,Y), firstyearcourse(Y).
Adding to roles works analogously, e.g.:
student(X) :- &dlC["http://example.org/univ.owl",a,b,c,d,"student"](X).
b(enrolled,X,Y) :- person(X), studies(X,Y).
The second atom follows the same input mechansim, but queries a role:
&dlR[KB,a,b,c,d,Q](X,Y)
Input:
KB
web address or file path of the OWL Ontology.
a
name of a binary predicate whose extension denotes addition to a concept.
b
name of a binary predicate whose extension denotes addition to the complement of a concept.
c
name of a ternary predicate whose extension denotes addition to a role.
d
name of a ternary predicate whose extension denotes addition to the complement of a role.
Q
name of a object property to be queried.
Output:
X,Y
pairs of individuals of property Q
For datatype properties you have to use a different atom:
&dlDR[KB,a,b,c,d,Q](X,Y)
Input:
KB
web address or file path of the OWL Ontology.
a
name of a binary predicate whose extension denotes addition to a concept.
b
name of a binary predicate whose extension denotes addition to the complement of a concept.
c
name of a ternary predicate whose extension denotes addition to a role.
d
name of a ternary predicate whose extension denotes addition to the complement of a role.
Q
name of a datatype property to be queried.
Output:
X,Y
pairs of individuals of property Q
Additionally, the DL-Plugin provides an external atom which tests the given DL-KB for consistency under the specified extensions:
&dlConsistent[KB,a,b,c,d]()
Input:
KB
web address or file path of the OWL Ontology.
a
name of a binary predicate whose extension denotes addition to a concept.
b
name of a binary predicate whose extension denotes addition to the complement of a concept.
c
name of a ternary predicate whose extension denotes addition to a role.
d
name of a ternary predicate whose extension denotes addition to the complement of a role.
Output:
none.
If the KB is consistent after possibly augmenting the A-Box according to the input list, the atom evaluates to true, otherwise false.
$Id: dlplugin.html 2916 2011-05-16 18:33:56Z tkren $