Jump to content

SPARQL examples

Revision as of 07:55, 26 April 2023 by Admin (talk | contribs)

This page is automatically parsed by the query page to provide examples.

Simple Queries

Complete Dependency Graph

{{#widget:SPARQLquery|code=

  1. defaultView:Graph

PREFIX grt: <https://graphit.ur.de/prop/direct/> SELECT ?item ?itemLabel ?class ?classLabel ?image ?dependency ?dependencyLabel WHERE {

 ?item grt:P1 ?dependency.
 ?item grt:P2 ?class
 OPTIONAL{ ?item grt:P9 ?image.}
 OPTIONAL{ ?class grt:P9 ?image.}
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

} }}

Topics that Max Mustermann has completed

{{#widget:SPARQLquery|code=

  1. defaultView:Timeline

PREFIX gr: <https://graphit.ur.de/entity/> PREFIX grs: <https://graphit.ur.de/entity/statement/> PREFIX grv: <https://graphit.ur.de/value/> PREFIX grt: <https://graphit.ur.de/prop/direct/> PREFIX p: <https://graphit.ur.de/prop/> PREFIX ps: <https://graphit.ur.de/prop/statement/> PREFIX pq: <https://graphit.ur.de/prop/qualifier/> SELECT ?topic ?topicLabel ?image ?date WHERE {

 BIND(gr:Q157 as ?user).
 ?user p:P12 ?statement.
 ?statement ps:P12 ?topic.
 ?statement pq:P19 ?date.
 OPTIONAL{ ?topic grt:P11 ?image.}
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

} }}