W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > August 2011

[ANN] RDF 1.1 Turtle implementation in Ruby

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Mon, 29 Aug 2011 14:38:08 -0400
To: "public-rdf-comments-request@w3.org" <public-rdf-comments-request@w3.org>, "public-rdf-ruby@w3.org" <public-rdf-ruby@w3.org>, W3C SWIG Mailing-List <semantic-web@w3.org>
Message-ID: <4E801EF8-1775-41CF-8773-881284D20F9F@greggkellogg.net>
I've just released rdf-turtle [1] [2], an implementation of the current RDF 1.1 Turtle specification [3] in Ruby for the RDF.rb library suite. Note that the rdf-n3 gem also asserts that it will parse Turtle, but there are some important differences from Notation3 and earlier Turtle specs:

* additional string-literal support 'lit', "lit", '''lit''', and """lit""",
* @prefix support uses SPARQL-like PNAMES instead of the more restrictive QNAMES,
* The empty prefix ":" is no longer a synonym for <#>. Out of spec, it is implemented as <>,
* Uses IRIs instead of URI References.
* For the time being, plain literals are generated without an xsd:string datatype, but literals with an xsd:string datatype are saved as non-datatyped triples in the graph. This will be updated in the future when the rest of the library suite is brought up to date.

The gem supports both parsing from Turtle to a graph and serializing from a graph to Turtle.

Basic usage is fairly simple:

    require 'rdf/turtle'
    graph = RDF::Graph.load("https://raw.github.com/gkellogg/rdf-turtle/master/etc/doap.ttl", :format => :ttl)
    graph.dump(:ttl)

Issues with the spec will be posted to public-rdf-comments@w3.org. Issues with the gem should go to public-rdf-ruby@w3.org
Gregg

[1] http://github.org/gkellogg/rdf-turtle
[2] http://rubygems.org/gems/rdf-turtle
[3] http://www.w3.org/TR/2011/WD-turtle-20110809/
Received on Monday, 29 August 2011 18:39:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 29 August 2011 18:39:26 GMT