Skip to content

Instantly share code, notes, and snippets.

@artob
Created April 2, 2010 04:14
Show Gist options
  • Save artob/352741 to your computer and use it in GitHub Desktop.
Save artob/352741 to your computer and use it in GitHub Desktop.
RDF.rb <-> RdfContext mapping (work-in-progress)

RDF.rb === RdfContext

This is a quick overview and mapping between RDF.rb and RdfContext, two RDF libraries for Ruby, to serve as an aid in determining whether the projects would benefit from aligning goals and direction.

An experimental fork of RdfContext that attempts some integration between the two object models:

General Notes

  • RDF.rb draws on Sesame's design, RdfContext on RDFLib's; hence e.g. some differences in naming.
  • RDF.rb's focus is primarily on the object model and interfaces, RdfContext's on supporting the most important serialization formats.
  • RDF.rb tends toward minimalism, RdfContext towards full-featuredness.

Object Model

RDF.rb                          | RdfContext
--------------------------------|--------------------------------
RDF::Value                      | -
  RDF::Resource                 | -
    RDF::Node                   | RdfContext::BNode
    RDF::URI                    | RdfContext::URIRef
  RDF::Literal                  | RdfContext::Literal
RDF::Statement                  | RdfContext::Triple
RDF::Graph                      | RdfContext::Graph
-                               |   RdfContext::AggregateGraph
-                               |   RdfContext::ConjunctiveGraph
-                               |   RdfContext::QuotedGraph

Graph APIs

RDF.rb                          | RdfContext
--------------------------------|--------------------------------
RDF::Enumerable                 | RdfContext::Graph
RDF::Durable                    | RdfContext::Graph
RDF::Mutable                    | RdfContext::Graph
RDF::Queryable                  | RdfContext::Graph

Vocabulary API

RDF.rb                          | RdfContext
--------------------------------|--------------------------------
RDF::Vocabulary                 | RdfContext::Namespace

Reader/Writer API

RDF.rb                          | RdfContext
--------------------------------|--------------------------------
RDF::Format                     | -
RDF::Reader                     | RdfContext::Parser
  RDF::ReaderError              |   RdfContext::ParserException
RDF::Writer                     | -
  RDF::WriterError              | -

Readers/Writers

RDF::NTriples                   | RdfContext::N3Parser
  RDF::NTriples::Reader         |   RdfContext::N3Parser
  RDF::NTriples::Writer         |   #to_ntriples
RDF::Raptor::Turtle (plugin)    | RdfContext::N3Parser
RDF::Raptor::RDFXML (plugin)    | RdfContext::RdfXmlParser
  RDF::Raptor::RDFXML::Reader   |   RdfContext::RdfXmlParser
  RDF::Raptor::RDFXML::Writer   |   #to_rdfxml
RDF::JSON (plugin)              | -
RDF::TriX (plugin)              | -
-                               | RdfContext::RdfaParser

Repository API

RDF.rb                          | RdfContext
--------------------------------|--------------------------------
RDF::Repository                 | RdfContext::AbstractStore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment