The aim of SparqlBlocks is to let you visually build queries against Linked Data sources.
Although SparqlBlocks is based on SPARQL (the standard query language for Linked Data) you do not need to know SPARQL syntax to use SparqlBlocks.
This tutorial will help you get started. Each step explains a new concept and lets you experience it in action.
The main area of the app is the workspace. Here you can drag and connect together the blocks that will form queries.
On the left there is the toolbox, where you can pick the blocks to use. They are grouped in categories ( Query, Patterns,...).
A query block executes queries against a Linked Data source (the default source is DBpedia).
The query is remotely executed and the table of results is shown below. There is a result row for each way the pattern is matched against the input graph (although only the first 5 rows are shown).
This is the most generic pattern, that match every connection (triple) in the input graph.
The blocks
Alt or ⌘ can be used in place of Ctrl.
Variables in the pattern may be replaced by resources (concepts) and literals (strings, numbers,...), to represent fixed parts of the pattern.
foaf:knows
branch
to the query pattern,
replacing the existing branch
- pred
-> obj
.
Now the query looks for pairs of resources linked by
Things get interesting when patterns are composed of multiple links.
Add a new branch to your pattern to look for the name of
foaf:name
branch
in the existing query pattern.
The values in the table of results are also blocks, resources and literals. They can be used to change the current query or create new queries.
The query may contain multiple patterns. Add another pattern to get data about the people that are friends of this person.
foaf:Person
pattern,
after the existing pattern;
Get the name of the friends too.
foaf:name
branch,
inside the new pattern;
Results by default are not given in any particular order. You can order them based on the content of one or more variables, in ascending or descending order.
You can increase or reduce the maximum number of rows you see by changing the value of the limit field.
You can filter the results according to a logic expression of your choice. For example we may request to see just the friends containing the string “tim” in the name.
Resources have types, that are other resources. This resources used as types are called classes.
There is a pre-built query to look for them.
There is also a pre-built query to look for any kind of resource. Optionally you can indicate the type of the resource.
There is also a pre-built query to look for properties. Properties identify a "type of link" between resources. For each property, the class of resources from which the links come from is called domain, while the class towards which the links go is called the range.
You can indicate none, one or both of the specific classes between which you want to use the property. The actual domain and range of the property may be classes that are more generic.
You can directly use the patterns and branches obtained from search Classes and search Properties to build queries.
You can save the current state of the Workspace anytime. It is associated to a link (URL) that you can share and/or keep yourself for future reference.
Technically, the workspace content —along with the history since last save/load— is saved on GitHub as a secret anonymous Gist. That means access is resctricted to people having the link.
As the aim is to evaluate this system, please avoid using your personal background knowledge or external systems to solve these tests.
By using this tool you acknowledge the collection of usage data for improving the tool and research purposes.
For any questions or special requests you can contact privacy@sparqlblocks.org.