W3C home > Mailing lists > Public > semantic-web@w3.org > July 2007

Re: RDFON: a new RDF serialization

From: Tim Berners-Lee <timbl@w3.org>
Date: Thu, 26 Jul 2007 18:52:33 -0400
Message-Id: <2B018142-FC6F-4D44-B1AF-7FD9943DE86E@w3.org>
Cc: Semantic Web <semantic-web@w3.org>
To: Garret Wilson <garret@globalmentor.com>
Garret,


Why not use Notation3?  It has been around for around many years.   
There are lots of parsers. It is designed with JUST the motivations  
you mention.

Some of us have spent a huge amount of effort trying to make sure  
that Turtle and NTriples are subsets of N3, and that the graph syntax  
within SPARQL is very close to N3.  This is all to help keep the  
learning curve down, and allow reuse of code, and wider  
interoperability.  Please suggest your AJAX friends use N3 instead.   
They are welcome to use our AJAX  RDF library  (AJAR) which parse RDF/ 
XML and N3.  It is beta code, see  http://dig.csail.mit.edu/2005/ajar/ 
ajaw/Developer.html

	Spec: http://www.w3.org/DesignIssues/Notation3
	Tutorial: http://www.w3.org/2000/10/swap/doc/Overview.html
	Other resources: http://www.w3.org/DesignIssues/N3Resources
		including test suites, implementations, etc.

Tim



On 2007-07 -26, at 17:11, Garret Wilson wrote:

>
> I'm very happy for the encouragement from Sandro and Benjamin to  
> push for an RDF 2.0. ;) I have several problems with RDF itself,  
> but many more problems stem from one particular serialization: RDF/ 
> XML.
>
> Let's face it---RDF is getting nowhere near the acceptance it  
> should. Why? RDF/XML has much to blame. It's hard to understand and  
> verbose---not to mention being unable to represent common RDF data  
> easily. I almost got RDF into the Open eBook Publication Structure  
> back in 2001 by simplifying the RDF/XML (see http:// 
> www.xpackage.org/story/ ), but that fell through---RDF still seemed  
> too difficult to understand, and RDF/XML just looks like a mess to  
> the uninitiated. XML was a cool thing a decade ago (especially  
> compared to SGML), and it still is fine for holding unstructured  
> data such as marked-up text (e.g. HTML and Docbook), but it's  
> beginning to get ragged along the edges when holding loosely  
> structured data such as RDF.
>
> One very active member in the Ajax community has indicated to me  
> personally his disgust for RDF, but when it came down to it, the  
> real problem for him was RDF/XML. Yet these same people in the Ajax  
> community love something call JavaScript Object Notation (JSON)---a  
> subset of JavaScript notation that can be evaluated directly within  
> the language to create JavaScript structures. It's simple and  
> almost self-explanatory. But it doesn't support RDF. Almost. But  
> not quite.
>
> So I will soon (once it's fully baked) propose a new serialization  
> of RDF that closely resembles JSON. I call it RDFON, for RDF Object  
> Notation. It handles single values and lists with ease, handles  
> literals in lists with no problem, and is easy to understand. It's  
> tiny. And it's even set to be compatible with RDF 2.0, once I get a  
> chance to work on it.
>
> So let's start with an example. Here's FOAF/VCard information in  
> RDF/XML:
>
> <rdf:RDF
>    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema-datatypes"
>    xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
>    xmlns:foaf="http://xmlns.com/foaf/0.1/"
>    xmlns:eg="http://www.example.com/"
> >
>    <foaf:Person rdf:about="urn:uuid:ca00db92-0f7f-434b- 
> b254-8a6afcf57907">
>        <vcard:name>
>            <vcard:Name>
>                <vcard:givenName>Mary Jane</vcard:givenName>
>                <vcard:familyName rdf:parseType="Collection">
>                    <rdf:Description rdf:value="Smith"/>
>                    <rdf:Description rdf:value="Van Buren"/>
>                </vcard:familyName>
>            </vcard:Name>
>        </vcard:name>
>        <vcard:bday rdf:datatype="xsd:date">1980-01-01</vcard:bday>
>        <eg:married rdf:datatype="xsd:boolean">true</eg:married>
>        <eg:childCount rdf:datatype="xsd:integer">2</eg:childCount>
>        <eg:custom rdf:datatype="eg:datatype">value</eg:custom>
>    </foaf:Person>
> </rdf:RDF>
>
>
> Nasty stuff, huh? I even had to throw in some rdf:value properties  
> to get multiple family name literals. Let's look at the same thing  
> in RDFON:
>
> (
>    rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
>    xsd:<http://www.w3.org/2001/XMLSchema-datatypes>,
>    vcard:<http://www.w3.org/2006/vcard/ns#>,
>    foaf:<http://xmlns.com/foaf/0.1/>,
>    eg:<http://www.example.com/>
> )
> foaf.Person(<urn:uuid:ca00db92-0f7f-434b-b254-8a6afcf57907>)
> {
>    vcard.name:vcard.Name()
>        {
>            vcard.givenName:"Mary Jane",
>            vcard.familyName:["Smith", "Van Buren"]
>        },
>    vcard.bday:@1980-01-01,
>    eg.married:true,
>    eg.childCount:123,
>    eg.custom:eg.datatype("value")
> }
>
> Isn't that beautiful?

Well, I prefer:

     @prefix : <http://www.w3.org/2006/vcard/ns#> .
     @prefix eg: <http://www.example.com/#> .
     @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

     <urn:uuid:ca00db92-0f7f-434b-b254-8a6afcf57907>     a <http:// 
xmlns.com/foaf/0.1/Person>;
          eg:childCount 2;
          eg:custom "value"^^eg:datatype;
          eg:married true;
          :bday "1980-01-01"^^<http://www.w3.org/2001/XMLSchema#date>;
          :name  [
                 a :Name;
                 :familyName  ( "Smith"  "Van Buren" );
                 :givenName "Mary Jane"
           ] .

The only thing I notice you put in RDFON which we didn't put in N3  
was the literal date format.
You can't execute N3 as javascript, but that can be an advantage,  
securitywise.

>
> Just so you know, I used a few RDFON shortcuts for xsd:date,  
> xsd:boolean, and xsd:integer. Those could have been the equivalent  
> full form:
>
>    vcard.bday:xsd.date("1980-01-01"),
>    eg.married:xsd.boolean("true"),
>    eg.childCount:xsd:integer("123"),
>
>
> In my opinion, RDFON is a huge achievement. This could bring great  
> simplicity to RDF serialization and aid understanding by the  
> masses. And the Ajax community should jump on board, as it solves a  
> few JSON problems (see http://www.nikhilk.net/ 
> DateSyntaxForJSON.aspx ) while bringing a whole lot of benefits.  
> Maybe we could get it into ECMAScript. Basically, it's about the  
> simplest thing you can get for RDF serialization.
>
> I've been mulling this for years, but it only started to be fully  
> gelled this morning. I'll put up an actual specification once it  
> gels further.
>
> Garret


Received on Thursday, 26 July 2007 22:52:41 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 08:45:01 UTC