sparql-examples

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

View the Project on GitHub sib-swiss/sparql-examples

neXtProt/NXQ_00131

Terms of controlled vocabularies containing some word(s)

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT * WHERE {
 ?term rdfs:label ?label ; a ?type .
 # ---------------------------
 # exact match
 # ---------------------------
 filter(?label = "peroxisome"^^xsd:string)

 # ---------------------------
 # starting with peroxisome
 # ---------------------------
 # filter(regex(?label,"^peroxisome"))

 # ---------------------------
 # containing peroxisome
 # ---------------------------
 # filter(regex(?label,"peroxisome"))

 # ------------------------------------
 # containing peroxisome and receptor
 # ------------------------------------
 # filter(regex(?label,"peroxisome.*receptor"))
} limit 20
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?label"):::projected 
  v2("?term"):::projected 
  v3("?type"):::projected 
  f0[["?label = 'peroxisome'"]]
  f0 --> v1
  v2 --"rdfs:label"-->  v1
  v2 --"a"-->  v3