-
Notifications
You must be signed in to change notification settings - Fork 6
SPARQLed Overview
SPARQLed is a SPARQL editor that provides auto-completion suggestions about the query structure or about the query syntax. It leverages the Graph Summary to provide context-aware recommendations about various element in the query. Hitting CTRL + SPACE
for example at the predicate position displays a list of possible predicates. The list is filtered accordingly with the connected triple patterns.
SPARQLed makes use of the entire query to recommend you a query element.
For example, You only get predicates used with the class foaf:Person if you were to write ?s a foaf:Person;
then hit CTRL + SPACE
(mind the semi-colon). The other way around works also, i.e., you constrain first the desired predicates, then you want to know what are the classes used with them.
You can also get predicates suggestions between two variables. For example, if you write the following, you are proposed with predicates that link an entity of type foaf:Person with an entity of type foaf:Organization.
SELECT * {
?s a foaf:Person;
< ?o .
?o a foaf:Organization .
}
In that query, the character <
displays the position in the query where you hit CTRL + SPACE
.
We define as a "class" any object which predicate is a class attribute. A list of class attributes is listed in the recommendation-servlet/src/main/resources/default-config.xml
configuration file, under the classAttributes
tag.
For example, if you write ?s a
then hit CTRL + SPACE
, a list of classes is proposed to the user, e.g., foaf:Person.
A list of predicates is proposed to user when you write ?s
then hit CTRL + SPACE
, e.g., foaf:name.
Through the GRAPH
keyword, you can get suggestions about the graphs name that match the current query.
You can write the following query, hit CTRL + SPACE
at the position indicated by <
, and you will be suggested with the graphs name that match the patterns within the GRAPH clause:
SELECT * {
GRAPH < {
?s a foaf:Person
}
}
Thanks to the Flint SPARQL Editor, you have syntax highlighting and also recommendations about SPARQL keywords.
For example, if you enter the following query and hit CTRL + SPACE
at the position indicated by <
, you are recommended with a list of possible, and valid, SPARQL keywords:
SELECT < * {
?s ?p ?o
}
Here, the keyword DISTINCT
is recommended.