query-a7bb6664d985cac27abaadd67f06bd44

rq turtle/ttl

title:Objects related in some way to Shah Jahan SELECT DISTINCT ?property ?i ?object_name (SAMPLE(?obj_type) AS ?object_type) ?collection ?url WHERE { ?i wdt:P195 ?coll. ?i ?rel wd:Q83672 . ?i wdt:P31 ?type OPTIONAL {?i wdt:P973 ?url}. ?prop wikibase:directClaim ?rel ; a wikibase:Property SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?i rdfs:label ?object_name. ?coll rdfs:label ?collection. ?prop rdfs:label ?property. ?type rdfs:label ?obj_type} } GROUP BY ?i ?object_name ?collection ?property ?url ORDER BY ?property ?collection

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:Objects related in some way to Shah Jahan
SELECT DISTINCT ?property ?i ?object_name (SAMPLE(?obj_type) AS ?object_type) ?collection ?url WHERE {
?i wdt:P195 ?coll.
  ?i ?rel wd:Q83672 . ?i wdt:P31 ?type
OPTIONAL {?i wdt:P973 ?url}.
  ?prop wikibase:directClaim ?rel ; a wikibase:Property
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
         ?i rdfs:label ?object_name. ?coll rdfs:label ?collection.
         ?prop rdfs:label ?property. ?type rdfs:label ?obj_type}
} GROUP BY ?i ?object_name ?collection ?property ?url
ORDER BY ?property ?collection

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?coll") v2("?collection"):::projected v3("?i"):::projected v10("?obj_type"):::projected v9("?object_name"):::projected v11("?object_type") v8("?prop") v1("?property"):::projected v5("?rel") v6("?type") v7("?url"):::projected c2(["wd:Q83672"]):::iri c9(["bd:serviceParam"]):::iri c7(["wikibase:Property"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal v3 --"wdt:P195"--> v4 v3 -->v5--> c2 v3 --"wdt:P31"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P973".-> v7 end v8 --"wikibase:directClaim"--> v5 v8 --"a"--> c7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 v3 --"rdfs:label"--> v9 v4 --"rdfs:label"--> v2 v8 --"rdfs:label"--> v1 v6 --"rdfs:label"--> v10 end bind1[/"sample(?obj_type)"/] v10 --o bind1 bind1 --as--o v11