query-39564f630a2a6ab059f97359eb8f71d1
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?property ?propertyLabel ?value ?valueLabel ?rank ?bestRank WHERE
{
VALUES ?item {wd:Q12418}
?item ?predicate ?statement . # The item has some predicates & values
?property wikibase:claim ?predicate . # Select predicates that are claims (properties) - i.e. p:
?property wikibase:statementProperty ?sP . # Get the corresponding statementProperty - i.e. ps:
?statement ?sP ?value . # And the statement value
?statement wikibase:rank ?rank .
OPTIONAL { ?statement a wikibase:BestRank BIND(true AS ?bestRank) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?bestRank"):::projected
v1("?item"):::projected
v2("?predicate")
v4("?property"):::projected
v7("?rank"):::projected
v5("?sP")
v3("?statement")
v6("?value"):::projected
c7(["bd:serviceParam"]):::iri
c5(["wikibase:BestRank"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?item/]
bind0-->v1
bind00(["wd:Q12418"])
bind00 --> bind0
v1 -->v2--> v3
v4 --"wikibase:claim"--> v2
v4 --"wikibase:statementProperty"--> v5
v3 -->v5--> v6
v3 --"wikibase:rank"--> v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."a".-> c5
bind1[/"'true^^xsd:boolean'"/]
bind1 --as--o v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end