Closed ryankohl closed 13 years ago
It would indeed... I have been wanting this for another project I work on (Bioclipse) too... I have to experiment a bit with that, but not sure when I get around to it... a patch is most welcome (by anyone) to start playing with this idea!
I think I've got the two snippets that need to be added:
RJenaHelper.java public static Model construct(Model model, String queryString) throws Exception { Model result= null; Query query= QueryFactory.create(queryString); PrefixMapping prefixMap= query.getPrefixMapping(); QueryExecution qexec= QueryExecutionFactory.create(query, model); try { result= qexec.execConstruct(); } finally { qexec.close(); } return result; }
load.rdf.R : construct.rdf <- function(model, sparql) { newModel <- .jcall( "com/github/egonw/rrdf/RJenaHelper", "Lcom/hp/hpl/jena/rdf/model/Model", "construct", model, sparql ) exception <- .jgetEx(clear = TRUE) if (!is.null(exception)) { stop(exception) } return(newModel) }
Not sure how I go about re-building the project..would a jar that I build point to com/github/ryankohl/rrdf/RJenaHelper in load.rdf.R instead of com/github/egonw/rrdf/RJenaHelper?
The README.md should give the full howto compile from source:
https://github.com/egonw/rrdf/blob/master/README.md
Can you give that a try?
If you have not got the git repository checked out, prepend the compile commands with:
git clone git://github.com/egonw/rrdf.git cd rrdf
Egon
I'll try to incorporate this now...
Terrific! Thanks for doing the merge - I've been swamped lately.
It would be nice if there was support for Sparql Construct statements in the library, so that graphs could be extracted, fiddled with, and merged together.