Client-side RDF store
Creates the object. Argument callback is executed every time store's contents change. Available options (properties of options object) are:
All loaded data in a big array of triples (array of arrays).
All loaded data in a complex JSON object, as shown below.
[ { preds:{ "http://www.w3.org/1999/02/22-rdf-syntax-ns#type":[ "http://www.w3.org/2000/10/swap/pim/contact#Male", "http://xmlns.com/foaf/0.1/Person" ], "http://www.w3.org/2000/01/rdf-schema#label":["Tim Berners-Lee"], "http://www.w3.org/2000/10/swap/pim/contact#assistant":[{...}], "http://www.w3.org/2000/10/swap/pim/contact#homePage":["./"], "http://www.w3.org/2000/10/swap/pim/contact#office":[{...}] }, ouri:"samples/tbl.xml", type:"http://xmlns.com/foaf/0.1/PersonalProfileDocument", uri:"_:832_0", back:[{...}] }, ... ]
Loaded data after filters have been applied. Same structure as data.all.
Dereferences url and adds its contents to store. Two remaining arguments are used to override global ajaxStart and ajaxEnd parameters.
Adds an array of triples (triplesArray) to storage. The url specifies the address from where these triples originate.
Adds an XML document (fetched by OAT.AJAX.GET for instance) to storage. The url specifies the address from where this document originates.
Returns a reasonable title (falls back to URI) of an item in storage.
Simplifies an URI by removing as much as possible (leaving the part after '#' or '/').
Applies a pass filter to store contents. Filter type is specified as one of available constants. For FILTER_PROPERTY, both 2nd and 3rd arguments
should be used: these specify predicate value and object value (only resources having this P and O will pass).
For FILTER_URI, only 2nd argument should be used: this value specifies an URI to be filtered (only resources having this URI as O or S will pass).
Removes a previously set filter; syntax is the same as in addFilter.
Temporarily disables (removes) all triples originating from url from the store.
Re-enables previously disabled url, so its contents are loaded in a store.
var callback = function() { alert("Store contents have changed, check them out!"); } var store = new OAT.RDFStore(callback,{}); store.addURL("myRDF.n3");