sparql-examples

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

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

156

rq turtle/ttl

Publisher aspect: editor photos

Use at

PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
#defaultView:ImageGrid

PREFIX target: <http://www.wikidata.org/entity/Q73820>

SELECT
  ?image
  ?editor ?editorLabel 
  ?venues
WITH {
  SELECT DISTINCT
    (SAMPLE(?image_) AS ?image)
    ?editor 
    (GROUP_CONCAT(?venue_label; separator=" // ") AS ?venues)
  WHERE {
    # Find editors for journals published by publisher
    ?venue_ wdt:P123 target: .
    ?venue_ wdt:P98 | wdt:P5769 ?editor .
    ?editor wdt:P18 ?image_ .
    OPTIONAL {
      ?venue_ rdfs:label ?venue_label . FILTER(LANG(?venue_label) = 'en')
    }
  }
  GROUP BY ?editor
} AS %result
WHERE {
  INCLUDE %result 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . } 
}

graph TD