query-dc9c961c40fbddd75a6ca5208b810618

rq turtle/ttl

]reply[16:09, 22 September 2024 (UTC)) talk (Vicarage I turned this around to find actual planes - almost all of them are part of what appears to be a complete list of planes in the US Navy, with only the call number and type of plane given as useful information. If this is prevalent in Wikidata there is a reason why it is bursting at the seams.Vicarage@ ]reply[18:45, 22 September 2024 (UTC)) talk (Peter F. Patel-SchneiderWhat I do in these cases is write the query, look at the results, and then massage the output into a QuickStatements file to fix the noticed problems.

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?item ?itemLabel ?classLabel WHERE {
  {
    SELECT DISTINCT ?item ?class WHERE {
      ?item wdt:P31/wdt:P279* wd:Q216916.
      ?item wdt:P31 ?class. 
      ?item wdt:P31/wdt:P279* wd:Q11436.
 } }
     {?item wdt:P276 ?location} 
      UNION {?item wdt:P131 ?loc1}
      UNION {?item wdt:P426 ?reg}
      UNION {?item wdt:P195 ?collection}
      UNION {?item wdt:P625 ?loc2}
      UNION {?item wdt:P2598 ?serial}
      UNION {?item wdt:P576 ?destroyed}
 OPTIONAL { ?item rdfs:label ?itemLabel . FILTER ( lang(?itemLabel) = 'en' ) }
 OPTIONAL { ?class rdfs:label ?classLabel . FILTER ( lang(?classLabel) = 'en' ) }

Query found at