sparql-examples

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

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

001

rq turtle/ttl

Lists universities with a Mastodon account.

Use at

PREFIX wd: <http://wikidata.org/entity/>
PREFIX wdt: <http://wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>

SELECT DISTINCT ?journal ?journalLabel ?mastodon WHERE {
  ?journal wdt:P31/wdt:P279* wd:Q3918 ;
    wdt:P4033 ?mastodon .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?journal"):::projected 
  v2("?mastodon"):::projected 
  a1((" "))
  c6(["bd:serviceParam"]):::iri 
  c3(["wd:Q3918"]):::iri 
  c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal 
  v1 --"wdt:P31"-->  a1
  a1 --"wdt:P279"-->  c3
  v1 --"wdt:P4033"-->  v2
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c6 --"wikibase:language"-->  c8
  end