<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Getting hyper about JSON namespacing</title>
	<atom:link href="http://ajaxian.com/archives/getting-hyper-about-json-namespacing/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: kriszyp</title>
		<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing/comment-page-1#comment-275420</link>
		<dc:creator>kriszyp</dc:creator>
		<pubDate>Thu, 10 Sep 2009 13:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7334#comment-275420</guid>
		<description>@fzammetti: You are certainly correct that in certain cases, XML-style namespacing is simpler than schema-based property name remapping. However, a key point is that the complexity is pay-per-use. The vast majority of use cases (single namespace, multiple namespace without any collisions, and multiple namespaces where collisions share meaning) are much simpler with schema-based namespacing, since the document doesn’t require any namespace prefix resolution, it can be interpreted as a plain JSON document, and the client can assert understanding by simply matching on recognized schemas. This is far simpler and less obtrusive than any strategy that forces changes to the actual data documents. Increased complexity is only necessary in rare edge cases (even though it is really easy to theorize about those edge cases), and remains unobtrusive.</description>
		<content:encoded><![CDATA[<p>@fzammetti: You are certainly correct that in certain cases, XML-style namespacing is simpler than schema-based property name remapping. However, a key point is that the complexity is pay-per-use. The vast majority of use cases (single namespace, multiple namespace without any collisions, and multiple namespaces where collisions share meaning) are much simpler with schema-based namespacing, since the document doesn’t require any namespace prefix resolution, it can be interpreted as a plain JSON document, and the client can assert understanding by simply matching on recognized schemas. This is far simpler and less obtrusive than any strategy that forces changes to the actual data documents. Increased complexity is only necessary in rare edge cases (even though it is really easy to theorize about those edge cases), and remains unobtrusive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: meandmycode</title>
		<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing/comment-page-1#comment-275418</link>
		<dc:creator>meandmycode</dc:creator>
		<pubDate>Thu, 10 Sep 2009 09:47:21 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7334#comment-275418</guid>
		<description>Might just stick with xml, oh wait.. is that &#039;XML SUCKS&#039; trend still going? ah well, think I&#039;ll stick to being productive anyway.</description>
		<content:encoded><![CDATA[<p>Might just stick with xml, oh wait.. is that &#8216;XML SUCKS&#8217; trend still going? ah well, think I&#8217;ll stick to being productive anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BonoboBoner</title>
		<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing/comment-page-1#comment-275416</link>
		<dc:creator>BonoboBoner</dc:creator>
		<pubDate>Thu, 10 Sep 2009 06:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7334#comment-275416</guid>
		<description>RDFa annotated JSON Webservices as a foundation for the Semantic Web.</description>
		<content:encoded><![CDATA[<p>RDFa annotated JSON Webservices as a foundation for the Semantic Web.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzammetti</title>
		<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing/comment-page-1#comment-275414</link>
		<dc:creator>fzammetti</dc:creator>
		<pubDate>Thu, 10 Sep 2009 01:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7334#comment-275414</guid>
		<description>My gut reaction to that approach to collision avoidance is that it&#039;s too complex (although I totally groove on the idea of schemas for JSON in general).  I totally get where you&#039;re going Kris, and it makes sense, it just seems like to much of XML in JSON, in terms of definitional (if you&#039;ll let me invent a word!) complexity.

I do have an alternate idea to offer...

What if you did something like this:

Content-Type: application/json; schema=ns1:http://www.book-warehouse.com/book-schema,ns2:http://www.mybokos.com/book-schema
{
  &quot;books&quot; : [
    { &quot;ns1.title&quot; : &quot;Oliver Twist&quot;, &quot;ns2.title&quot; : &quot;Oli_Twi&quot;,
      &quot;ns1.price&quot; : 16.99
    },
    { &quot;ns2.title&quot; : &quot;Robinson Crusoe&quot;, &quot;ns2.title&quot; : &quot;Tob_Cru&quot;,
      &quot;ns1.price&quot; : 15.99
    }
  ]
}

That would allow for multiple schemas to be specified, each identified by a namespace identifier.  When this JSON is used to reconstitute the object it defined, you would have to do...

alert(o.books[0][&quot;ns2.title&quot;]);

...to access its data and still maintain namespace awareness, so you lose the pure dot notation approach.  Not ideal, but I could live with that I think.

You might not have to give that up though... I could certainly envision a JSON processor that took in the JSON and created an object from it where the structure would wind up being:

{
  &quot;books&quot; : [
    { 
      &quot;ns1&quot; : { &quot;title&quot; : &quot;Oliver Twist&quot;, &quot;price&quot; : 16.99 },
      &quot;ns2&quot; : { &quot;title&quot; : &quot;Oli_Twi&quot; }
    },
    { &quot;ns1&quot; : { &quot;title&quot; : &quot;Robinson Crusoe&quot;, &quot;price&quot; : 15.99 },
       &quot;ns2&quot; : { &quot;title&quot; : &quot;Rob_Cru&quot; }
    }
  ]
}

The processor, being namespace-aware, could create the namespaces within the object on the fly, and put the data in the appropriate place.  Developers would have a choice between speed (no processing, but have to use bracket notation) or a more robust data structure (processing to give the namespace-based structure).

What do you think?  Am I nuts?  (err, don&#039;t answer that! LOL)</description>
		<content:encoded><![CDATA[<p>My gut reaction to that approach to collision avoidance is that it&#8217;s too complex (although I totally groove on the idea of schemas for JSON in general).  I totally get where you&#8217;re going Kris, and it makes sense, it just seems like to much of XML in JSON, in terms of definitional (if you&#8217;ll let me invent a word!) complexity.</p>
<p>I do have an alternate idea to offer&#8230;</p>
<p>What if you did something like this:</p>
<p>Content-Type: application/json; schema=ns1:<a href="http://www.book-warehouse.com/book-schema,ns2:http://www.mybokos.com/book-schema" rel="nofollow">http://www.book-warehouse.com/book-schema,ns2:http://www.mybokos.com/book-schema</a><br />
{<br />
  &#8220;books&#8221; : [<br />
    { "ns1.title" : "Oliver Twist", "ns2.title" : "Oli_Twi",<br />
      "ns1.price" : 16.99<br />
    },<br />
    { "ns2.title" : "Robinson Crusoe", "ns2.title" : "Tob_Cru",<br />
      "ns1.price" : 15.99<br />
    }<br />
  ]<br />
}</p>
<p>That would allow for multiple schemas to be specified, each identified by a namespace identifier.  When this JSON is used to reconstitute the object it defined, you would have to do&#8230;</p>
<p>alert(o.books[0]["ns2.title"]);</p>
<p>&#8230;to access its data and still maintain namespace awareness, so you lose the pure dot notation approach.  Not ideal, but I could live with that I think.</p>
<p>You might not have to give that up though&#8230; I could certainly envision a JSON processor that took in the JSON and created an object from it where the structure would wind up being:</p>
<p>{<br />
  &#8220;books&#8221; : [<br />
    {<br />
      "ns1" : { "title" : "Oliver Twist", "price" : 16.99 },<br />
      "ns2" : { "title" : "Oli_Twi" }<br />
    },<br />
    { "ns1" : { "title" : "Robinson Crusoe", "price" : 15.99 },<br />
       "ns2" : { "title" : "Rob_Cru" }<br />
    }<br />
  ]<br />
}</p>
<p>The processor, being namespace-aware, could create the namespaces within the object on the fly, and put the data in the appropriate place.  Developers would have a choice between speed (no processing, but have to use bracket notation) or a more robust data structure (processing to give the namespace-based structure).</p>
<p>What do you think?  Am I nuts?  (err, don&#8217;t answer that! LOL)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kriszyp</title>
		<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing/comment-page-1#comment-275413</link>
		<dc:creator>kriszyp</dc:creator>
		<pubDate>Wed, 09 Sep 2009 22:26:20 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7334#comment-275413</guid>
		<description>@genericallyloud: You map the title property to another property name with the schema (explained under &quot;Collisions (how to really avoid them)&quot; section).</description>
		<content:encoded><![CDATA[<p>@genericallyloud: You map the title property to another property name with the schema (explained under &#8220;Collisions (how to really avoid them)&#8221; section).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: genericallyloud</title>
		<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing/comment-page-1#comment-275412</link>
		<dc:creator>genericallyloud</dc:creator>
		<pubDate>Wed, 09 Sep 2009 21:00:39 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7334#comment-275412</guid>
		<description>I&#039;m with Aadaam. I must be missing something, but does this allow for a single json object to use properties from multiple namespaces? How would you have a &quot;title&quot; attribute from namespaces &quot;a&quot; and &quot;b&quot; on the same object. In xml this would just be 

&lt;book a:title=&quot;Oliver Twist&quot; b:title=&quot;Other title&quot;/&gt;

Obviously a contrived example, but you get my point.</description>
		<content:encoded><![CDATA[<p>I&#8217;m with Aadaam. I must be missing something, but does this allow for a single json object to use properties from multiple namespaces? How would you have a &#8220;title&#8221; attribute from namespaces &#8220;a&#8221; and &#8220;b&#8221; on the same object. In xml this would just be </p>
<p>&lt;book a:title=&#8221;Oliver Twist&#8221; b:title=&#8221;Other title&#8221;/&gt;</p>
<p>Obviously a contrived example, but you get my point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kriszyp</title>
		<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing/comment-page-1#comment-275411</link>
		<dc:creator>kriszyp</dc:creator>
		<pubDate>Wed, 09 Sep 2009 16:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7334#comment-275411</guid>
		<description>@Aadaam: That&#039;s the main topic of the article.</description>
		<content:encoded><![CDATA[<p>@Aadaam: That&#8217;s the main topic of the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aadaam</title>
		<link>http://ajaxian.com/archives/getting-hyper-about-json-namespacing/comment-page-1#comment-275408</link>
		<dc:creator>Aadaam</dc:creator>
		<pubDate>Wed, 09 Sep 2009 13:40:35 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7334#comment-275408</guid>
		<description>OK, what about mixed-namespace documents, of what all the namespacing hype in XML is about?</description>
		<content:encoded><![CDATA[<p>OK, what about mixed-namespace documents, of what all the namespacing hype in XML is about?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

