This implements an RdfRepository plugin for bel.rb using Apache Jena' TDB Storage. This plugin relies on rdf-jena to interface with Apache Jena as an RDF.rb repository.
- Plugs in rdf-jena as an Rdf Repository plugin.
rdf-jena
executable that allows creation of Apache Jena TDB database.
- JRuby 1.7 or 9k series (due to rdf-jena).
First install the gem using:
gem install bel-rdf-jena
Now the plugin is installed and can be used by bel.rb.
This gem includes an executable that can create an RDF database (Apache Jena TDB) from one or more RDF files.
You will have the bel-rdf-jena
executable available to you (i.e. on your PATH
) once you install this gem. Keep in mind that you may have to add $GEM_HOME/bin
to your PATH
to pick up installed executables.
Now to create an Apache Jena TDB database provide a directory and one or more.
Example:
bel-rdf-jena --dir /opt/data/resources_rdf --file biological-concepts-rdf.ttl
Note: It may take a while to load your RDF data. Apache Jena does a good job of balancing performance and memory allocation. You can increase memory allocation for the process by specifying the -J-Xmx4g
(i.e. max heap size of 4 Gb) option in JRUBY_OPTS
.
Example:
JRUBY_OPTS="-J-Xmx4g" bel-rdf-jena --dir /opt/data/resources_rdf --file biological-concepts-rdf.ttl
Tip: For the biological-concepts-rdf.ttl
file found on the OpenBEL build server try setting this to -J-Xmx4g
or -J-Xmx8g
if possible.
bel.rb provides an approach to plugins that is meant to be uncomplicated. The following steps will get you started:
- Build gem with
gem build .gemspec
and install withgem install bel-rdf-jena-0.4.0.beta1-java.gem
. - Now you have this plugin installed and ready for use in bel.rb!
- With bel.rb installed run the command
bel plugins
to list available plugins.
$ bel plugins
RDF Repository plugins
----------------------
Name: Apache Jena RDF Repository
Description: A repository of RDF data on Apache Jena using TDB storage.
- To create the search implementation in Ruby try:
rdf_jena_plugin = BEL::RdfRepository.plugins[:jena]
rdf_jena_plugin.create_repository(:tdb_directory => 'data')
- Enjoy access to RDF datasets through Apache Jena!
-
master branch
- Contains stable code. Releases are created from this branch using a tag (e.g.
MAJOR.MINOR.PATCH
).
- Contains stable code. Releases are created from this branch using a tag (e.g.
-
next branch
- Contains unstable code. Commits should be merged into master after it stabilizes.
Releases of bel-rdf-jena should follow these steps:
-
Update the version in the
VERSION
file. -
Add changes for this version to the
CHANGELOG
file. This file is modelled after http://keepachangelog.com/. -
Push the changes for
VERSION
andCHANGELOG
on the master branch. -
Ensure the master branch has all of the required changes.
-
Create a git tag, named after the version, on the master branch. Push this tag to GitHub.
-
Create the Ruby and Java RubyGem for bel-rdf-jena.
gem build .gemspec
-
Create a release on GitHub for this version and attach the gem file.
-
Push gems to RubyGems.
gem push bel-rdf-jena-VERSION-java.gem