query-ec876b507141ce45f633d683d20436a5
One and only one external identifierHi ! ). How can I got all the items with ONLY this external identifier and no other external identifiers ? How can I got all the items who have only a specific number of external identifiers values ? (P2930)INSPIRE-HEP author ID only have one external identifier ((Q98442698)Sam James Harper Is it possible to create a query where I can get the items with one and only one, specific or not, external identifier ? As an example, 11:06, 14 April 2024 (UTC)) talk (Simon VilleneuveThank you ! I think this should work:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?id WHERE {
?item wikibase:identifiers 1 .
?item wdt:P2930 ?id
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("?id"):::projected
v1("?item"):::projected
c2(["1^^xsd:integer"]):::literal
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"wikibase:identifiers"--> c2
v1 --"wdt:P2930"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end