query-00baf42d5e6cc0f24a7c5df0dc59847a
merging the firearm_model, model_series, family etc into weapon_model, series, family for consistency, so you have a matrix of 21 types (Q19287541)combat aircraft and (Q64418)artillery and adding (Q974850)missile , (Q165363)torpedo , (Q185785)ammunition , (Q4009273)combat vehicle , (Q12796)firearm across its uses for (Q15142889)weapon family , and (Q115044473)weapon model series , (Q15142894)weapon model I've been sorting out the weapon model/series/family system, and dutifully followed the existing 3 level system
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 ?ismetaclassLabel ?metasubclassLabel ?instanceLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en". }
?item wdt:P31 ?instance. VALUES ?instance {wd:Q24027474 wd:Q24017465 wd:Q24017414}
?item wdt:P279/wdt:P2670 wd:Q728.
OPTIONAL {?item wdt:P8225 ?ismetaclass}
OPTIONAL {?item wdt:P2445 ?metasubclass}
OPTIONAL {?item wdt:P31 ?instance}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?instance")
v3("?ismetaclass")
v1("?item"):::projected
v4("?metasubclass")
a1((" "))
c2(["bd:serviceParam"]):::iri
c4(["en-GB,en"]):::literal
c8(["wd:Q728"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"wdt:P31"--> v3
bind0[/VALUES ?instance/]
bind0-->v3
bind00(["wd:Q24027474"])
bind00 --> bind0
bind01(["wd:Q24017465"])
bind01 --> bind0
bind02(["wd:Q24017414"])
bind02 --> bind0
v1 --"wdt:P279"--> a1
a1 --"wdt:P2670"--> c8
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P8225".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2445".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P31".-> v3
end