dlmcguinness / redrugs

Repurposing Drugs Using Semantics
MIT License
6 stars 5 forks source link

Creating nanopublications from Bio2RDF data #3

Open micheldumontier opened 10 years ago

micheldumontier commented 10 years ago

Hi Ray, here is an example sparql query to construct a nanopublication from source data:

Nanopublications construction QUERY: PREFIX np: http://www.nanopub.org/nschema# PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX sio: http://semanticscience.org/resource/ PREFIX xsd: http://www.w3.org/2001/XMLSchema# PREFIX void: http://rdfs.org/ns/void# PREFIX ncit: http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl# PREFIX foaf: http://xmlns.com/foaf/0.1/ PREFIX pav: http://purl.org/pav/2.0/ PREFIX prv: http://purl.org/net/provenance/ns# PREFIX prov: http://www.w3.org/ns/prov# PREFIX dctypes: http://purl.org/dc/dcmitype/

INSERT { GRAPH http://rdf.disgenet.org/nanopub/test1 { ?nanopub a np:Nanopublication . ?nanopub np:hasAssertion ?assertionGraph . ?assertionGraph a np:Assertion . ?nanopub np:hasProvenance ?provenanceGraph . ?provenanceGraph a np:Provenance . ?nanopub np:hasPublicationInfo ?publicationInfoGraph . ?publicationInfoGraph a np:PublicationInfo . } GRAPH ?assertionGraph { ?association a sio:SIO_000983 . ?association sio:SIO_000628 ?gene . ?gene a ncit:C16612 . ?association sio:SIO_000628 ?disease . ?disease a ncit:C7057 . } GRAPH ?provenanceGraph { ?assertionGraph sio:SIO_000772 ?pubmed . ?assertionGraph sio:SIO_000253 ?source . ?source rdfs:comment ?curation . ?assertionGraph dcterms:description ?sentence .

} GRAPH ?publicationInfoGraph { ?nanopub pav:authoredBy http://orcid.org/0000-0003-0169-8159 ; dcterms:created ?now ; pav:createdBy http://orcid.org/0000-0003-0169-8159 ; dcterms:rights http://opendatacommons.org/licenses/odbl/1.0/ ; dcterms:rightsHolder http://ibi.imim.es/ ; prv:usedData ?dgnTitle ; pav:version ?dgnVersion . } } USING http://rdf.disgenet.org/ WHERE { ?type rdfs:subClassOf+ sio:SIO_000983 . ?association a ?type . ?association sio:SIO_000628 ?gene . ?gene a ncit:C16612 . ?association sio:SIO_000628 ?disease . ?disease a ncit:C7057 . ?association sio:SIO_000772 ?pubmed . ?association sio:SIO_000253 ?source . ?source rdfs:comment ?curation . ?association dcterms:description ?sentence . ?disgenet rdf:type dctypes:Dataset . ?disgenet dcterms:title ?dgnTitle . filter regex(?dgnTitle, "^DisGeNET") ?disgenet pav:version ?dgnVersion . BIND(iri(concat(str(?association),"_nanopub")) as ?nanopub) BIND(iri(concat(str(?nanopub),"_assertion")) as ?assertionGraph) BIND(iri(concat(str(?nanopub),"_provenance")) as ?provenanceGraph) BIND(iri(concat(str(?nanopub),"_publicationInfo")) as ?publicationInfoGraph) BIND(NOW() as ?now) }

micheldumontier commented 10 years ago

we'll want sparql queries for each of the source datasets, and put this in the code repo in a new folder "nanopublication"

micheldumontier commented 10 years ago

Imported the drugbank sparql query here a98fa136362b1d35b50962f2c41942cc6212ac19