sparql-examples

A set of SPARQL examples that are used in different TGX resources

View the Project on GitHub BiGCAT-UM/sparql-examples

238

rq turtle/ttl

Work aspect: associated images

Use at

PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#defaultView:ImageGrid
PREFIX target: <http://www.wikidata.org/entity/Q28942417>

SELECT DISTINCT ?image WHERE {
  {
    # Images from whatever property value is linked.
    
    # Excluded "different from" property and take all other properties
    target: !wdt:P1889 ?item .

    ?item wdt:P18 ?image . 
  }
}   

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?image"):::projected 
  v1("?item")
  a1((" "))
  c2([http://www.wikidata.org/entity/Q28942417]):::iri 
  f0[[" != 'p:direct/P1889'"]]
  f0 --> a1
  c2 -->a1--> v1
  v1 --"p:direct/P18"-->  v2