SPARQL Cheat Sheet
SPARQL Cheat Sheet
CHEAT SHEET
2
This Cheat Sheet was designed for the Exploring Opportunities of Linked Open Innovation Data workshop at NIPO. It allows the participants
to go through the exercises faster. The workshop is part of the IPLODB project. The IP LODB team gratefully acknowledges this work has
been co-sponsored by the Academic Research Programme of the European Patent Office. The research results and views contained inside
these materials or during the workshop are those of the researchers only. They do not necessarily represent the views of the EPO. We also
thank the NIPO and Nord University for their support for preparing and organizing this workshop event.
3
SELECT ?title
WHERE {
?pub <http://data.epo.org/linked-data/def/patent/titleOfInvention> ?title.
} LIMIT 100
4
CASE 3 :Connecting EPO and UNIPROT data EXAMPLE (PPT slide 19)
This query requires you to go to the UNIPROT SPARQL endpoint at https://sparql.uniprot.org/sparql/.
The query will connect UNIPROT and EP LOD data through patent citations in UNIPROT dataset and patent publication number and publication authority
in EPO dataset.
PREFIX patent:<http://data.epo.org/linked-data/def/patent/>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
PREFIX up:<http://purl.uniprot.org/core/>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
# ?UPatentPublication of format
# http://purl.uniprot.org/patents/EP0959131
BIND(SUBSTR(STR(?UPpatentPublication), 35) AS ?publicationNo)
BIND(SUBSTR(STR(?UPpatentPublication), 33, 2) AS ?publicationAuthority)
SERVICE<https://data.epo.org/linked-data/query>{
?EPOpublication patent:publicationNumber ?publicationNo;
patent:publicationAuthority/skos:notation ?publicationAuthority;
patent:application ?EPOapplication;
patent:inventorVC ?inventorVC.
?inventorVC vcard:fn ?inventorVCfn.
?EPOpublication patent:applicantVC ?applicantVC.
8
?applicantVC vcard:fn ?applicantFn.
OPTIONAL {
?EPOpublication patent:citationNPL ?citationNPL.
?citationNPL patent:citationText ?citationText.
}
}
} LIMIT 100