Next in thread → Next in month →

Re: [xdi] Proposed additional X3 representation format, or a replacement for X3 Whitespace

From
[arkus Rabadello
Date
2009-12-30T14:01:12+00:00
ID
Thread
Re: [xdi] Proposed additional X3 representation format, or a replacement for X3 Whitespace
Hmmm what would your last example (XRI with statements) look like in X3 Simple?

Markus

On Wed, Dec 30, 2009 at 1:20 PM, Barnhill, William [USA] <> wrote:

Hi Nika,

It's a good idea but I'd be hesitant because escaping means we wouldn't be using just JSON. Instead we'd be using JSON + special string escaping. The  {"=markus": {"+friend": {"=Bill.barnhill": {} } } } form is much more verbose than string escaping but I think is better because it's pure JSON and for me is more intuitive. Looking at the above I'd see these variations

Literal String:  {"=markus": {"+friend+iname": "=Bill.Barnhill" }  }

Literal JSON:  {"=markus": {"+friend+gadgetSpec": {object, ...} }  }   (this is iffy as it'd be a special case just like string escaping would be - needs more thought)

Literal number:  {"=markus": {"+friend$size": 500 }  }

Literal boolean:  {"=markus": {"+friend$empty": false }  }

XRI with no statements:  {"=markus": {"+friend": {"=Bill.barnhill": {} } } }

XRI with statements:  {"=markus": {"+friend": {"=Bill.barnhill": {"+name":  "Bill"} } } }

The above comes from current work I am doing creating XRI tools using node.js, which I hope to have on Github as soon as my day job rush is over (Jan 15).

Kind regards,

Bill Barnhill

Booz Allen Hamilton - Rome, NY

315-330-7386  |  | 

________________________________________

From: Nika Jones []

Sent: Wednesday, December 30, 2009 2:40 AM

To: Barnhill, William [USA]

Cc: Drummond Reed; Markus Sabadello; OASIS - XDI TC

Subject: RE: [xdi] Proposed additional X3 representation format,  or a  replacement for X3 Whitespace

I'm pretty new to the XDI stuff (but I do want to get more involved)

...Could the X3J escape a string like the X3Whitespace?

So Cross References would look like:

{

     "=markus":

     {

         "+friend":    "\"=bill.barnhill\""

     }

}

or even:

{

     "=markus":

     {

         "+friend":    "'=bill.barnhill'"

     }

}

as the quote surrounding the text doesn't matter in JSON?

Nika

> Both good questions, I'll address them both in full  soon as possible but

> that won't be for a couple days as I'm really under the gun right now.

> Markus, the short answer to your question for was that I was using 'x' to

> mean ref, and "x" to mean string, but that's a language specific artifact.

> My initial thought is that

> {"+friend": "=Bill.Barnhill"} means value is a String (which could be an

> XRI if it validates as one), and

> {"+friend": {"=Bill.Barnhill": undefined}}

>

> Seems closest to my initial thinking but alas does not work in

> JSON.stringify, so perhaps

> {"+friend": {"=Bill.Barnhill": nulll}}

> or

> {"=markus": {"+friend": {"=Bill.barnhill": {} } } } <-- Despite lispish

> feel I probably like this one best of the ones that work.

>

>

> Kind regards,

>

> Bill Barnhill

> Booz Allen Hamilton - Rome, NY

> 315-330-7386  |  | 

> ________________________________________

> From:  [] On Behalf Of

> Drummond Reed []

> Sent: Monday, December 28, 2009 5:39 PM

> To: Markus Sabadello

> Cc: Barnhill, William [USA]; OASIS - XDI TC

> Subject: Re: [xdi] Proposed additional X3 representation format, or a

> replacement for X3 Whitespace

>

> Good question, Markus. I was looking over Bill's example and had a second

> question. The example shows that subcontexts begin with the string

> "_context". That, too, is a valid XRI string. I think it would be a

> mistake to start reserving XRIs to have special semantics unless they are

> $ words defined for this purpose.

>

> So that's a second issue we need to address if we are going to make X3J

> part of the XDI Serialization spec.

>

> =Drummond

>

> On Mon, Dec 28, 2009 at 8:20 AM, Markus Sabadello

> <<mailto:>> wrote:

> Hi Bill,

>

> I tried implementing your X3J format, but I have a question:

> How would one distinguish between a literal and a reference?

>

> E.g. if I have this X3J data:

>

> {

>     "=markus":

>         {

>             "+friend":    "=bill.barnhill"

>         }

> }

>

> How would I know if it translates to this graph:

>

> =markus

>         +friend

>                 =bill.barnhill

>

> or to this graph:

>

> =markus

>         +friend

>                 "=bill.barnhill"

>

> ??

>

> Markus

>

> On Fri, Jul 3, 2009 at 12:27 AM, Barnhill, William [USA]

> <<mailto:>> wrote:

>

> I've edited http://wiki.oasis-open.org/xdi/X3Format to add text proposing

> an X3 representation that is directly in JSON as opposed to similar to

> JSON.  Given the broad adoption of JSON and the usefulness of this I'm

> seeing in my work I wanted to share it with the TC.  JSON format is still

> rough but works. I will add formatting rules section this weekend.

> ---------------------------------------------------------------------

> To unsubscribe from this mail list, you must leave the OASIS TC that

> generates this mail.  Follow this link to all your TCs in OASIS at:

> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php

>

>

>

>

> ---------------------------------------------------------------------

> To unsubscribe from this mail list, you must leave the OASIS TC that

> generates this mail.  Follow this link to all your TCs in OASIS at:

> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php

>

>
Next in thread → Next in month →