sparql-examples

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

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

NXQ_00272

rq turtle/ttl

Proteins involved in coronaviruses/SARS-CoV-2 pathways with associated medical information

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?entry (str(?gen) AS ?gene) ?pathwayname (str(?discom) AS ?discom1) ?medsource WHERE {
 SERVICE <http://sparql.wikipathways.org/sparql> {
 {?geneProduct a wp:Protein}
 union
 {?geneProduct a wp:GeneProduct}

 ?geneProduct rdfs:label ?genraw .
 bind (concat( ""^^xsd:string, ?genraw) as ?gen).
 filter(!regex(?gen,"[ a-z-]")). # ensures official gene names for subsequent neXtprot matching

 ?geneProduct dcterms:isPartOf ?pathway .
 ?pathway a wp:Pathway .
 ?pathway wp:organism ?organism .
 filter(contains(str(?organism),"9606"))

 ?pathway dcterms:title ?pathwayname .
 filter(regex(?pathwayname,"sars-cov-2","i")|| regex(?pathwayname,"corona","i") ).
 }

 ?entry a :Entry .
 ?entry :gene / :recommendedName / rdfs:label ?gen .
 ?entry :isoform ?iso.
 ?iso :medical ?med.
 ?med rdfs:comment ?discom.
 ?med :evidence/:assignedBy ?medsource.
}
order by ?entry
http://sparql.wikipathways.org/sparql
Union
a
a
rdfs:label
as
dcterms:isPartOf
a
wp:organism
dcterms:title
a
:gene
:recommendedName
rdfs:label
:isoform
:medical
rdfs:comment
:evidence
:assignedBy
as
as
or
(regex(?pathwayname,'sars-cov-2','i') || regex(?pathwayname,'corona','i'))
?pathwayname
contains(str(?organism),'9606')
?organism
not regex(?gen,'[ a-z-]')
?pathway
?genraw
concat('',?genraw)
wp:Pathway
wp:Protein
wp:GeneProduct
?geneProduct
?discom
?discom1
?entry
?gene
?iso
?med
?medsource
:Entry
str(?gen)
str(?discom)