= RdfContext Context-sensitive RDF Graphs, including a ConjunctiveGraph. A set of compliant RDF parsers: * N3-rdf * RDF/XML * RDFa Multiple datastores may be attached to a Graph, including Memory, List and SQLite3 == DESCRIPTION: RdfContext is an RDF library for Ruby. == FEATURES: RdfContext parses RDF/XML, RDFa and N3-rdf into a Graph object. It also serializes RDF/XML and N-Triples from the Graph. * Fully compliant RDF/XML parser. * Fully compliant XHTML/RDFa 1.0 parser. * N3-rdf parser * N-Triples and RDF/XML serializer * RDFa tests use SPARQL for most tests due to Rasqal limitations. Other tests compare directly against N-triples. * Graph serializes into RDF/XML and N-Triples. * ConjunctiveGraph, named Graphs and contextual storage modules. RdfContext is based, in part, on Tom Morris' Reddy gem. Install with 'gem install rdf_context' == Usage: === Graphs Instantiate a graph using Graph.new. A Graph may take an :identifier (defaults to a BNode) and a :store (defaults to :list_store) use RdfContext g = Graph.new(:store => :list_store, :identifier => URIRef.new("http://example.com")) g = Graph.new(:store => SQLite3Store.new(:path => "store.db"), :identifier => URIRef.new("http://example.com")) g.add(Triple.new(subject, predicate, object)) Graphs also store namespace associations, and can serialize graphs to RDF/XML or N-triples g.bind(Namespace.new("http://example.com", "ex")) g.namespace("ex") g.prefix("http://example.com") g.to_rdfxml g.to_ntriples Instantiate an existing graph from a datastore s = SQLIte3Store.new(:path => "store.db") g = Graph.new(:store => s, :identifier => "http://example.com/context") === Parsers Instantiate a parser and parse source, specifying type and base-URL use RdfContext p = Parser.new graph = p.parse(input, "http://example.com", :type => :rdfxml) or, instantiate a type-specific parser: p = RdfaParser.new graph = p.parse(input, "http://example.com") or, parse directly into a graph g = Graph.new(:identifier => "http://example.com", :store => :sqlite3_store) g.parse(input, "http://example.com", :type => :rdfxml) === Data Stores ListStore:: simple non-context aware datastore based on Array MemoryStore:: context aware datastore using multiple hashes to optimize triple lookkup SQLite3Store:: context aware datastore using a SQLite3 database to create a persistent storage model == Dependencies: * Addressable * Treetop * Whatlanguage * nokogiri * builder === For testing * Redland/Rasqal * ActiveSupport == INSTALL: * sudo gem install rdf_context == TODO: * Testing * Integrate ntriples tests in spec/ntriples/test.nt * Turtle tests from http://www.w3.org/2000/10/swap/test/n3/turtle-manifest.n3 (if can find .ttl and .out files) * N3-RDF tests from http://www.w3.org/2000/10/swap/test/n3/n3-rdf.tests * N3-Full tests from http://www.w3.org/2000/10/swap/test/n3/n3-full.tests * N3 grammar tests? * RDFa updates for new tests and non XHTML representations. * Graphs * n3 serialization * Reasoner/inference engine * SPARQL * RDFS logic and RDF entailment tests * Ruby objects * ActiveRDF-like class support * Integrate with RDFObjects (http://github.com/rsinger/RDFObjects) == LICENSE: (The MIT License) Copyright (c) 2009 Gregg Kellogg Copyright (c) 2008 Tom Morris and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. == FEEDBACK * gregg@kellogg-assoc.com * gemcutter.org/rdf_context * github.com/gkellogg/rdf_context * gkellogg.lighthouseapp.com for bug reports * public-rdf-ruby mailing list on w3.org