This library is a swiss army knife for dealing with SPARQL queries and result sets from JavaScript. It is comprised of a set of layered modules, ranging from a (low-level) RDF API over a service abstraction layer, a SPARQL-JSON mapping layer up to a faceted browsing layer. Jassa lets you focus on application development rather than getting tangled up in SPARQL details. Note, that Jassa-Core can be used in both server- and client-side scenarios.
A good point to get started with Jassa is to have a look at the demos and see what can be achieved and how. The demos make use of widgets from the related jassa-ui-angular project.
Data Browsers
Faceted Search
- Coming soon
Applications
The jassa
object defines the following modules, of which each has its own documentation page.
- rdf Core RDF classes closely following the Jena API
- vocab Essential vocabulary definitions
- sparql Classes for the syntactic representation of SPARQL queries
- sponate SPARQL-to-JSON mapping module
- facete A powerful faceted search API
An overview of the modules is shown below:
The github issue tracker is the preferred place to discuss issues with the this project, however, you can also discuss project-related things on the jassa mailing lists on source forge:
-
npm
npm install jassa
-
bower; will fetch files from the jassa-bower release git repo
bower install jassa
- Make sure you have latest node.js installed
- Install gulp with
npm -g install gulp
- Clone this repo
cd
into repo folder and runnpm install
Now you can run gulp
to see if the tests complete as well as results for code covarage.
TODO: add explanation here
Run gulp browserify
. Then this minimal example using JQuery and Bluebird works:
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bluebird/1.2.2/bluebird.min.js"></script>
<!--<script src="dist/jassa.min.js"></script>-->
<script src="dist/jassa.js"></script>
<script type="text/javascript">
// Init jassa with native promise and jquery.ajax
var jassa = new Jassa(Promise, $.ajax);
// The jassa object is now readily available
// We hope that the name Jassa is sufficiently exotic to never cause a name clash
// But who knows. I wished JavaScript had native namespace support...
console.log("The Jassa object: ", jassa);
</script>
</head>
</html>
Example of a nodejs based set up:
// require libraries
var Promise = require('bluebird');
var request = Promise.promisifyAll(require('request'));
// create ajax function for sending requests
var ajax = function(param) {
return request.postAsync(param.url, {
json: true,
form: param.data,
}).then(function(res) {
return new Promise(function(resolve) {
resolve(res[0].body);
});
});
};
// init jassa with loaded Promise and ajax request function
var jassa = require('jassa')(Promise, ajax);