query-2731023fe318e13f4cec350ddf60a23e
Other things a product model/series can be an instance of its instance, as in a unique ship and perhaps item describes the product unless are fine, functional classes are not, (Q21514702)abandoned project is fine, and project statuses like (Q207977)prototype
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 ?item ?itemLabel ?instance ?instanceLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
{
SELECT DISTINCT ?item ?instance WHERE {
{?item wdt:P279* wd:Q1184840}
{?item wdt:P31/wdt:P279* wd:Q10929058}
UNION {?item wdt:P31/wdt:P279* wd:Q811701}
?item wdt:P31 ?instance.
MINUS {
{?instance wdt:P279* wd:Q10929058}
UNION {?instance wdt:P279* wd:Q811701}
}
}
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?instance"):::projected
v1("?item"):::projected
a1((" "))
a2((" "))
c9(["wd:Q811701"]):::iri
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;"]):::literal
c6(["wd:Q1184840"]):::iri
c8(["wd:Q10929058"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"wdt:P279"--> c6
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c9
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c8
end
union0r <== or ==> union0l
end
v1 --"wdt:P31"--> v2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P279"--> c9
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P279"--> c8
end
union1r <== or ==> union1l
end
end