query-a1aaf9c820237e94b8760eed93d5476f
Dump statement(s) given a Q-item and optionally a property. SELECT ?statement ?predicate ?propertyLabel ?value ?valueLabel WHERE { VALUES (?item ?itempredicate) { (wd:Q42 UNDEF) } #VALUES (?item ?itempredicate) { (wd:Q42 p:P2048) } ?item ?itempredicate ?statement . [] wikibase:claim ?itempredicate .
?statement ?predicate ?value . OPTIONAL { ?property wikibase:qualifier|wikibase:qualifierValue|wikibase:qualifierValueNormalized|wikibase:statementProperty|wikibase:statementValue|wikibase:statementValueNormalized ?predicate . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ?statement ?predicate
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Dump statement(s) given a Q-item and optionally a property.
SELECT ?statement ?predicate ?propertyLabel ?value ?valueLabel
WHERE {
VALUES (?item ?itempredicate) { (wd:Q42 UNDEF) }
#VALUES (?item ?itempredicate) { (wd:Q42 p:P2048) }
?item ?itempredicate ?statement .
[] wikibase:claim ?itempredicate .
?statement ?predicate ?value .
OPTIONAL { ?property wikibase:qualifier|wikibase:qualifierValue|wikibase:qualifierValueNormalized|wikibase:statementProperty|wikibase:statementValue|wikibase:statementValueNormalized ?predicate . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY ?statement ?predicate
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item")
v4("?itempredicate")
v2("?predicate"):::projected
v6("?property")
v1("?statement"):::projected
v5("?value"):::projected
a1((" "))
c9(["bd:serviceParam"]):::iri
c11(["en"]):::literal
bind0[/VALUES ?item ?itempredicate/]
bind0-->v3
bind0-->v4
bind00(["wd:Q42"])
bind00 --> bind0
bind01([ERROR: Bad value])
bind01 --> bind0
v3 -->v4--> v1
a1 --"wikibase:claim"--> v4
v1 -->v2--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
v6 -."wikibase:statementValueNormalized".-> v2
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
v6 --"wikibase:statementValue"--> v2
end
union4r <== or ==> union4l
end
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
v6 --"wikibase:statementProperty"--> v2
end
union3r <== or ==> union3l
end
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v6 --"wikibase:qualifierValueNormalized"--> v2
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v6 --"wikibase:qualifierValue"--> v2
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v6 --"wikibase:qualifier"--> v2
end
union0r <== or ==> union0l
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end