OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xdi message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [xdi] X3 Tabular: Right instead of Right and Down


As far as whether we should converge on one X3 format, I'm all for that. I'm working on a mini-spec for X3 Short so we can compare that with X3 Tabular and X3 Simple and decide which one to standardize on for documentation (assuming we decide to use XDI JSON on the wire).

This week is crazy with Gov 2.0 an IIW East in Washington D.C., but I'd like to settle on this by the end of next week.

=Drummond

On Tue, Sep 7, 2010 at 6:39 AM, Markus Sabadello <markus.sabadello@xdi.org> wrote:
What I really like about this is that (besides the old, crappy X-TRIPLES) it is the only format or format proposal I know of that clearly has 1 XDI triple per line.

It does look quite similar to X3 Simple and X3 Short, so in the end there should probably just one of those..?

Markus


On Thu, Sep 2, 2010 at 12:02 PM, Joseph Boyle <boyle.joseph@gmail.com> wrote:

Here's a proposal for a more compact and more tabular textual representation of XDI documents, well suited to documents where most XRIs are short. 
I'll confine discussion to the X3-style formats for this mail; similar ideas might later be applicable to JSON serialization, though JSON also has native prettyprinting conventions.


http://wiki.oasis-open.org/xdi/X3Format#FormattingRules states rules for producing the X3 Whitespace format (which is then used in the definition of X3 Simple which has been the most popular format for displaying XDI examples):

1.  Place each X3 subject, predicate, object on a new line.
For X3 Tabular, relax this rule and instead insert a newline only where X3 Standard has a closing square bracket.
For the moment, for compactness, let's say that multiple consecutive closing square brackets result in only a single newline, rather than consecutive newlines that would produce some blank lines.

2.  Indent each X3 predicate one tab from the parent subject. and 3. Indent each X3 object one tab from the parent predicate.
Equivalently, the tab indent number corresponds to the net nesting depth of square brackets in X3 Standard at that point in the document.
Keep these rules - however, since multiple XRIs or literals may now occur on the same line, if an XRI or literal is as wide as or wider than one tab stop, following XRIs or literals on the same line may need to shift farther right.
(If there are many XRIs or literals overflowing a given tab stop, it may be clearer to consistently shift that tab stop to the right across all lines of the document.)

Rules 4-8 concern literals and comments rather than whitespace and we will leave them alone for now.


Here is the proposed format applied to the "Equivalent in X3 Simple" example at http://wiki.oasis-open.org/xdi/JsonFormat#EquivalentinNewX3Simple , reducing line count from 90 to 32.


*       $is     =!1234.5678.aaaa.bbbb
                =example
        $is$a
                +person$
        +friend =markus
                =mary
                =joejohnson
!       $d "2010-11-12T09:10:11Z"
        +age 33"
        +vegetarian "$false"
        +nickname "Dude"
        +colors "[\"red\",\"blue\",\"green\]\""
        +vcard ”{\”home\”:\[{\”label\”: \”Primary Residence\”,\”tel\”: \”+1.111.111.1111\”,\”postal\”: \”11 First Ave\”},{\”label\”: \”Secondary Residence\”,\”tel\”: \”+1.222.222.2222\”,\”postal\”: \”22 Secondary St.\”}\]}”
$ +age / * $is$a $int!
                        ! $d "2010-11-12T09:10:11Z"
        +vegetarian / * $is$a $boolean!
                        ! $d "2010-11-12T09:10:11Z"
        +nickname / * $is$a $string!
                        ! $d "2010-11-12T09:10:11Z"
        +friend / * $is$a +person*
                        ! $d "2010-11-12T09:10:11Z"
        +colors / * $is$a $json!
                        ! $d "2010-11-12T09:10:11Z"
        +vcard / * $is$a $json!
                        ! $d "2010-11-12T09:10:11Z"
        +address / * $is$a +address$
                        ! $d "2010-11-12T09:10:11Z"
                                +street*1 "12233 Corliss Ave N"
                                +street*2 "Apt 123"
                                +city "Seattle"
                                +state WA"
                                +postalcode "98133"








[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]