query-2d9e6b2a13cab6a2a184d8f49215c967
PM20 folder with certain string(s) in the item label, alias or description
select ?item ?itemLabel ?pm20 with { select * where { bind ("brücken hamburg" as ?searchfor) } } as %p with { select ?item where { include %p bind (concat("haswbstatement:P4293 ", ?searchfor) as ?searchstr) SERVICE wikibase:mwapi { bd:serviceParam wikibase:endpoint "www.wikidata.org" . bd:serviceParam wikibase:api "Generator" . bd:serviceParam mwapi:generator "search" . bd:serviceParam mwapi:gsrsearch ?searchstr . bd:serviceParam mwapi:gsrlimit "max" . bd:serviceParam mwapi:gsrnamespace "0" . bd:serviceParam mwapi:gsrprop "" . ?item wikibase:apiOutputItem mwapi:title . } } } as %i where { include %i include %p ?item rdfs:label ?itemLabel . filter (lang(?itemLabel)="en") ?item wdt:P4293 ?pm20Id. bind(uri(concat('https://pm20.zbw.eu/folder/', ?pm20Id)) as ?pm20) }
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# PM20 folder with certain string(s) in the item label, alias or description
select ?item ?itemLabel ?pm20
where {
{
select ?item
where {
{
select * where {
bind ("brücken hamburg" as ?searchfor)
}
} bind (concat("haswbstatement:P4293 ", ?searchfor) as ?searchstr)
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "www.wikidata.org" .
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam mwapi:generator "search" .
bd:serviceParam mwapi:gsrsearch ?searchstr .
bd:serviceParam mwapi:gsrlimit "max" .
bd:serviceParam mwapi:gsrnamespace "0" .
bd:serviceParam mwapi:gsrprop "" .
?item wikibase:apiOutputItem mwapi:title .
}
}
} {
select * where {
bind ("brücken hamburg" as ?searchfor)
}
} ?item rdfs:label ?itemLabel .
filter (lang(?itemLabel)="en")
?item wdt:P4293 ?pm20Id.
bind(uri(concat('https://pm20.zbw.eu/folder/', ?pm20Id)) as ?pm20)
}