query-3de6cfb305449f04bb3f18c895fcdcb7

rq turtle/ttl

title:Types of object in the Khalili Collections (Islamic) with no Arabic name SELECT DISTINCT ?type ?typeLabel ?typeDescription ?typetypeLabel (SAMPLE(?image) as ?img) WHERE { VALUES ?coll {wd:Q66455355 wd:Q66458773} # Islamic Art and Hajj collection ?item wdt:P195 ?coll FILTER (?item NOT IN (wd:Q3114572, wd:Q109341408, wd:Q2997010, wd:Q108543136, wd:Q107663626) ).# Exclude objects in multiple collections ?item wdt:P18 ?image. ?item wdt:P31 ?type. OPTIONAL{ ?type wdt:P279 ?typetype}. FILTER NOT EXISTS {?type rdfs:label ?arabicLabel FILTER(lang(?arabicLabel) = "ar") } SERVICE wikibase:label { bd:serviceParam wikibase:language "ar,[AUTO_LANGUAGE],en". } } GROUP BY ?type ?typeLabel ?typeDescription ?typetypeLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Types of object in the Khalili Collections (Islamic) with no Arabic name
SELECT DISTINCT ?type ?typeLabel ?typeDescription ?typetypeLabel (SAMPLE(?image) as ?img) WHERE {
  VALUES ?coll {wd:Q66455355 wd:Q66458773} # Islamic Art and Hajj collection
  ?item wdt:P195 ?coll
  FILTER (?item NOT IN (wd:Q3114572, wd:Q109341408, wd:Q2997010, wd:Q108543136, wd:Q107663626) ).# Exclude objects in multiple collections
  ?item wdt:P18 ?image.
  ?item wdt:P31 ?type. OPTIONAL{ ?type wdt:P279 ?typetype}.
  FILTER NOT EXISTS {?type rdfs:label ?arabicLabel FILTER(lang(?arabicLabel) = "ar") }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ar,[AUTO_LANGUAGE],en". }
} GROUP BY ?type ?typeLabel ?typeDescription ?typetypeLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?arabicLabel") v4("?coll") v5("?image"):::projected v7("?img") v3("?item") v2("?type"):::projected v6("?typetype") c15(["ar,#91;AUTO_LANGUAGE#93;,en"]):::literal c13(["bd:serviceParam"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0f0[["?arabicLabel = 'ar'"]] e0f0 --> e0v1 e0v2 --"rdfs:label"--> e0v1 e0v1("?arabicLabel"):::projected e0v2("?type"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> v2 f0 --> c2 f1[["?arabicLabel = 'ar'"]] f1 --> v1 v2 --"rdfs:label"--> v1 f2[["?item != 'wd:Q3114572'?item != 'wd:Q109341408'?item != 'wd:Q2997010'?item != 'wd:Q108543136'?item != 'wd:Q107663626'"]] f2 --> v3 bind3[/VALUES ?coll/] bind3-->v4 bind30(["wd:Q66455355"]) bind30 --> bind3 bind31(["wd:Q66458773"]) bind31 --> bind3 v3 --"wdt:P195"--> v4 v3 --"wdt:P18"--> v5 v3 --"wdt:P31"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P279".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end bind5[/"sample(?image)"/] v5 --o bind5 bind5 --as--o v7