Project:Secondary Type Query

From DiSSCo Modelling Framework
Revision as of 10:06, 30 August 2022 by Jgrieb (talk | contribs)
Jump to navigation Jump to search
SELECT ?item ?conceptName ?itemLabel ?itemDescription ?example ?dataType ?min ?max ?mandatory WHERE {
 #the type to export is ImageObject but can also be applied to other types (change "wd:Q45")
 BIND(wd:Q45 as $type).


 #get all contains statements
 ?type wdt:P14?/p:P44 ?statement.
 ?statement ps:P44 ?item.
 OPTIONAL{
   ?statement pqv:P9/wikibase:quantityAmount ?mandatoryInternal.      
 }

 #additional optional properties
 OPTIONAL {?item wdt:P26 ?conceptName}
 OPTIONAL {?item wdt:P18 ?example}
 OPTIONAL {?item wdt:P10 ?dataType}
 OPTIONAL {?item wdt:P37 ?min}
 OPTIONAL {?item wdt:P38 ?max}
 BIND(IF(BOUND(?mandatoryInternal),?mandatoryInternal,"0") AS ?mandatory)
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }

}ORDER BY ?order