query-a4a1ff899c162a75a9fe43a1824a131f

rq turtle/ttl

Authors of Commons files used as P18 in a masia item SELECT ?file ?username WITH { SELECT ?file WHERE { SERVICE https://query.wikidata.org/sparql { ?item wdt:P31 wd:Q585956. ?item wdt:P18 ?file. } } } AS %get_items WHERE { INCLUDE %get_items ?file (p:P170/pq:P4174) ?username. } LIMIT 1000

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
#Authors of Commons files used as P18 in a masia item
SELECT ?file ?username
WHERE {

{
  SELECT ?file 
  WHERE
  {
    SERVICE <https://query.wikidata.org/sparql>
    {
        ?item wdt:P31 wd:Q585956.
        ?item wdt:P18 ?file.
     } 
  }
}  ?file (p:P170/pq:P4174) ?username.
}
LIMIT 1000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?file"):::projected v1("?item") v3("?username"):::projected a1((" ")) c3(["wd:Q585956"]):::iri subgraph s1["https://query.wikidata.org/sparql"] style s1 stroke-width:4px; v1 --"p:direct/P31"--> c3 v1 --"p:direct/P18"--> v2 end v2 --"p:P170"--> a1 a1 --"p:qualifier/P4174"--> v3