Javascript-RDF Testbed

This page provides an overview of all the known installations and versions of the Javascript-RDF / tinyprolog tool.

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

What is this?

Js-rdf is a prototype javascript implementation of an RDF query / logic system. As such it can be useful as a lightweight (zero-installation) testbed for RDF-based Web applications.


Right now, what you see is what you get. It's fun, simple, mostly works. Jan might be persuaded to add more features to the underlying engine, or he might decide the whole thing is silly... To use, best bet is to take a look at an existing installation and copy the prolog.js and rdfquery.js files locally.

2000-07-21: Jan has added some new facilities to the prolog version (cut, builtins etc). I need to merge the RDF addons back in...


There are various copies of it around. Everything stems from Jan Grant's Prolog in Javascript implementation. As Jan says:
[Prolog] Love it or hate it, you just can't program declaritavely in it. This subset does support declarative programming by dint of removing (read: not implementing) every non-logical construct (and a few others besides) from Prolog.

The Javascript-RDF testbed consists of a little more Javascript wrapped around Jan's prolog.js, along with some tweaks to the prolog parser to support Web identifiers (URIs) as required by RDF.


The most recent testbed is the ILRT js-rdf page.

This includes both Jan's prolog, DanB's little RDFish wrapper for it, and the MinXML parser. The RDF/prolog user interface appears at foot of the page. The demo can eat RDF in a homegrown MinXML serialisation syntax (simpler than the standard RDF syntax) as well as the pseudo-prolog RDF format hacked into Java's code).

There's also a version installed on the W3C site as part of a piece on web history (rdfs tests, longer writeup).

The ATAGDemo version is different again (data only -- all the W3C-hosted copies use same .js files), and shows the use of RDF query and simple rules to reason about the capabilities of WWW authoring tools. Hacked together in collaboration with Charles McCathieNevile of the W3C's Web Accessibility Initiative (WAI); idea being that we have a distributed database in RDF that describes WWW software tools in terms of the WAI content authoring guidelines.

The only other version to date (apart from Jan's 5K submission of the (compressed) prolog engine itself) is the little paper on the DESIRE site, Metadata, Web caching and URI resolution. The paper includes an embedded RDF query demo showing how we can use metadata to reason about URIs and the location(s) of the resources they describe.

Ugh, one more (I'd forgotten this. What a mess...) example use of the code was as a Javascript component of the Mozilla browser. This demo'd against Mozilla version M10 (we're up to M16 now). It shows how something like Jan's code could provide lightweight (if sluggish ;-) cross platform query / decision support gubbins for Mozilla. The original idea for doing a Javascript logic tool came from the vague notion of putting some inference / logic capabilities into a Mozilla plugin, so it would be nice to finish this off.

Other applications

Dan Connolly has been experimenting with XSLT for semantic web screenscraping (see scribe demo for references), which provides RDF data that can be queried and processed in js-rdf.

The not-yet-implemented full xml demo (ie. using a real XML Javascript parser instead of MinXML) was prompted by Joel Crisp's mention of this handy LGPL'd XML parser.

Maintained by: dan brickley

Valid XHTML 1.0!