ARDF Prototype Implementation

At the core of our prototype Prolog implementation of the framework is a bottom-up reasoner used to calculate the closure of a given RDF dataset. The input of the reasoning process consists of:
(1) the set of annotated or non-annotated triples;
(2) the specification of the given annotation domain;
(3) the ruleset describing the inference rules and the way the annotation values should be propagated.

For (1) we do not suggest a special RDF serialisation for temporal triples but rather rely on existing proposals using mechanisms such as reification. Annotation domains in (2) are to be specified by appropriate lattice operations and describing default annotations for non-annotated triples. For example, for the fuzzy domain the default value is considered to be 1 and the ⊗ and ∨ operations are, respectively, the min and max operations. As for the temporal domain, we are representing triple annotations as ordered list of disjoint time intervals. This implies some additional care in the construction of the
and operations. For the representation of -∞ and +∞ we are using the inf and sup Prolog atoms, respectively. Concrete time points are represented as integers; we use a standard constraint solver over finite domains (CLPFD) in the ⊗ and ∨ operations. The default value for non-annotated triples is [-∞,+∞], represented as [inf,sup]. The ⊗ operation is implemented as the recursive intersection of all the elements of the annotation labels, i.e. temporal intervals. The ∨ operation is handled by constructing CLPFD expressions that evaluate the union of all the temporal intervals and evaluating such expression.

The rules in (3) are specified using a high-level language to specify domain independent rules that abstracts from peculiarities of the reification syntax. For example the following rule provides subclass inference in the RDFS ruleset:
 rdf(O, rdf:type, C2, V) <== rdf(O, rdf:type, C1, V1), rdf(C1, rdfs:subClassOf, C2, V2), infimum(V1, V2,
        V).  

(2) and (3) are independent of each other: it is possible to combine arbitrary rulesets and domains specifications.
Moreover it is also possible to combine several domains and use an appropriate ruleset.


Implementation

The SWI Prolog source code of our prototype implementation can be accessed here.

This package has the following structure:

 aRDF/ aRDF.pl - the generic framework aRDFS_rules.rl - the RDF
        Schema rules (only one currently) to describe how to propagate the annotated values tRDF.pl - the temporal RDF
        specific things fuzzyRDF.pl - the fuzzy RDF specific things tests - the test files 
Running the examples

This is a sample Prolog session using SWI Prolog 5.8.0 for running our temporal domain example (Alain Prost) and our fuzzy domain example (Sports Cars).

a) Alain Prost

?- [tRDF].
% library(assoc) compiled into assoc 0.00 sec, 12,028 bytes
% library(error) compiled into error 0.00 sec, 9,480 bytes
...

?- ardf:run('tests/alainProst.rdf', mykb).
Reasoning finished, 5 inference steps.
true.

?- listing(mykb:_).

quad('http://example.org/ns#AlainProst', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://example.org/ns#SportsCarDriver', [[1980, 1991], [1993, 1993]]).
quad('http://example.org/ns#AlainProst', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://example.org/ns#F1Driver', [[1980, 1991], [1993, 1993]]).
...

a) Sports Cars

?- [fuzzyRDF].
% library(assoc) compiled into assoc 0.00 sec, 24,008 bytes
% library(error) compiled into error 0.00 sec, 17,776 bytes
...

?- ardf:run('tests/sportsCars.rdf', mykb).
Reasoning finished, 2 inference steps.
true.

?- listing(mykb:_).

quad('http://example.org/ardf#BMWM3', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://example.org/ardf#ExpensiveCar', 0.9).
quad('http://example.org/ardf#audiTT', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://example.org/ardf#ExpensiveCar', 0.8).
...