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] Agenda: XDI TC Telecon Thursday 1-2PM PT 2010-02-18



Hi Drummond, good points thanks. I need to fix some things in my impl before I post and apparently the subject context issue is definitely one of them. I'll think about the ref word issue but am definitely open to suggestions to how to do it. {"a.seg":undefined} might work with some care.  I'll try working that in as replacement for {"ref": "a.seg"} and {"ref": {"type":"external", "id":"a.seg"}}.

Kind regards,

Bill Barnhill
Booz Allen Hamilton - Rome, NY
315-330-7386  | william.barnhill.ctr@rl.af.mil | barnhill_william@bah.com
________________________________________
From: drummond.reed@gmail.com [drummond.reed@gmail.com] On Behalf Of Drummond Reed [drummond.reed@xdi.org]
Sent: Monday, February 22, 2010 12:35 AM
To: Barnhill, William [USA]
Cc: Markus Sabadello; OASIS - XDI TC
Subject: Re: [xdi] Agenda: XDI TC Telecon Thursday 1-2PM PT 2010-02-18

Bill, unfortunately I don't know either JSON or Javascript well enough to comment. Markus or Giovanni will have to wade in there.

However I did spot one thing as I read over this: in your subcontext examples, you show them containing XDI predicates at the top level. Subcontexts are identical to regular contexts: the top level is XDI subjects, i.e., the pattern should be:

s1
  p1
    /
      s2
         p2
            o2

The other issue I see is that giving special literals (like "ref") special meaning seems fraught with complications. At a minimum they have to be $ words, but even then, as we discussed on Thursday's call, that introduces the question of what is and is not part of the formal XDI graph.

If there were a way to do it without using special XDI $ words it would be much better.

=Drummond

On Sun, Feb 21, 2010 at 6:49 AM, Barnhill, William [USA] <barnhill_william@bah.com<mailto:barnhill_william@bah.com>> wrote:
Hi Drummond , Markus,

Yeah, the one Markus proposed is the one I first used in my implementation and it does seem elegant. There are some issues though that I ran into while implementing it.

(a) The first is that using null to represent no value means a special value and a lot of special handling. Using undefined makes it a little easier but was still very much a pain. The primary reason is that lets say I have an object foo with property bar that is set to undefined and property baz set to null. Then the following all evaluate to true javascript:
foo['bar'] == foo['baz']
foo['bar'] == null
foo['baz'] == undefined
foo['bar'] == foo['dfdf'], where foo['df'df'] is not set

This can be gotten around with === operator, but is prone to error and many developers using our libraries may use == when they should use ===.

(b) The second is that by using a JSON object as a value if it's a local node you prevent predicates with multiple values, which are very common in RDF.

(c) The third is that having an object value that's a set of references be represented as an array of strings means you can't represent an array of string literals.

The solutions I adopted were, in the same order:

(a) have the empty array [] represent no values

(b) have every object value be represented as an array, which maps closely to the XDI graph model as we've discussed it in the TC. Use an empty array in case you want to explicitly state a predicate but not state any value for that predicate.  The non-empty arrays contain either all literals, or all nodes.

(c) Have there be two kinds of values: literals and nodes. Nodes are grouped into three kinds. The first kind is a subcontext, represented as JSON object with multiple keys representing predicates and values that represent the predicate value. The second is local node references, which are represented as a JSON object that has a single key "ref" with a value matching the XRI segment identifying the node. The third kind of node is one that is a reference to a node in another graph.  I struggled with making this undefined,null, or [], but chose a special object in the end, an object that has the single key "ref" and contains properties "type" of "external", and "id" of the XRI being referenced.  I.e. {"ref": "refid"} be shortcut for {"ref": {"id":"refid", "type":"local"}}, and having externals refs be represented as {"ref": {"id":"refid", "type":"external"}}.

So what I proposed based on what I have is:

Subject and predicate with no object values:
{"s1": {"p1":[]}
s1
   p1

Subject and predicate with one literal object value:
{"s1": {"p1":["o1"]}
s1
   p1
       o1

Subject and predicate with one literal multiple values:
{"s1": {"p1":["o1","o2"]}
s1
   p1
       o1
       o2

Subject with two predicates, both of which have one literal value:
{"s1": {"p1":["o1"],"p2":["o2"]}
s1
   p1
       o1
   p2
       o2

Subject with one predicate that has one node object value that is a subcontext with one predicate:
{"s1": {"p1":[{"p2":[]}]}}
s1
   p1
       /
           p2

Subject with one predicate that has one node value that is a subcontext containing a predicate with a literal value:
{"s1": {"p1":[{"p2":["o2"]}]}}
s1
   p1
       /
           p2
               o2

Subject with one predicate that has one node object value that is local reference
{"s1": {"p1":[{"ref":"+o1"}]}}
or
{"s1": {"p1":[{"ref": {"id":"+o1", "type":"local"}}]}}

s1
    p1
       +o1

Subject with one predicate that has one node object value that is an external reference
{"s1": {"p1":[{"ref": {"id":"@example+o1", "type":"external"}}]}}

s1
   p1
       @example+o1

Question: Is the X3 representation for the references above correct current usage as you are using it?

An XDI document:
An array of nodes, possibly with an implicit or explicit node of form {"$": {"$has": [ {ref:"s1"},{ref:"s2"},...]}}

I am working on cleaning up some things I found right now and expect to release on github sometime late this evening, so you can see what I did.

Kind regards,

Bill Barnhill
Booz Allen Hamilton - Rome, NY
315-330-7386  | william.barnhill.ctr@rl.af.mil<mailto:william.barnhill.ctr@rl.af.mil> | barnhill_william@bah.com<mailto:barnhill_william@bah.com>
________________________________________
From: drummond.reed@gmail.com<mailto:drummond.reed@gmail.com> [drummond.reed@gmail.com<mailto:drummond.reed@gmail.com>] On Behalf Of Drummond Reed [drummond.reed@xdi.org<mailto:drummond.reed@xdi.org>]
Sent: Saturday, February 20, 2010 8:17 PM
To: Markus Sabadello
Cc: Barnhill, William [USA]; OASIS - XDI TC
Subject: Re: [xdi] Agenda: XDI TC Telecon Thursday 1-2PM PT 2010-02-18

I must say, I find the elegance of this solution to be very attractive. I don't think it's a coincidence that JSON offers these four options (value, array, object, null) and X3J needs all four.

=Drummond

On Sat, Feb 20, 2010 at 3:24 AM, Markus Sabadello <markus.sabadello@xdi.org<mailto:markus.sabadello@xdi.org><mailto:markus.sabadello@xdi.org<mailto:markus.sabadello@xdi.org>>> wrote:
Hi Bill,

On the call everyone was in agreement that it's probably better to not support comments at all in X3J, rather than inventing $ words, which would only create confusion as to whether the comments are part of the graph or not..

Regarding the other questions, we thought maybe it would be easiest to directly map the 3 XDI object types (literals, references, subcontexts) to the 3 JSON primitives (value, array, object), and to map the non-existence of an XDI object to JSON null. E.g.:

+email: "markus.sabadello@gmail.com<mailto:markus.sabadello@gmail.com><mailto:markus.sabadello@gmail.com<mailto:markus.sabadello@gmail.com>>"

+friend: ["=bill.barnhill", "=giovanni", "=drummond"]

+email: { .. object here following the same patterns as the top-level graph object .. }

+predicate.without.object: null

Do you think this would work? How close is this to your current implementation?

Markus


On Thu, Feb 18, 2010 at 10:53 PM, Barnhill, William [USA] <barnhill_william@bah.com<mailto:barnhill_william@bah.com><mailto:barnhill_william@bah.com<mailto:barnhill_william@bah.com>>> wrote:

Thanks. Yes, I've got an alpha-stage implementation built on Node.js. It's an implementation of the basic XDI ops though, I'm still working on getting connected to OpenXRI via WebSocket protocol.  I'm going to be on client site until about 10pm tonight, but will work on documenting how I addressed those issues in the implementation (most of them you raised earlier on the mailing list too I think), but the stream of consciousness versions are:

Note 1: Yeah,I did basically the same thing you suggest later on - basically as an object within an object, need to check though on exact format

Note 2: Again used objects, with reference being an object in a certain form (need my code to give specifics on the form), I think I wound up doing it like your note 3, except  "=drummond+home": [],  instead of "=drummond+home": {}.  It's a little dicey as then how do you tell difference between asserting that there are no values for =drummond+home and asserting a reference, but with semantic Open World Model which we adopted that point should become moot.

Note 3: see above

Note 4: Yeah, I ran into this very early on in impl. Solved by having the value associated with a predicate key be a JSON list,
var doc = {"=drummond+home": [{"+email" : [ "drummond@example.org<mailto:drummond@example.org><mailto:drummond@example.org<mailto:drummond@example.org>>"  ]} ]}

This has the nice property that in Javascript we can then do a JSON path like doc["=drummond+home"][0]["+email"] and the javascript engine will understand it and return "drummond@example.org<mailto:drummond@example.org><mailto:drummond@example.org<mailto:drummond@example.org>>".

As for comments, I don't have programmatic accessible comments, I'm not decided on whether that's a good thing or a bad thing. This is something I haven't solved but have thought some about. I realize the lure of XML style comments (which are a bit of both), but am lean towards XSD:annotation style of comments, which would mean the comments are just XDI data like the rest of the XDI data.  We could if we wanted to have a reserved XRI $ word like $annotatedBy which I think would serve well. Another could serve as the XDI equiv of PI directives, say $decoratedBy. What do you think?

Kind regards,

Bill Barnhill
Booz Allen Hamilton - Rome, NY
315-330-7386  | william.barnhill.ctr@rl.af.mil<mailto:william.barnhill.ctr@rl.af.mil><mailto:william.barnhill.ctr@rl.af.mil<mailto:william.barnhill.ctr@rl.af.mil>> | barnhill_william@bah.com<mailto:barnhill_william@bah.com><mailto:barnhill_william@bah.com<mailto:barnhill_william@bah.com>>
________________________________________
From: markus.sabadello@gmail.com<mailto:markus.sabadello@gmail.com><mailto:markus.sabadello@gmail.com<mailto:markus.sabadello@gmail.com>> [markus.sabadello@gmail.com<mailto:markus.sabadello@gmail.com><mailto:markus.sabadello@gmail.com<mailto:markus.sabadello@gmail.com>>] On Behalf Of Markus Sabadello [markus.sabadello@xdi.org<mailto:markus.sabadello@xdi.org><mailto:markus.sabadello@xdi.org<mailto:markus.sabadello@xdi.org>>]
Sent: Thursday, February 18, 2010 4:04 PM
To: Barnhill, William [USA]
Cc: Drummond Reed; OASIS - XDI TC
Subject: Re: [xdi] Agenda: XDI TC Telecon Thursday 1-2PM PT 2010-02-18

Hi Bill,

Yep X3J seems to be really useful. Your notes suggest you implemented it already!
Regarding syntax, I just added a few notes to the Open Issues section.

Markus

On Thu, Feb 18, 2010 at 7:25 PM, Barnhill, William [USA] <barnhill_william@bah.com<mailto:barnhill_william@bah.com><mailto:barnhill_william@bah.com<mailto:barnhill_william@bah.com>><mailto:barnhill_william@bah.com<mailto:barnhill_william@bah.com><mailto:barnhill_william@bah.com<mailto:barnhill_william@bah.com>>>> wrote:

My apologies but due to client I will not be able to attend today's telecon. I understand importance of X3J (X3 JSON Syntax) closing - could anyone that has issues with X3J please put those issues in the Open Issues section that is now on the X3 wiki page? I'll respond to them within 24 hours. I've edited that page with the start of some updates that I will/must complete by Feb 21. The added content includes a proposal that X3J be adopted as the primary XDI serialization format for the reasons listed on the page.

________________________________________
From: drummond.reed@gmail.com<mailto:drummond.reed@gmail.com><mailto:drummond.reed@gmail.com<mailto:drummond.reed@gmail.com>><mailto:drummond.reed@gmail.com<mailto:drummond.reed@gmail.com><mailto:drummond.reed@gmail.com<mailto:drummond.reed@gmail.com>>> [drummond.reed@gmail.com<mailto:drummond.reed@gmail.com><mailto:drummond.reed@gmail.com<mailto:drummond.reed@gmail.com>><mailto:drummond.reed@gmail.com<mailto:drummond.reed@gmail.com><mailto:drummond.reed@gmail.com<mailto:drummond.reed@gmail.com>>>] On Behalf Of Drummond Reed [drummond.reed@xdi.org<mailto:drummond.reed@xdi.org><mailto:drummond.reed@xdi.org<mailto:drummond.reed@xdi.org>><mailto:drummond.reed@xdi.org<mailto:drummond.reed@xdi.org><mailto:drummond.reed@xdi.org<mailto:drummond.reed@xdi.org>>>]
Sent: Thursday, February 18, 2010 4:25 AM
To: OASIS - XDI TC
Subject: [xdi] Agenda: XDI TC Telecon Thursday 1-2PM PT 2010-02-18

Following is the agenda for the unofficial telecon of the XDI TC at:

Date:  Thursday, 18 February 2010 USA
Time:  1:00PM - 2:00PM Pacific Time (21:00-22:00 UTC)

PLEASE DIAL ONE OF THE FOLLOWING NUMBERS:

1) Skype Number: +9900827047990866
(this will connect you directly to the conference room)

2) US/Canada Toll Number: +1-201-793-9022  7990866#

3) International Toll Number (follow this with the Conference Room Number:
7990866#)
Austria (0820 401 15470)
Belgium (0703 57 134)
France (0826 109 071)
Germany (0180 500 9527)
Ireland (0818 270 968)
Spain (902 885 791)
Switzerland (0848 560 397)
United Kingdom/Northern Ireland (0870 0990 931)


AGENDA


1) GIOVANNI METAMODEL DISCUSSION CONTINUED

See the slides Giovanni posted at:

   http://www.oasis-open.org/committees/download.php/36424/semantic-kit4xdi.pdf<http://lists.oasis-open.org/archives/xdi/201001/msg00065.html>

2) X3J (X3 FOR JSON) SERIALIZATION FORMAT DISCUSSION

There is now a more urgent need to close on this format - Drummond and Markus will explain on the call. The previous thread that currently ends with Bill's message is at:

 http://lists.oasis-open.org/archives/xdi/201001/msg00010.html


3) XDI GRAPHER

See the thread started by Markus at:

 http://lists.oasis-open.org/archives/xdi/201001/msg00001.html

and his XDI Grapher app at:

 http://graceland.parityinc.net/xdi-grapher/XDIGrapher

<http://lists.oasis-open.org/archives/xdi/201001/msg00010.html>

4) NEW BUSINESS


5) NEXT CALL




---------------------------------------------------------------------
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








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