query-55ff27afb6ec813045ddd756610c7c33
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?name ?operatorLabel
WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Search";
wikibase:endpoint "www.wikidata.org";
mwapi:srsearch "HMS Castleton".
?item wikibase:apiOutputItem mwapi:title .
}
?item p:P2561 ?stat .
?stat ps:P2561 ?name .
FILTER CONTAINS(str(?name), "HMS Castleton")
?stat pq:P137 ?operator .
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("?item"):::projected
v1("?name"):::projected
v4("?operator")
v3("?stat")
c7(["www.wikidata.org"]):::literal
c1(["HMS Castleton"]):::literal
c3(["bd:serviceParam"]):::iri
c5(["Search"]):::literal
c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c10(["mwapi:title"]):::iri
f0[["contains(str(?name),'HMS Castleton')"]]
f0 --> v1
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c3 --"mwapi:api"--> c5
c3 --"mwapi:endpoint"--> c7
c3 --"mwapi:srsearch"--> c1
v2 --"mwapi:apiOutputItem"--> c10
end
v2 --"p:P2561"--> v3
v3 --"p:statement/P2561"--> v1
v3 --"p:qualifier/P137"--> v4
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c3 --"mwapi:language"--> c16
end