[redland-dev] querying using bNodes (blank nodes)

Richard Newman r.newman at reading.ac.uk
Wed May 23 05:34:50 BST 2007


> I don't want an identifier that persists across sessions, but I do  
> want an identifier that is persistent between queries in the same  
> session.
>
> So consider my use case - I am querying OWL layered on RDF. First  
> of all, if I'm consuming OWL documents it isn't up to me to use a  
> URI rather than bNodes, it's up to the provider, and *nobody*  
> provides URIs for anonymous class expressions in OWL.
>
> It's not uncommon for OWL documents to have multiply nested class  
> expressions - bnodes to arbitrary depth.

Yes, it's one of the things about OWL that makes multiple consecutive  
queries difficult. Each succeeding query must reference earlier  
results by description.

>>   You can only reference blank nodes by description (at least in  
>> SPARQL). If "by description" is too slow, don't use bnodes.
>
> Note that I said it was using $node->blank_identifier in RDQL that  
> was too slow. If I am willing to live with this penalty, should I  
> continue to use this method? It worries me because it's  
> undocumented behaviour.

I won't speak for Dave -- it ain't my library! -- but it looks  
stable, albeit undocumented.

Of course, you're then stuck with RDQL, and can never move your  
queries to SPARQL (unless you implement an extension function... but  
that's probably going to be less efficient than reference-by- 
description).

> If not my only other alternative is to query (?s ?p ?o) into a big  
> hash and simply do the graph traversal and matching in perl

That's kinda sad, though: you could at least use Redland's raw API to  
do the work. Perl doesn't scale.


More information about the redland-dev mailing list