|
|
|
An RDF file is a
set of triples. A triple is composed of a subject, a predicate and an object.
A triple can be a fact or a rule.
|
|
A fact:
kind(christine, elza).
|
|
kind is the
predicate, christine is the subject and elza is the object of the triple.
|
|
The notation
that is used is a prolog-like syntax where variables are indicated by
capitals and constants start with a miniscule.
|
|
A rule is also a
triple. The predicate is ‘:>’ which is the implication sign.
|
|
In the rule:
|
|
child(X,Y),
child(Y,Z) :> grandparent(Z,X).
|
|
the subject is:
child(X,Y), child(Y,Z)
|
|
and the object
is: grandparent(Z,X)
|
|
This rule says
that, if X is a child of Y and Y is a child of Z then Z is a grandparent of
X.
|
|
|
|
And of course a
query can be done:
|
|
give all Z that
are grandmother of X.
|