[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [xdi] Replacing X3 with Semantic JSON
I'm planning to dial into telecon tomorrow, as long as the non-skype number is working (no skype where I work).
Below is the same example in the most recent version of X3J I created,
which merged some concepts from Markus"s version with my enhancements to
the JSON schema I had posted to the list.
Four predicates have been added for =drummond: +flagged, +empnum,
+role, and +ticketnums, a boolean, int, string, and an int array
respectively. I added these to show how literals other than strings
are handled, and how string language is represented.
A thing to highlight is the base attribute, which serves basically the
same function as xml:base in that if it is anything other than "$" then
the subject XRI segments are interpreted as relative, delegated to from
the base (e.g +work in a graph with base of =drummond becomes
=drummond+work).
Another to highlight are that string, XML, and base64 literals
can be either a single long string, or an array of shorter strings. In
the case of XML or a regular string the elements in the array are
joined together during processing using the system line delimiter. In
the case of base64 the elements are joined together with no delimiter.
I also added a +home+address to show contexts, and a comment about
+drummond using the "$ann" predicate. This predicate and its
values are treated as not included in the graph when reasoning occurs,
similar to RDF annotations such as rdfs:comment.
I believe what I have as {"boolean", true} would be
{"$":{"$a$boolean": "true"}} in the Semantic JSON format proposed?
Btw the example for Semantic JSON won"t parse as is unless you apply
some minor fixes, as JSON won"t except multiline string literals (like
XML literal) and the email sig predicate is missing a " and :.
You can validate JSON at http://www.jsonlint.com/.
Also, in the example below if typeof an item of the predicate value array
is "string" then that is processed equivalent to {"xri", string here}.
{ "id" : "=drummond",
"base": "$",
"content":
{
"=drummond": {
"$is": [
"=drummond.reed",
"=!F83.62B1.44F.2813"
],
"$is$a": [
"+person",
"@oasis+chair"
],
"$has": [
"+home",
"+work",
"+role",
"+friend",
"@cordance",
"@parity",
"+flagged",
"+ticketnums",
"+empnum"
],
"$ann": [{"content":
{"$": {
"+comment$1": {"string": "Will be at XDI retreat"}
}}
}
],
"+flagged": [
{"boolean": true}
],
"+role": [
{"string": "editor", "lang":"en"},
{"string": "ꥩteur", "lang":"fr"}
],
"+empnum": [
{"int": 12345}
],
"+ticketnums": [
{"ints": [1234, 343, 232]}
],
"+email": [
"=drummond+home+email",
"=drummond+work+email"
],
"+email+signature": [{"xml":[
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>",
"<signature xmlns=\"http://example.com/ns\">",
" <name>Drummond Reed</name>",
" <affiliation>Cordance</affiliation>",
" <affiliation>Parity</affiliation>",
" <affiliation>OASIS</affiliation>",
"</signature>"
]}
],
"+picture": [{"json":
{"Image": {
"Width": 800,
"Height": 600,
"Title": "Drummond at Graduation",
"Thumbnail": {
"Url": "http://www.example.com/image/481989943",
"Height": 125,
"Width": 100
},
"IDs": [116,943, 234, 38793]
}}
}],
"=web*markus": ["=drummond+friend"]
},
"=drummond+home": {
"+email": [{"string": "drummond@example.com"}],
"+address": [{"content":
{"$": {
"+street": {"string": "main st"},
"+region": "+region+us+wa+seattle",
"+postalcode": {"string": "12345"}
}}
}]
},
"=drummond+work": {
"+email": [
"=drummond@cordance+email",
"=drummond@parity+email"
]
},
"=drummond@cordance": {
"+email": [{"string": "drummond.reed@cordance.example.com"}]
},
"=drummond@parity": {
"+email": [{"string": "drummond.reed@parity.example.com"}]
},
"=drummond+friend": {
"$is$a": [
"$contract",
"@identity.commons$contract",
"@identity.commons+personal$contract"
],
"$get": [
"=drummond+home",
"=drummond+work"
]
}
}
}From: drummond.reed@gmail.com [mailto:drummond.reed@gmail.com] On Behalf Of Drummond Reed
Sent: Thursday, August 12, 2010 5:22 AM
To: OASIS - XDI TC
Subject: [xdi] Replacing X3 with Semantic JSON
{ "=drummond": { "$is": [ "=drummond.reed", "=!F83.62B1.44F.2813" ], "$is$a": [ "+person", "@oasis+chair" ], "$has": [ "+home", "+work", "+friend", "@cordance", "@parity" ], "+email": { "=drummond+home": { "+email": null }, "=drummond+work": { "+email": null } }, "+email+signature$a$xml": " \n <?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> \n <signature xmlns=\"http://example.com/ns\"> \n <name>Drummond Reed</name> \n <affiliation>Cordance</affiliation> \n <affiliation>Parity</affiliation> \n <affiliation>OASIS</affiliation> \n </signature> \n ", "+picture$a$json": { "Image": { "Width": 800, "Height": 600, "Title": "Drummond at Graduation", "Thumbnail": { "Url": "http://www.example.com/image/481989943", "Height": 125, "Width": "100" }, "IDs":[116, 943, 234, 38793] } } , "=web*markus": [ "=drummond+friend" ] }, "=drummond+home": { "+email": "drummond@example.com" }, "=drummond+work": { "+email": { "=drummond@cordance": { "+email": null }, "=drummond@parity": { "+email": null } } }, "=drummond@cordance": { "+email": "drummond.reed@cordance.example.com" }, "=drummond@parity": { "+email": "drummond.reed@parity.example.com" }, "=drummond+friend": { "$is$a": [ "$contract", "@identity.commons$contract", "@identity.commons+personal$contract" ], "$get": { "=drummond+home": null, "=drummond+work": null } } }
{ "=drummond": { "$is": [ "=drummond.reed", "=!F83.62B1.44F.2813" ], "$is$a": [ "+person", "@oasis+chair" ], "$has": [ "+home", "+work", "+friend", "@cordance", "@parity" ], "+email": { "=drummond+home": { "+email": null }, "=drummond+work": { "+email": null } }, "+email+signature
{
"$": {
$a$xml": "
\n <?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
\n <signature xmlns=\"http://example.com/ns\">
\n <name>Drummond Reed</name>
\n <affiliation>Cordance</affiliation>
\n <affiliation>Parity</affiliation>
\n <affiliation>OASIS</affiliation>
\n </signature>
\n ",
}
}
"+picture
{
"$": {
$a$json": "
{
"Image": {
"Width": 800,
"Height": 600,
"Title": "Drummond at Graduation",
"Thumbnail": {
"Url": "http://www.example.com/image/481989943",
"Height": 125,
"Width": "100"
},
"IDs":[116, 943, 234, 38793]
}
}
}
,
"=web*markus":
[
"=drummond+friend"
]
},
"=drummond+home": {
"+email": "drummond@example.com"
},
"=drummond+work": {
"+email":
{
"=drummond@cordance": {
"+email": null
},
"=drummond@parity": {
"+email": null
}
}
},
"=drummond@cordance": {
"+email": "drummond.reed@cordance.example.com"
},
"=drummond@parity": {
"+email": "drummond.reed@parity.example.com"
},
"=drummond+friend": {
"$is$a":
[
"$contract",
"@identity.commons$contract",
"@identity.commons+personal$contract"
],
"$get":
{
"=drummond+home": null,
"=drummond+work": null
}
}
}
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]