SPARQL examples for the EMI
View the Project on GitHub earth-metabolome-initiative/sparql-examples
Use the CORDIS EURIO Knowledge Graph in combination with UniProt to find the count of outputs(DOIs) of their funded projects cited in UniProt.
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX eurio: <http://data.europa.eu/s66#>
PREFIX patent: <http://purl.uniprot.org/EPO/>
PREFIX pubmed: <http://purl.uniprot.org/pubmed/>
SELECT
(IRI(CONCAT('https://cordis.europa.eu/project/id/', SAMPLE(?identifier))) AS ?id)
(SAMPLE(?project_title) AS ?project_titles)
(COUNT(DISTINCT ?doi_string) AS ?doisInSwissProt)
(COUNT(DISTINCT ?protein) AS ?entriesInSwissProt)
WHERE {
SERVICE <https://cordis.europa.eu/datalab/sparql> {
?project a eurio:Project ;
eurio:identifier ?identifier ;
eurio:title ?project_title ;
eurio:hasResult ?result .
?result eurio:doi ?doi .
}
#EURIO use literals of type xsd:anyURI to represent DOIs
#without the leading doi: indicator
BIND(CONCAT("doi:", STR(?doi)) AS ?doi_string)
?citation a up:Journal_Citation ;
dcterms:identifier ?doi_string .
?protein up:citation ?citation .
BIND(xsd:int(?identifier) AS ?intid)
} GROUP BY ?project ORDER BY DESC(?intid)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?citation")
v6("?doi")
v7("?doi_string"):::projected
v12("?doisInSwissProt")
v13("?entriesInSwissProt")
v10("?id")
v3("?identifier")
v10("?intid")
v2("?project")
v4("?project_title"):::projected
v11("?project_titles")
v9("?protein"):::projected
v5("?result")
c8(["up:Journal_Citation"]):::iri
c3([http://data.europa.eu/s66#Project]):::iri
subgraph s1["https://cordis.europa.eu/datalab/sparql"]
style s1 stroke-width:4px;
v2 --"a"--> c3
v2 --http://data.europa.eu/s66#identifier--> v3
v2 --http://data.europa.eu/s66#title--> v4
v2 --http://data.europa.eu/s66#hasResult--> v5
v5 --http://data.europa.eu/s66#doi--> v6
end
bind0[/"concat('doi:',str(?doi))"/]
v6 --o bind0
bind0 --as--o v7
v8 --"a"--> c8
v8 --"dcterms:identifier"--> v7
v9 --"up:citation"--> v8
bind1[/"http://www.w3.org/2001/XMLSchema#int(?identifier)"/]
v3 --o bind1
bind1 --as--o v10
bind6[/"concat('https://cordis.europa.eu/project/id/',)"/]
null --o bind6
bind6 --as--o v10
bind7[/"sample(?project_title)"/]
v4 --o bind7
bind7 --as--o v11
bind8[/"count(?doi_string)"/]
v7 --o bind8
bind8 --as--o v12
bind9[/"count(?protein)"/]
v9 --o bind9
bind9 --as--o v13