Talis jQuery plugin
From n² wiki
[jQuery.Talis] is a plugin for the [jQuery javascript library]. It's currently at version 0.1
Contents |
[edit] What it does
- takes the URL of an rdf/xml document, passes it through http://convert.test.talis.com, and returns json within a specified callback function.
- retrieves publicly available data, usually in the form of RDF/JSON, or SPARQL/JSON from the Talis Platform
- list of available stores
- /items search on a store
- /services/sparql on a store
- /services/multisparql on a store
- the queue of pending jobs for a store (RDF/JSON representation of /jobs)
- available snapshots of a store (RDF/JSON representation of /snapshots)
[edit] What it Doesn't Do
- Access areas of the platform that require authentication
- POST data to the platform (it's read only)
[edit] Coming features
Wrappers for:
- Facets service
- Augment service
- Platform XSLT service
and
- a companion plugin for manipulating RDF/JSON
[edit] How it works
Download jQuery http://docs.jquery.com/Downloading_jQuery
Download http://n2.talis.com/svn/playground/kwijibo/js/Talis.jQuery.plugin/trunk/Talis.jQuery.js (or point a script tag in your document head to that URL).
Reference the two scripts with script tags in your html - reference the jQuery library first:
<script type="text/javascript" charset="utf-8" src="http://n2.talis.com/svn/playground/kwijibo/js/Talis.jQuery.plugin/trunk/jquery.js"></script> <script type="text/javascript" charset="utf-8" src="http://n2.talis.com/svn/playground/kwijibo/js/Talis.jQuery.plugin/trunk/Talis.jQuery.js"></script>
[edit] API
$.Talis.stores(callback); // retrieves RDF/JSON and passes // the data object as the first argument to the callback function $.Talis.list_stores(callback); //retrieves a flat array of store names, passing it to the callback $.Talis.Convert(url, callback); // url should be of a valid rdf/xml document $.Talis.Store(store_name); // returns a Store object; $.Talis.Store(store_name).sparql(query, callback); $.Talis.Store(store_name).multisparql(query, callback); $.Talis.Store(store_name).items(query, callback, url_params); // url_params are, optionally, // a hash with the keys max, offset and sort $.Talis.Store(store_name).jobs(callback); $.Talis.Store(store_name).snapshots(callback);

