SPARQL closely resembles GraphQL:
it is both a query language and an API.
GraphQL queries only have meaning
with respect to one source.
# List 10 people and their names
{
person(first:10) {
name
}
}
GraphQL queries only have meaning
with respect to one source.
# List 10 people and their names
{
users(first:10) {
fullName
}
}
GraphQL queries only have meaning
with respect to one source.
# List 10 people and their names
{
friends(first:10) {
displayName
}
}
SPARQL queries have universal meaning
across all possible sources.
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# List 10 people and their names
SELECT * {
?person a dbo:Person;
rdfs:label ?name.
}
LIMIT 10
We can separate language from API:
this query runs partially client-side.
The client-side engine especially shines
when executing cross-API queries.