ruby-rdf / rdf-rdfxml

Ruby RDF/XML reader/writer for RDF.rb.
http://rubygems.org/gems/rdf-rdfxml
The Unlicense
17 stars 7 forks source link

RDF::RDFXML reader/writer

RDF/XML reader/writer for RDF.rb.

Gem Version Build Status Coverage Status Gitter chat

DESCRIPTION

RDF::RDFXML is an RDF/XML reader/writer for Ruby using the RDF.rb library suite.

FEATURES

RDF::RDFXML parses RDF/XML into statements or triples and serializes triples, statements or graphs. It also serializes graphs to RDF/XML.

Fully compliant RDF/XML parser and serializer.

Install with gem install rdf-rdfxml

Usage:

Instantiate a parser and parse source, specifying type and base-URL

RDF::RDFXML::Reader.open("./etc/doap.xml") do |reader|
  reader.each_statement do |statement|
    puts statement.inspect
  end
end

Define xml:base and xmlns definitions, and use for serialization using :base_uri an :prefixes options.

Canonicalize and validate using :canonicalize and :validate options.

Write a graph to a file:

RDF::RDFXML::Writer.open("etc/test.ttl") do |writer|
   writer << graph
end

Change Log

See Release Notes on GitHub

Dependencies

Documentation

Full documentation available on Rubydoc.info)

Principle Classes

Resources

Author

Contributors

Contributing

This repository uses Git Flow to mange development and release activity. All submissions must be on a feature branch based on the develop branch to ease staging and integration.

License

This is free and unencumbered public domain software. For more information, see https://unlicense.org/ or the accompanying {file:UNLICENSE} file.

FEEDBACK