W3C Workshop on Web Standardization for Graph Data 2019 — Berlin, March 5 2019
{
human(id: "1000") {
name
height
}
}
{
"data": {
"human": {
"name": "Luke Skywalker",
"height": 1.72
}
}
}
@prefix schema: <https://schema.org/>.
SELECT ?name ?height WHERE {
<http//example.org/human/1000> a schema:Person;
schema:name ?name;
schema:height ?height.
}
{
"head": {
"vars": [ "name" , "height" ]
},
"results": {
"bindings": [
{
"name": { "type": "literal" , "value": "Luke Skywalker" },
"height": { "type": "literal" , "value": "1.72", "datatype": "http://www.w3.org/2001/XMLSchema#double" },
}
]
}
}
| GraphQL | SPARQL | |
|---|---|---|
| Low developer effort | ✓ | |
| Wide availability of professional development tools | ✓ | |
| High expressivity | ✓ | |
| Reusability of queries across datasets | ✓ |
@prefix directives.
{
human {
name
height
}
}
{
Human {
name
height
}
}
SELECT ?name ?height WHERE {
_:b1 ex:human _:human.
_:human ex:name ?name;
ex:height ?height.
}
SELECT ?name ?height WHERE {
_:b1 a ex:Human;
ex:name ?name;
ex:height ?height.
}
→ Annoying for developers if they want to switch between different approaches