Skip to content

@egonw /chebi mashup.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var ons = rdf.createStore()
// output: RDFStore: 0 triples
rdf.importURL(ons,
"http://github.com/egonw/onssolubility/raw/master/ons.solubility.rdf/ons.rdf")
// output: RDFStore: 1206 triples
var results = rdf.sparql(ons, "PREFIX owl: <http://www.w3.org/2002/07/owl#> " +
"PREFIX ons: <http://spreadsheet.google.com/plwwufp30hfq0udnEmRD1aQ/onto#> " +
"SELECT DISTINCT ?same WHERE { " +
" ?solvent a ons:Solvent . " +
" ?solvent owl:sameAs ?same" +
"}"
)
for (i=0; i<results.size(); i++) {
var row = results.get(i);
for (j=0; j<row.size(); j++) {
// use the owl:sameAs to find more triples
var uri = row.get(j);
print("Adding " + uri + "...\n");
rdf.importURL(ons, uri);
}
}
rdf.sparql(ons, "PREFIX owl: <http://www.w3.org/2002/07/owl#> " +
"PREFIX ons: <http://spreadsheet.google.com/plwwufp30hfq0udnEmRD1aQ/onto#> " +
"PREFIX rdfonm: <http://rdf.openmolecules.net/#> " +
"PREFIX dc: <http://purl.org/dc/elements/1.1/> " +
"SELECT DISTINCT ?title ?chebi WHERE { " +
" ?solvent a ons:Solvent . " +
" ?solvent dc:title ?title . " +
" ?solvent owl:sameAs ?same ." +
" ?same rdfonm:chebiid ?chebi" +
"}"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.