Done, see my own answer.
Question: How do I import RDF data into R? |
||
16
|
What approach are you using to import Resource Description Framework data into R? There is minimal support with the R package Rredland, but that seems rather spartanic. There was an interesting Rswub, but that was lost in time. I also noted Rsparql, but the project does not seem to have delivered anything yet. And, of course, I can do something manually... what are your best practices to use RDF data from, for example, Bio2RDF? |
|
8
|
I started a package for just this purpose yesterday. It is available from CRAN, as functionality is a bit limited today:
It is wrapping around Jena and using rJava to interface to it. There is in fact also a Bioconductor package called Rredland. Because the rrdf package now also supports SPARQL queries against remote databases, you can also do (following this BioStar answer):
As of version 1.4 you can also use on of the SPARQL variables as values for the row names. For example, to get a single column with the protein names as row names, you do:
Resulting in a R matrix like:
|
|
|
| ||
5
|
The following hints are all far from perfect, and will require some experimenting on your side, but here's my best guess (I got only worst practices for language interfaces, not for reading data from BioRDF):
I would maybe go for the SJava solution first because there at least four java libraries to chose from. I have had some mixed experiences with using language bindings, but in the end RSPerl and SJava worked with Perl and Java for me, and I heard that RPy works nicely too. So it should be possible in principle[?]TM[?] to access the libraries too. Whatever solution you come up with will likely be appreciated by the BioC community. |
|
nice we all Speak swedish RDF :D http://www.youtube.com/watch?v=9OfsABOGw3c&feature=related
Sorry, you lost me... Swedish RDF?
Your first link connects to the Swedish version of wikipedia. For the english version: http://en.wikipedia.org/wiki/Resource_Description_Framework
Oh, crap... OK, fixing... stupid, we're-so-smart-we-know-where-you-live websites... :(
Ah! Sorry about that; fixed now.