Project:SPARQL examples

SPARQL Queries

Get direct download links (P48) and corresponding bibItems

PREFIX iwb: <https://wikibase.inguma.eus/entity/>
PREFIX idp: <https://wikibase.inguma.eus/prop/direct/>
PREFIX ip: <https://wikibase.inguma.eus/prop/>
PREFIX ips: <https://wikibase.inguma.eus/prop/statement/>
PREFIX ipq: <https://wikibase.inguma.eus/prop/qualifier/>

select distinct ?download (group_concat(str(?wikibase_item);SEPARATOR="|") as ?items)
where {
  ?wikibase_item idp:P48 ?download .
 } group by ?download ?items

Try it!


Filter certain BibItems

Example: items of publisher "Uztaro" with INGUMA domain indicator "Politics"

PREFIX iwb: <https://wikibase.inguma.eus/entity/>
PREFIX idp: <https://wikibase.inguma.eus/prop/direct/>
PREFIX ip: <https://wikibase.inguma.eus/prop/>
PREFIX ips: <https://wikibase.inguma.eus/prop/statement/>
PREFIX ipq: <https://wikibase.inguma.eus/prop/qualifier/>

select ?wikibase_item (strafter(str(?wikibase_item),"https://wikibase.inguma.eus/entity/") as ?q_id)
where {
  ?wikibase_item idp:P5 iwb:Q8; # instance of: BibItem
                 idp:P37 iwb:Q13091; # argitaratzailea: Uztaro
                 idp:P59 iwb:Q13284. # INGUMA jakintza arloa: Politika
 }

Try it!