sparql-examples

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

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

NXQ_09629

rq turtle/ttl

Check there are no entries in the Ion channels variants portal that do not have a variant phenotype annotation

Use at

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

select distinct ?entry where {
  values ?gene
  {"SCN1A" "SCN2A" "SCN3A" "SCN4A" "SCN5A" "SCN8A" "SCN9A" "SCN10A" "SCN11A"} # space-separated

  ?entry :gene / :name / rdfs:label ?genename .
  bind (str(?genename) as ?gn) # here we convert "xxx"^^xsd:string to "xxx" to match the values
  filter(?gn = ?gene)
  filter not exists {?entry :isoform /:proteoform /:phenotypicVariation ?phenotype} # No phenotype annotation
}
:isoform
:proteoform
:phenotypicVariation
:gene
:name
rdfs:label
as
EXISTS
Exists Clause
:isoform
:proteoform
:phenotypicVariation
?entry
?phenotype
?entry
?genename
?gn
?phenotype
not
c1
c2
c3
?gn = ?gene
VALUES ?gene
SCN1A
SCN2A
SCN3A
SCN4A
SCN5A
SCN8A
SCN9A
SCN10A
SCN11A
str(?genename)