query-858ab0b16b2496bce42b74933b6dae45
I tried: https://stackoverflow.com/questions/38527828/how-to-query-wikidata-items-using-its-labelsAcc. to which also runs into timeout. I tried: https://stackoverflow.com/questions/38527828/how-to-query-wikidata-items-using-its-labelsAcc. to
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?label
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint "www.wikidata.org";
wikibase:api "Generator";
mwapi:generator "search";
mwapi:gsrsearch "inlabel:Franz"@de;
mwapi:gsrlimit "max".
?item wikibase:apiOutputItem mwapi:title.
}
?item rdfs:label ?label. FILTER( LANG(?label)="de" )
# … at this point, you have matching ?item(s)
# and can further restrict or use them
# as in any other SPARQL query
# Example: the following restricts the matches
# to college towns (Q1187811) only
?item wdt:P31 wd:Q12308941 .
}
Query found at
- https://www.wikidata.org/wiki/User:Herzi_Pinki/Sparql
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2024/04
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?label"):::projected
c5(["www.wikidata.org"]):::literal
c11([sinlabel:Franz^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal
c13(["max"]):::literal
c9(["search"]):::literal
c3(["bd:serviceParam"]):::iri
c18(["wd:Q12308941"]):::iri
c15(["mwapi:title"]):::iri
c7(["Generator"]):::literal
f0[["?label = 'de'"]]
f0 --> v1
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c3 --"mwapi:endpoint"--> c5
c3 --"mwapi:api"--> c7
c3 --"mwapi:generator"--> c9
c3 --"mwapi:gsrsearch"--> c11
c3 --"mwapi:gsrlimit"--> c13
v2 --"mwapi:apiOutputItem"--> c15
end
v2 --"rdfs:label"--> v1
v2 --"wdt:P31"--> c18