[redland-dev] Creating additional storage hashes

Jason Johnston redland at lojjic.net
Thu May 15 11:48:55 BST 2003


I'm writing an application on top of Redland which often makes requests 
for *all* statements about a given resource, i.e. the Subject node is 
the only known node.  Currently the only way I can find to do this (in 
Perl) is $model->find_statements($subjectNode,null,null).  As I 
understand it, since the BDB hashes are indexed for when only *one* node 
is unknown, Redland has to traverse the entire database and do a 
comparison on each and every Statement to see if it matches.  Needless 
to say, this gets very slow with large storages.

The arcs_out C method would seem to be what I need, but if I follow the 
source correctly it just ends up doing the same thing anyway, because of 
the way the hashes are indexed.

So what I need is a s2po indexed BDB hash, but I have no idea how to go 
about creating such a thing.

I found the following passage in the section on Storage Modules (6.2) in 
the article "The Design and Implementation of the Redland RDF 
Application Framework" (http://www10.org/cdrom/papers/490/):

> There are other potentially useful hashes that might be maintained
> including incoming and outgoing arcs indexed for particular nodes.
> These choices might be suitable for an option on the storage hash or
> for user configuration of which statement parts are indexed. The
> current hash storage module has hooks for such a facility but no
> current interface to it.

I also remember reading something about enabling a p2so index as a 
configure option a while back, but can't find it now.

So... is there a simple way to create a s2po hash?  And, if not, is 
there a difficult way to create it? ;-)  I'm not opposed to modifying 
the C source to accomplish what I need.

Thanks in advance
--Jason




More information about the redland-dev mailing list