A set of SPARQL examples that are used in different SIB resources
Find the co-occurence count of topological domain comment text in UniProtKB entries
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT
?comment1
?comment2
(COUNT(?comment1) AS ?count1)
WHERE
{
?protein a up:Protein ;
up:annotation ?annotation1 ,
?annotation2 .
?annotation1 rdf:type up:Topological_Domain_Annotation ;
rdfs:comment ?rawComment1 .
?annotation2 rdf:type up:Topological_Domain_Annotation ;
rdfs:comment ?rawComment2 .
BIND(IF(contains(?rawComment1, ';'),
STRBEFORE(?rawComment1,';'),
?rawComment1) AS ?comment1)
BIND(IF(contains(?rawComment2, ';'),
STRBEFORE(?rawComment2,';'),
?rawComment2) AS ?comment2)
FILTER(?annotation1 != ?annotation2)
}
GROUP BY ?comment1 ?comment2
ORDER BY DESC(COUNT(?comment1))