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

Seaborne, Andy andy.seaborne at hp.com
Wed May 23 17:00:10 BST 2007


-------- Original Message --------
> From: Richard Newman <>
> Date: 23 May 2007 05:35
> 
> > 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.

Some systems allow <_:abcd> for directly referencing blank nodes, making
it look like a real name for something.  Sometimes the app has to deal
directly with the actual blank node graph node.

	Andy


More information about the redland-dev mailing list