Javascript-RDF Testbed: Samples

This page provides a scratchpad collection of samples rules and data fragments that might be used with the js-rdf testbed.

see also: JS-RDF Testbed installation, full XML demo (in progress)

Sample Data

The following data may or may not work as-is. I'm using this page as a dumping ground for works in progress, quick demos etc. Some of these require the later versions of Jan's tinyProlog system (eg. for regex/externals/cut/etc).



## Use of javascript popup alerts
append(A,B,C) :- external ("'$1'+' '+ '$2'",[A, B], C).
dctitle({http://acdc.hensa.ac.uk/},"The ACDC Search Service").
dccreatoremail({http://acdc.hensa.ac.uk/},{mailto:dave.beckett@bristol.ac.uk}).
msg(T, Z) :- external("alert('hi there. RDFQ message is: $1')",[T],Z).
## example query... (make sure to leave msg to last)
foo(X) :- dctitle(URI,Title),dccreatoremail(URI,Mbox),append(Title,Mbox,Msg), msg(Msg,X).


# regex tests
regex(R, S, P, V) :- external("$2; s=$2.match(new RegExp($1, ''))[$3]", [R, S, P], V).
regfoo(V) :- regex("^.(.*).$", "hello world", 1, V).

 

Maintained by: dan brickley

Valid XHTML 1.0!