rdfds - RDF Datasource Library in JavaScript
'rdfds' is a library for easier access to RDF datasources and resources. It contains four objects, RDFDataSource, RDFNode, RDFLiteral. and RDFEnumerator.
An RDF DataSource is a graph of nodes and literals. The constructor for RDFDataSource takes one argument, a URI of an RDF file or URL to use. If the URI exists, the contents of the RDF file are loaded. If the URL argument is null, a blank datasource is created. Resources can be added to it, or parsed from a string of RDF.
This library is designed for convenience, not for efficiency.
Example:
var ds=new RDFDataSource("file:///main/mozilla/mimtest.rdf"); var node=ds.getNode("urn:xpimaker:packlist"); var child=ds.getNode("urn:xpimaker:packlist:appinfo"); child=node.addChild(child); child.addTarget("http://www.xulplanet.com/rdf/xpimaker#appname","Find Files"); ds.save();
More Examples: XUL XUL Source Script
The library has four objects:
The rdfds.js script.