query-2c394ae8a050ee194df8116b13f4a252
TODO
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 ?itemLabel
WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Search";
wikibase:endpoint "www.wikidata.org";
mwapi:srsearch "Émirats". # search term
?title wikibase:apiOutput mwapi:title.
}
BIND(IRI(CONCAT(STR(wd:), ?title)) AS ?item)
FILTER NOT EXISTS {?item wdt:P31 [] . }
?item rdfs:label ?itemLabel . filter(lang(?itemLabel)="fr")
FILTER(CONTAINS(?itemLabel,"Émirats")) # search term
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?item"):::projected
v1("?itemLabel"):::projected
v3("?title")
a1((" "))
c9(["www.wikidata.org"]):::literal
c1(["Émirats"]):::literal
c5(["bd:serviceParam"]):::iri
c7(["Search"]):::literal
c12(["mwapi:title"]):::iri
f0[["contains(?itemLabel,'Émirats')"]]
f0 --> v1
f1[["?itemLabel = 'fr'"]]
f1 --> v1
f2[["not "]]
subgraph f2e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0a1
e0v1("?item"):::projected
e0a1((" ")):::projected
end
f2--EXISTS--> f2e0
f2 --> v4
f2 --> c3
f2 --> a1
v4 --"wdt:P31"--> a1
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c5 --"mwapi:api"--> c7
c5 --"mwapi:endpoint"--> c9
c5 --"mwapi:srsearch"--> c1
v3 --"mwapi:apiOutput"--> c12
end
bind3[/"concat(str('wd:'),?title)"/]
v3 --o bind3
bind3 --as--o v4
v4 --"rdfs:label"--> v1