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_00223

100 most-cited publications in neXtProt and the corresponding number of associated entries

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX db: <http://nextprot.org/rdf/db/>

select (str(?publiid) as ?PMID) (str(?tt) as ?title) (count(distinct ?entry) as ?ecnt)
where {
 ?entry a :Entry .
 ?entry :reference ?ref .
 ?ref a :Publication.
 ?ref :title ?tt .
 ?ref :from ?xref .
 ?xref :accession ?publiid .
 ?xref :provenance db:PubMed .
}
group by ?publiid ?tt
order by desc(?ecnt)
limit 100
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v7("?PMID")
  v9("?ecnt")
  v2("?entry"):::projected 
  v6("?publiid"):::projected 
  v3("?ref")
  v8("?title")
  v4("?tt"):::projected 
  v5("?xref")
  c4([":Publication"]):::iri 
  c2([":Entry"]):::iri 
  c9([":db/PubMed"]):::iri 
  v2 --"a"-->  c2
  v2 --":reference"-->  v3
  v3 --"a"-->  c4
  v3 --":title"-->  v4
  v3 --":from"-->  v5
  v5 --":accession"-->  v6
  v5 --":provenance"-->  c9
  bind1[/"str(?publiid)"/]
  v6 --o bind1
  bind1 --as--o v7
  bind2[/"str(?tt)"/]
  v4 --o bind2
  bind2 --as--o v8
  bind3[/"count(?entry)"/]
  v2 --o bind3
  bind3 --as--o v9