- From: Garret Wilson <garret@globalmentor.com>
- Date: Thu, 26 Jul 2007 14:11:45 -0700
- To: Semantic Web <semantic-web@w3.org>
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?
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 21:11:51 UTC