test module

This module is included only for running unit tests

*/

    7:- module(test_aux,
    8          [my_unary_pred/1,
    9           a_or_b/1,
   10           unify_with_iri/1,
   11           a/1,
   12           b/1,
   13           mammal/1,
   14           is_mammal/1,
   15           refl/2,
   16           recursive_subclass_of/2]).   17
   18:- use_module(library(semweb/rdf11)).   19:- use_module(library(sparqlprog)).   20:- rdf_register_prefix('','http://example.org/').   21
   22%:- srule(my_unary_pred, [instance], 'demo predicate').
   23my_unary_pred(X) :- rdf(X,rdf:type,'':c1).
   24my_unary_pred(foo).
   25
   26
   27:- srule(recursive_subclass_of, [sub, super]).   28recursive_subclass_of(X,Y) :- rdf(X,rdfs:subClassOf,Y).
   29recursive_subclass_of(X,Y) :- rdf(X,rdfs:subClassOf,Z),recursive_subclass_of(Z,Y).
   30
   31% NOTE: for this to be expanded, both a/1 and b/1 need to be exported
   32a_or_b(X) :- a(X).
   33a_or_b(X) :- b(X).
   34
   35a(X) :- rdf(X,rdf:type,'':a).
   36b(X) :- rdf(X,rdf:type,'':b).
   37
   38unify_with_iri('http://x.org').
   39
   40refl(A,B) :- rdf(A,'':r,B).
   41refl(A,B) :- rdf(B,'':r,A).
   42
   43% awkward
   44refl(A,B) :- a(A),B=A.
   49mammal('':cat).
   50mammal('':dog).
   51
   52is_mammal(X) :- mammal(T),rdf(X,rdf:type,T)