geoknow / jassa Goto Github PK
View Code? Open in Web Editor NEWJAvascript Suite for Sparql Access
JAvascript Suite for Sparql Access
var criteria = {name: {$regex: filterText, $optional: true}};
would ease some pain!
When creating a Jassa.sparql.SparqlServiceHttp
like that
$scope.endpoint = new Jassa.sparql.SparqlServiceHttp('http://localhost/sparql', 'http://linkedgeodata.org')
and then call
$scope.endpoint.execSelect('SELECT ?t WHERE { [] a ?t }');
the query that is generated is:
http://localhost/sparql?default-graph-uri=h&default-graph-uri=t&default-graph-uri=t&default-graph-uri=p&default-graph-uri=:&default-graph-uri=/&default-graph-uri=/&default-graph-uri=l&default-graph-uri=i&default-graph-uri=n&default-graph-uri=k&default-graph-uri=e&default-graph-uri=d&default-graph-uri=g&default-graph-uri=e&default-graph-uri=o&default-graph-uri=d&default-graph-uri=a&default-graph-uri=t&default-graph-uri=a&default-graph-uri=.&default-graph-uri=o&default-graph-uri=r&default-graph-uri=g&query=SELECT ?t WHERE { [] a ?t }&
(I already URL decoded it for readability.) There are several default-graph-uri
GET parameters, each holding one letter of the actual default graph 'http://linkedgeodata.org'
When having set a Sponate mapping, e.g. via
store.addMap({
name: 'castles',
template: [{
id: '?s',
name: '?l',
depiction: '?d',
}],
from: '{ Select * { ?s a dbpedia-owl:Castle ; rdfs:label ?l ; foaf:depiction ?d ; dbpedia-owl:owner ?o . ?o rdfs:label ?on . Filter(langMatches(lang(?l), "en")) . Filter(langMatches(lang(?on), "en")) } Limit 10 }'
});
there is no way to update it. Calling the addMap
method again will result in an error:
[ERROR] An attribute / store with name concept0 already exists
In some cases it would be very usefull to update or re-set a mapping for a given name, e.g. via delMap
or by just calling addMap
again.
Not sure if this is in scope for the project, but does Jassa support accessing RDF/Turtle documents on the Web, or does it require a SPARQL endpoint?
Aside: are questions like these best asked here or is there a mailing list?
I personally prefer
SELECT DISTINCT * { ?distinctThing a :selectExample. FILTER NOT EXISTS (?distinctThing a :notThatGroup ) } LIMIT 100
over
select distinct * { ?distinctThing a :selectExample. filter not exists (?distinctThing a :notThatGroup ) } limit 100
as this makes the queries more readable.
It would be nice if you could set a FILTER NOT EXISTS (...)
with the sparql
module.
For example:
var s = rdf.NodeFactory.createVar("s");
var p = rdf.NodeFactory.createVar("p");
var o = rdf.NodeFactory.createVar("o");
filter = new sparql.ElementFilterNotExists(new rdf.Triple(s, p, o));
console.log(filter.toString()); // logs FILTER NOT EXISTS (?s ?p ?o)
It would be nice to have this for arithmetics, for example:
For example:
var s = rdf.NodeFactory.createVar("s");
var p = rdf.NodeFactory.createVar("p");
filter = new sparql.ElementBindAs(s + "/ 1000",p);
console.log(filter.toString()); // logs BIND ((?s / 1000) AS ?p )
store.addMap({
name: 'castles',
template: [{
id: '?s',
name: '?l'
}],
from: '?s a dbpedia-owl:Castle ; rdfs:label ?l ; '
});
var criteria = {name: {$regex: filterText, $lang: "en"}};
looks much better than
store.addMap({
name: 'castles',
template: [{
id: '?s',
name: '?l'
}],
from: '?s a dbpedia-owl:Castle ; rdfs:label ?l ; '
+ 'Filter(langMatches(lang(?l), "en"))'
});
var criteria = {name: {$regex: filterText}};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.