[openbiblio-dev] [4store] Blank nodes in SPARQL and rewriting of blank node names

Steve Harris s.w.harris at gmail.com
Fri Jul 30 13:59:38 UTC 2010


"Blank nodes" in SPARQL work like variables.

However, there's a getout in 4store, so if you get _:b1234 back as a "bNode identifier", you can pass in the psuedo-URI <bnode:b1234>, and that will match the "concrete" bNode. N.B. this is not a standard SPARQL feature, and it's not portable.

Sorry, there's a lot of "scare quotes", but this is a very murky area of RDF :)

I think mostly what you've found is that working with bNodes in RDF is tricky (due to their definition, their existential variables technically speaking), and probably an ASK bug in 4store. There is a known issue with ASK in this area.

The existential variable thing means that the

_:b1: a Lamb .
_:b1 size little .

_:b2 a Lamb .
_:b2 size little .

in your example, has the same meaning as

_:b3 a Lamb .
_:b3 size little .

I know that's not helpful though.

I've wanted to add a mode to 4store where all "concrete" bNodes are returned as bnode: URIs, but I've not quite had the nerve to do it.

- Steve
 
On 2010-07-30, at 11:40, William Waites wrote:

> More detail in the ticket here:
>    http://knowledgeforge.net/pdw/trac/ticket/121
> 
> But briefly I think I have discovered one bug and one implementation
> choice that may be slightly problematic.
> 
> The bug is that when blank nodes (as opposed to variables) appear in
> a SPARQL query they seem to behave differently depending on if they
> appear in the subject or object position (haven't investigated predicates).
> I think a blank node in the object position behaves like a variable and
> in the subject position it behaves like a concrete thing. I think it should
> behave concretely in both cases but am not sure.
> 
> The implementation choice has to do with reassigning blank node
> identifiers which means that if I have a graph in my program in
> memory that contains blank nodes, and I persist it in the store, I
> can't use my memory copy to build queries that involve the blank
> node identifiers against the store.
> 
> Thoughts,
> -w
> 
> -- 
> William Waites <wwaites at gmail.com>
> Mob: +44 789 798 9965
> Fax: +44 131 464 4948
> 
> -- 
> You received this message because you are subscribed to the Google Groups "4store-support" group.
> To post to this group, send email to 4store-support at googlegroups.com.
> To unsubscribe from this group, send email to 4store-support+unsubscribe at googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/4store-support?hl=en.
> 





More information about the openbiblio-dev mailing list