Code Snippets SPARQL

Short texts SPARQL 🧑‍💻 Code snippets SPARQL ✍️ Reading lists SPARQL 👀

RRC types and coin count from 99-74 BCE

PREFIX crm: PREFIX dcmitype: PREFIX dcterms: PREFIX foaf: PREFIX geo: PREFIX nm: PREFIX nmo: PREFIX org: PREFIX rdf: PREFIX rdfs: PREFIX skos: PREFIX xsd: SELECT ?type ?date (count(?coin) as ?count) WHERE { ?type a nmo:TypeSeriesItem ; dcterms:source nm:rrc ; nmo:hasStartDate ?date FILTER (?date >= “-0099″^^xsd:gYear && ?date

query_in_sparql.rq

PREFIX : SELECT ?personName where { ?person :name ?personName. ?person :livesIn / :within* / :name “Gujrat”. ?person :worksIn / :within* / :name “Tiger Softwares”. }

Get pages annotated in SITNAM

PREFIX crm: PREFIX dcmitype: PREFIX dcterms: PREFIX foaf: PREFIX geo: PREFIX nm: PREFIX nmo: PREFIX org: PREFIX rdf: PREFIX rdfs: PREFIX skos: PREFIX xsd: PREFIX prov: PREFIX void: SELECT DISTINCT ?type ?str WHERE { ?coin void:inDataset ; nmo:hasTypeSeriesItem ?type ; nmo:hasObverse/foaf:depiction ?image . BIND(REPLACE(str(?image), “.*(schaefer.*).jpg/.*$”, “$1”) AS ?str) }

Relationship between Douris and other Greek artists

PREFIX crm: PREFIX crmgeo: PREFIX crmsci: PREFIX dcterms: PREFIX foaf: PREFIX geo: PREFIX kid: PREFIX kon: PREFIX org: PREFIX rdf: PREFIX skos: PREFIX xsd: SELECT DISTINCT ?artist ?name (GROUP_CONCAT(DISTINCT ?roleLabel; separator=”/”) as ?roles) (count(?object) as ?count) WHERE { ?object crm:P108i_was_produced_by/crm:P9_consists_of/crm:P14_carried_out_by kid:douris ; crm:P108i_was_produced_by/crm:P9_consists_of/crm:P14_carried_out_by ?artist FILTER (?artist != kid:douris) . ?artist skos:prefLabel ?name FILTER (langMatches(lang(?name), “en”)) […]

cell subset

PREFIX rdfs: SELECT DISTINCT ?term WHERE { { ?term rdfs:subClassOf* . } FILTER(isIRI(?term)) }