[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [xdi] Exciting development: XDI graph model documented - please indicate your syntax preferences!
On Apr 11, 2013, at 2:04 PM, Markus Sabadello <markus.sabadello@xdi.org> wrote:On Thu, Apr 11, 2013 at 9:50 PM, Joseph Boyle <planetwork@josephboyle.net> wrote:
1. If values now have JSON semantics, and XDI collections are now always ordered, why not allow specification of the two-line street address as a JSON array? The following looks like a legal statement even under current syntax.=markus+address!4567+&street#/#/ ["123 Main St","Apt 23"]In the latest iteration of the model there's no such thing as collections, only classes, and they can have both ordered and unordered instances.In the unordered case are the instances individually tagged? If so the collection would correspond to a JSON object.
In general, the problem with your above XDI statement is that the two individual street lines do not have their own XDI addresses in the graph.We could say that if a literal is a JSON array, then you could address its elements just like ordered XDI instances (e.g. =markus+address!4567+&street[1]), but that would be a pretty exceptional rule.This is what I was assuming - it seemed natural and implementable, and if we want everything to be addressable and to minimize the conceptual gap between JSON and XDI data structures, why not allow addressing into a JSON value structure using equivalents of the familiar JS accessors.
2. If retrieving =markus+address!4567+&street# can return a JSON array or object, or a JSON single value depending on whether you previously set it to an array / set one or more of its array members, vs setting it to simply a single value, then we don't need a singleton marker to specify singleton vs. collection; in fact it would simply lead to an error if mismatch.I think I would argue for not allowing JSON arrays or objects as literal values, only strings, numbers, boolean.
3. Also, while [1] is very recognizable syntax for array indexing, if we only allow integer constant indexes and not computed expressions, we shouldn't have to use a paired delimiter, which should be reserved for cases where we need to specify the end of _expression_ that would otherwise be ambiguous. # is a nonpaired delimiter that would also be a recognizable choice to precede an integer index into a collection.I could imagine using a nonpaired delimiter
4. I still do not get why the entity vs. attribute distinction is needed and especially why it has to be explicitly specified in every XDI address.For dictionary purposes, but I'd defer to Drummond for giving a more elaborate answer to this question :)
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]