Re: A different take on b-scopes (ISSUE-107)

Hi Antoine,

On 22 Nov 2012, at 09:28, Antoine Zimmermann wrote:
> Yes, it's going in the right direction and I like it much better than
> before. But still some issues: the proposal has some unsaid assumptions that makes it a bit sloppy.
> 
> 1. A scope is mutable. Bnodes id can be added to it, thus the notion of fresh bnodes;

No, a scope is not mutable. It's a bijection between *all* blank node identifiers and some set of blank nodes. “Using” a blank node stops it being fresh, but doesn't modify the scope.

Making scopes mutable means that now you will have people who ask how to delete a blank node from a scope, and you need to put constraints to stop people from re-assigning a blank node identifier to a different blank node. Let's *please* not go there.

(The reason you want mutability is because you don't like how “freshness” is defined. I know that the definition of “fresh” is mathematically sloppy, but it is perfectly comprehensible, therefore I object to making it more complicated just to please mathematical aesthetics. I like precision, but this is becoming formalism for the sake of formalism. I'm happy to change the definitions of “copy” and “merge” to something that is declarative and doesn't rely on “freshness” if anyone can propose wording that works.)

> 2. A scope is associated to an RDF graph, thus the notion of copying a graph into a scope, and merging towards a scope.

No, a scope is not associated to an RDF graph. The notions of copying and merging are really operations on sets of blank nodes, and not on graphs. It just so happens that the only sets of blank nodes that are ever interesting are those contained in a particular graph, hence we define the copy and merge of graphs, not the copy and merge of blank node sets. Scopes are associated with blank nodes, not graphs.

Most crucially, any number of graphs can be formed from the blank nodes in any given scope. For example, given a graph G whose blank nodes are all in scope S, the blank nodes of any subgraph of G are supposed to be still in S, but they can't in your proposal because it's now a different graph, hence different scope, hence disjoint set of blank nodes. Another example is RDF datasets: A TriG document, being an RDF document, is a scope and may contain many graphs.

> I had a hard time making sense of the two paragraphs before the note but here is a proposal. At some places it may be a bit too heavy in trying to be precise, so we can consider removing parts if accepted.

Well, all the detail is there because others complained that it wasn't precise enough.

> """
> A /blank node identifier/ is a Unicode string that identifies a blank node within some local context, called a /scope/. A /scope/ is a mutable entity that comprises:
> - a finite set of /blank node identifiers/;
> - an RDF graph;
> - a 1 to 1 mapping (bijection) between the set of identifiers and the set of blank nodes in the RDF graph.
> 
> Scopes are subject to the following constraints:
> - in any state of affairs, different scopes map their identifiers to disjoint sets of blank nodes;
> - every RDF document forms its own scope, where the RDF graph of the scope is the one serialised in the document;
> - scope boundaries outside of RDF documents (for example, in RDF stores) are implementation-dependent;
> - other specifications MAY impose additional rules, including constraints on the syntax of a scope's blank node identifiers.
> 
> If a scope maps a blank node identifier to a given blank node, the identifier is said to /identify/ the blank node. A blank node that is identified by a blank node identifier in a scope is said to /belong/ to the scope.
> 
> A /fresh blank node/ is a blank node that does not belong to any scope.
> 
> A /copy/ of a given RDF graph is an isomorphic RDF graph that only contains fresh blank nodes. An RDF graph is /copied into a scope/ by adding all the triples of a copy of the graph to the target scope's graph, and extending the mapping by introducing new identifiers mapped to the fresh nodes. If the given RDF graph belongs to a scope (its source), and none of the source's blank node identifiers are used in the target scope, copying into a scope can be achieved by simply re-using the same blank node identifiers in the new scope.
> 
> The merge of two RDF graphs can be obtained by copying both graphs into a target empty scope. In this case, the merge will be the target scope's RDF graph after the copies.
> """

Thanks for taking the time to write this up. But I think it doesn't work, for the two reasons stated above: If you want mutability then you need to place constraints on it (and I doubt that you want mutability); and a blank node must be allowed to occur in any number of graphs (but only in one scope).

> Remark: in RDF 2004, merge is a math operation, so it does not involve changes of state, copy, etc. It's also a "semantic" operation, in the sense that the merge of a set of graphs is the only RDF graph (up to isomorphism) that is simple-equivalent to the set of graphs.
> 
> If we keep it this way in RDF 1.1, and I hope we do, then what concepts says about merge should not be presented as a definition but rather a way to *do* a merge. Thus, my words say "the merge can be obtained by etc."

RDF 2004 actually *defines* merge by saying “it is obtained by”.

The distinction you draw between “semantic” and “non-semantic” operations is spurious. If you want to draw such a distinction, it should be between operations that are defined with respect to an entailment regime, like entailment and equivalence and consistency. There is nothing particularly “semantic” about an operation or relationship that only holds in simple entailment.

(If the B-Scopes proposal is adopted, then merge and union, if used appropriately as described in RDF 2004, are equivalent anyway. Per RDF Semantics, the use of the merge is appropriate only when graphs come from different sources, and per the B-Scopes proposal, they have disjoint sets of blank nodes in that case. Hence the merge *is* the union. So we might just as well define the merge as *being* the union of two graphs, with a note saying that if you want a single set of blank node identifiers to uniquely refer to them, which you usually want in practice, then you need to copy that union into some scope; and another note pointing out that this was all a bit more complicated back in 2004.)

Best,
Richard



> 
> 
> AZ
> 
> Le 22/11/2012 00:48, Richard Cyganiak a écrit :
>> So here's a modified proposal. (The old one is still further down on
>> the same page.)
>> http://www.w3.org/2011/rdf-wg/wiki/User:Rcygania2/B-Scopes
>> 
>> What this does:
>> 
>> * Takes an old 2004-style definition of blank nodes * Adds a new
>> subsection on “blank node identifiers and scopes” * Defines scopes
>> more formally by saying that they have an associated “1:1 mapping
>> (bijection) between blank node identifiers and blank nodes”
>> 
>> The goal was to make scopes an add-on to the definition of blank
>> nodes, rather than baking them right into the definition. I may be
>> wrong but that seemed to be at the heart of both Antoine's and Andy's
>> concerns.
>> 
>> If this changes anyone's view of the whole thing (in a good or bad
>> direction), then please comment.
>> 
>> The new proposal keeps the following bit, which Antoine and Andy may
>> also have objected to, but which for me is the key sentence to the
>> whole endeavour:
>> 
>> “The sets of blank nodes in any two scopes are disjoint.”
>> 
>> If you think that this sentence shouldn't be there, then I'd really
>> like to hear the case argued, because I don't understand the reason
>> for this objection.
>> 
>> Best, Richard
>> 
> 
> 
> -- 
> Antoine Zimmermann
> ISCOD / LSTI - Institut Henri Fayol
> École Nationale Supérieure des Mines de Saint-Étienne
> 158 cours Fauriel
> 42023 Saint-Étienne Cedex 2
> France
> Tél:+33(0)4 77 42 66 03
> Fax:+33(0)4 77 42 66 66
> http://zimmer.aprilfoolsreview.com/
> 

Received on Thursday, 22 November 2012 12:12:57 UTC