query-3437df9f1ca6d78a5cfd487fbaaf1e5e
18:32, 27 June 2017 (UTC)) talk (Smalyshev (WMF)--Thanks. After all the time we (I) waited for this .. I'm glad I can use it now! Good work!
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?type ?typeLabel
WHERE
{
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
bd:serviceParam mwapi:generator "search" .
bd:serviceParam mwapi:gsrsearch "cheese" .
bd:serviceParam mwapi:gsrlimit "max" .
?item wikibase:apiOutputItem mwapi:item .
}
OPTIONAL { ?item ( wdt:P31| wdt:P279 ) ?type } .
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;
v1("?item"):::projected
v2("?type"):::projected
c14(["mwapi:item"]):::iri
c12(["max"]):::literal
c10(["cheese"]):::literal
c6(["en.wikipedia.org"]):::literal
c8(["search"]):::literal
c2(["bd:serviceParam"]):::iri
c19(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["Generator"]):::literal
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:api"--> c4
c2 --"mwapi:endpoint"--> c6
c2 --"mwapi:generator"--> c8
c2 --"mwapi:gsrsearch"--> c10
c2 --"mwapi:gsrlimit"--> c12
v1 --"mwapi:apiOutputItem"--> c14
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 -."wdt:P279".-> v2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> v2
end
union0r <== or ==> union0l
end
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c2 --"mwapi:language"--> c19
end