query-532f8b311681a4ce257687a45d7f86e2
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?watercraftType (REPLACE(STR(?watercraftType),".*Q","Q") AS ?watercraftTypeQ) ?watercraftTypeLabel
WHERE
{
?watercraftType wdt:P31/wdt:P279* wd:Q16335899 .
FILTER NOT EXISTS { ?watercraftType wdt:P31/wdt:P279* wd:Q2235308 . }
FILTER NOT EXISTS { ?watercraftType wdt:P31/wdt:P279* wd:Q16103215 . }
FILTER NOT EXISTS { ?watercraftType wdt:P31/wdt:P279* wd:Q121289744 . }
FILTER EXISTS { { ?watercraftType wdt:P279+ wd:Q11446 . } UNION { ?watercraftType wdt:P279+ wd:Q2811 . } UNION { ?watercraftType wdt:P279+ wd:Q35872 . } }
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,es,it,de,pl".}
}
LIMIT 500
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?watercraftType"):::projected
v2("?watercraftTypeQ")
a4((" "))
a3((" "))
a2((" "))
a1((" "))
c3(["wd:Q2811"]):::iri
c6(["wd:Q121289744"]):::iri
c9(["wd:Q16335899"]):::iri
c8(["wd:Q2235308"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en,fr,es,it,de,pl"]):::literal
c4(["wd:Q35872"]):::iri
c7(["wd:Q16103215"]):::iri
c11(["bd:serviceParam"]):::iri
c2(["wd:Q11446"]):::iri
f0[[" "]]
subgraph f0e0["Exists Clause"]
subgraph unione00[" Union "]
subgraph unione00l[" "]
style unione00l fill:#abf,stroke-dasharray: 3 3;
subgraph unione01[" Union "]
subgraph unione01l[" "]
style unione01l fill:#abf,stroke-dasharray: 3 3;
e0v1 --"wdt:P279"--> e0c4
end
subgraph unione01r[" "]
style unione01r fill:#abf,stroke-dasharray: 3 3;
e0v1 --"wdt:P279"--> e0c3
end
unione01r <== or ==> unione01l
end
end
subgraph unione00r[" "]
style unione00r fill:#abf,stroke-dasharray: 3 3;
e0v1 --"wdt:P279"--> e0c2
end
unione00r <== or ==> unione00l
end
e0v1("?watercraftType"):::projected
e0c3(["wd:Q2811"]):::iri
e0c4(["wd:Q35872"]):::iri
e0c2(["wd:Q11446"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
f0 --> c3
f0 --> c4
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P279"--> c4
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P279"--> c3
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P279"--> c2
end
union0r <== or ==> union0l
end
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"wdt:P31"--> e1a1
e1a1 --"wdt:P279"--> e1c3
e1v1("?watercraftType"):::projected
e1a1((" ")):::projected
e1c3(["wd:Q121289744"]):::iri
end
f1--EXISTS--> f1e1
f1 --> v1
f1 --> c5
f1 --> a1
f1 --> c1
f1 --> c6
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c6
f2[["not "]]
subgraph f2e2["Exists Clause"]
e2v1 --"wdt:P31"--> e2a1
e2a1 --"wdt:P279"--> e2c3
e2v1("?watercraftType"):::projected
e2a1((" ")):::projected
e2c3(["wd:Q16103215"]):::iri
end
f2--EXISTS--> f2e2
f2 --> v1
f2 --> c5
f2 --> a2
f2 --> c1
f2 --> c7
v1 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c7
f3[["not "]]
subgraph f3e3["Exists Clause"]
e3v1 --"wdt:P31"--> e3a1
e3a1 --"wdt:P279"--> e3c3
e3v1("?watercraftType"):::projected
e3a1((" ")):::projected
e3c3(["wd:Q2235308"]):::iri
end
f3--EXISTS--> f3e3
f3 --> v1
f3 --> c5
f3 --> a3
f3 --> c1
f3 --> c8
v1 --"wdt:P31"--> a3
a3 --"wdt:P279"--> c8
v1 --"wdt:P31"--> a4
a4 --"wdt:P279"--> c9
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end
bind4[/"replace(str(?watercraftType),'.*Q','Q')"/]
v1 --o bind4
bind4 --as--o v2