W3C home > Mailing lists > Public > public-rdf-comments@w3.org > June 2013

Re: bNodes as graph identifiers

From: Steve Harris <steve.harris@garlik.com>
Date: Mon, 3 Jun 2013 12:55:09 +0100
Cc: <public-rdf-comments@w3.org>
Message-Id: <23699691-0E12-4539-9510-CEFDF5C75254@garlik.com>
To: "Markus Lanthaler" <markus.lanthaler@gmx.net>
On 2013-06-03, at 12:22, "Markus Lanthaler" <markus.lanthaler@gmx.net> wrote:

> On Monday, June 03, 2013 12:45 PM, Steve Harris wrote:
>>>>> Right. Expecting to be able to access bnode IDs from outside their
>>>>> scope is something we should strongly discourage. Even if it works,
>>>>> it is Bad Practice.
>>>> 
>>>> Right, but that *severely* limits the utility of this feature.
>>> 
>>> Why?
>> 
>> Well, you have no persistent identifier, and no easy (legitimate) way
>> to refer to the graph in your code, except by example. That can be
>> difficult to deal with in the real world.
>> 
>> Suppose I have:
>> 
>> _:a {
>>   :s1 :p "foo" .
>>   :s1 :q "bar" .
>> }
>> 
>> _:b {
>>   :s1 :p "foo" .
>>   :s1 :q "baz" .
>> }
>> 
>> The only way I can refer to the graph labelled as _:b in my system is
>> by noting that it has :s1 :p "foo", :s1 :q "baz" - it has no identity
>> beyond that.
> 
> Except if I would also have something like this in, e.g., the default graph
> 
> :s0 :x _:a
> :s0 :y _:b
> 
> Then I can navigate to the graph. But unfortunately _:a doesn't denote the
> graph (even an IRI wouldn't) and so it is not clear whether _:a (or :a for
> that matter) identifies the graph stored using that label or something else.
> I'm sure most people would intuitively say that _:a does identify that graph
> - but that's the topic of another thread.

Yes… that's somewhat problematic, and you may as well have just used your identifying properties in the default graph in the anonymous one to identify it, or used a stable graph ID for that matter.

>>>> I'm willing to bet that if you presented this view to the JSON-LD
>>>> people (who requested anonymous graphs in the first place) they
>>>> wouldn't be keen on this as a solution to their representational
>>>> issue.
>>> 
>>> That's definitely not the case. In most cases I would expect that
>>> there isn't even a bnode identifier associated with the graph.
>> 
>> I don't think I understand that statement.
> 
> In JSON-LD you can do something like this:
> 
> {
>  "@context": ...,
>  "@id": "/product/xyz",
>  "priceAtExample.com": 19.99,
>  "priceAtExample.org": 17.39,
>  "sources": [
>    {
>      "retrievedOn": "2012-04-09",
>      "retrievedFrom": "http://example.com/...",
>      "@graph": [
>        ... the graph containing the price ...
>      ]
>    },
>    ...
>  ]
> }
> 
> Sources contains anonymous graphs. There's no bnode ID in the serialization,
> that's what I meant. Of course no external system would be able to reference
> such an anonymous graph.

Well, no published RDF serialisation includes bNode IDs - modulo skolemisation, you could regard those as bNode IDs I guess, but once skolemised they're no longer bNodes.

There are (optional) bNode labels, but they can cease to exist once the serialisation is turned into a RDF graph.

Your example above doesn't seem like a direct correlation to a bnode-as-graph-ID - there's many way to represent that in RDF - but I'm not sure of the exact operations you would expect to perform on that subgraph.

- Steve

-- 
Steve Harris
Experian
+44 20 3042 4132
Registered in England and Wales 653331 VAT # 887 1335 93
80 Victoria Street, London, SW1E 5JL
Received on Monday, 3 June 2013 11:55:38 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:29:57 UTC