This post originated from an RSS feed registered with Ruby Buzz
by .
Original Post: YAML and RDF
Feed Title: cfis
Feed URL: http://cfis.savagexi.com/articles.rss
Feed Description: Charlie's Blog
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by
Latest Posts From cfis
Advertisement
Sean mentioned the idea of using
YAML for MapServer configuration files instead of XML. I wholeheartedly agree.
The most important thing for a configuration file is that it is easily readable
and editable. YAML's simpler syntax and conciseness is a big win in this case.
After reading his article, a brilliant idea occurred to me (well,
at least I thought it was brilliant!) - use YAML to serialize RDF. RDF's
graph data model maps poorly onto XML's hierarchical model, making RDF's XML
serialization format more complicated than RDF itself. This complexity has been
the subject of endless debates and
has led to a number of alternative syntaxes
over the years, such as Notation
3, Turtle, RPV,
etc. Yet none of them have have been widely adopted.
XML's main advantages,
compared
to other serialization formats, are its extensibility, strong internationalization
support and strong tool support.
A quick look at the YAML specification shows
it supports UTF8 and UTF16 encodings, so its internationalization
support looks good (I haven't done any testing to see if the reality is different).
YAML's tool support is also good - you can find YAML parsers for Ruby, Python,
PHP, JavaScript (using the JSONsubset)
and other languages as well.
Just like with XML, you can serialize custom vocabularies using YAML.
However, YAML lacks a schema language. But if you're using RDF and require a
schema, then clearly you will use RDF
schema.
RDF schema reuses the RDF XML serialization format, so I would take
the same approach with YAML and use it to both encode RDF and RDF schemas.
Curious to see what work has been done in this area, I did a quick search.
It turns out that Micah Dubinkosuggested using
YAML for RDF more than three years ago on the xml-dev mailing
list.
As far as implementations, the only example I could find was a Perl module
that
hasn't bee updated since 2003. Now that some of the hype around XML has died
down, and YAML has established itself as a legitimate format, it seems
like a good time to revisit this idea.