query-5d4c71970c09605441964a26eb781dbd
09:01, 2 August 2021 (UTC)) talk (Romulanus has Octavius (preferred) and Octavus (normal) as native label, but only the former is listed. On the other hand, if the praenomen only has a normal value, it is listed. --(Q1414058)Octavius : Not sure where this is best explained, but in short, wdt: will return 'truthy' or bestRanked statements only. One needs to use p: / ps: to get all statements ... p: is the statement node, ps: the statement value. So for your query:Romulanus@
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
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 ?praenomen ?praenomenLabel ?native_label
WHERE {
VALUES ?praenomen {wd:Q1414058}
?praenomen wdt:P31 wd:Q1240901 .
OPTIONAL { ?praenomen p:P1705/ps:P1705 ?native_label . }
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;
v2("?native_label"):::projected
v1("?praenomen"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q1240901"]):::iri
bind0[/VALUES ?praenomen/]
bind0-->v1
bind00(["wd:Q1414058"])
bind00 --> bind0
v1 --"p:direct/P31"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P1705".-> a1
a1 --"p:statement/P1705"--> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end