I have a new blog!

File based RDF storage in Pellet, first tests

As reported in a previous blog post, I ran into java stacksize errors when importing large amounts of data into pellet. Pellet was using just the in-memory Jena RDF store, which obviously puts limits on the amount of data it can handle.

Jena offers other options for RDF storage though, including SDB for SQL backends, and TDB for a pure Java file based storage.

Initial performance comparison: Pellet vs Prolog in Bioclipse

I started with some initial performance testing for RDF data, between pellet an prolog, which are now both available integrated in Bioclipse.

Bioclipse manager method to take arbitrary number of arguments

I needed a Bioclipse manager method that could take an arbitrary number of arguments, (for a general purpose prolog method mapper). Through a useful discussion with jonalv, we figured out that there exists at least one working way of doing this, while there are a number of ways that do not work across both the Rhino/JavaScript though they work in Java alone.

Catching up on NMR Spectroscopy

Looking into some NMR usecases for my project, I realize my knowlegde from the Organic Chemistry course some four years ago has quite much faded away. Luckily I found this excellent NMR intro lecture on YouTube:

Tags:

A usage strategy emerges

A strategy for how to work with the Bioclipse/JPL/Prolog/Blipkit combination I'm setting up, is becoming clear.

The main idea with Bioclipse, as well as with having a prolog engine available in it, is for flexible and "interactive" knitting together of knowledge. One of the main questions regarding how to use a Bioclipse/JPL/Prolog/Blipkit combination, has been where to put the bulk of knowledge integration/reasoning code? There would in principle be three options for that:

  1. Bioclipse (Javascript environment)
  2. The Blipkit-Prolog/Bioclipse integration plugin (Java code, a.k.a. "Manager methods")
  3. The prolog engine (As a prolog file)

Problems to solve

These are a few technical (and other types) of problems that I'm now realizing I will have to solve, sooner or later:

  • How to output data? As array/N3/RDF?
  • Output everything, or only one solution at a time? (Use flags, for different options?)
  • How to indicate that a number should be treated as a literal? (For now I'm using the following syntax: [00.0], but it might clash with other uses of the same character.
  • Make IFile searchpaths resolvable to full paths, which Prolog can read.
  • How to output if you are using more than one variable in a prolog expression? (Multiple arrays?, Multidimensional arrays?).

Converting RDF predicates to Prolog convenience methods with RegEx

Using SWI-Prolog's semweb package, I had extracted all predicates in a RDF source, containing some 1 million triples, into the following list:

How to deal with rdf namespaces (does not work well with JPL)

I had the problem that in JPL (The java Prolog API) you cannot use namespaces before term (atoms or variables etc.) names, like so:

prologFunction( ns:'atom' ).

The best solution would be to have some kind of "namespace-like" support in the JS console of Bioclipse instead. One easy thing one can do is to just create a simple function that appends the long preceding URL, so a JS Example could be:

function molid ( term ) {
  return "http://pele.farmbio.uu.se/nmrshiftdb/?moleculeId=" + term;
}
blipkit.queryRDF(molid("234"),"X","Y");

Solved problem with using rdf_db (to load RDF data) from Bioclipse

I had problems executing rdf_db from inside Bioclipse, but was getting problems similar to this one:

Running JavaScript...
org.mozilla.javascript.WrappedException: Wrapped java.lang.RuntimeException: Failed to run method (line: #9)
 jpl.PrologException: PrologException: error(existence_error(procedure, /(rdf_load, 1)), context(:(system, /('$c_call_prolog', 0)), _0))
JavaScript done.

This was solved by adding the following line to the blipstart.pl file:

:- use_module(library('semweb/rdf_db')).

So the last part of the file now looks like:

.

Nice intro to RDF in Prolog (by Pellet author)

I found a nice introduction to the use of RDF in Prolog (SWI-Prolog). It contains short primers for both RDF and Prolog, so it should be accessible to anyone with a minimal programming background: