Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby RDF/XML reader/writer for RDF.rb.
Ruby
Branch: develop

Release 1.1.4

* Remove whitespace around outer RDF tag; not ideal but it works. (issue #33)
* Add back support for `max_depth` writer option (default 10). (issue #27)
* correct XML escaping of illegal characters in literals (@barmintor)
* Don't write out property value both as attribute and element by expanding attribute key to a URI before removing from properties.
* To work around odd Nokogiri issue with reading files while specifying an encoding, read the file in to memory before passing to Nokogiri. (issue #35)
latest commit 81e6e37bc5
@gkellogg gkellogg authored
Failed to load latest commit information.
etc Update version of RDF/XML implemented, and add as doap:implements.
example-files To work around odd Nokogiri issue with reading files while specifying…
lib/rdf To work around odd Nokogiri issue with reading files while specifying…
script Implement callback modes for #each_statement and #each_triple.
spec Move illegal content writer test to a separate group. Exclude for REX…
.gitignore Improve REXMLX support and use different Gemfiles for pure vs. compil…
.travis.yml Remove whitespace around outer RDF tag; not ideal but it works. (issue
.yardopts Rename readme and add status tags.
AUTHORS Update Nick's contributions.
CONTRIBUTORS Update Nick's contributions.
Gemfile Improve REXMLX support and use different Gemfiles for pure vs. compil…
Gemfile-pure Improve REXMLX support and use different Gemfiles for pure vs. compil…
History.md
README Rename readme and add status tags.
README.md Update version of RDF/XML implemented, and add as doap:implements.
Rakefile Update version of RDF/XML implemented, and add as doap:implements.
UNLICENSE Change license for RDFXML to UNLICENSE
VERSION Version 1.1.4.
rdf-rdfxml.gemspec Improve REXMLX support and use different Gemfiles for pure vs. compil…

README.md

RDF::RDFXML reader/writer

RDF/XML reader/writer for RDF.rb.

Gem Version Build Status

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

  • 100% free and unencumbered public domain software.
  • Implements a complete parser for RDF/XML.
  • Compatible with Ruby >= 1.9.2.

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

Dependencies

Documentation

Full documentation available on Rubydoc.info)

Principle Classes

  • {RDF::RDFXML}
  • {RDF::RDFXML::Format}
  • {RDF::RDFXML::Reader}
  • {RDF::RDFXML::Writer}

Additional vocabularies

  • {RDF::XML}

TODO

  • Consider a SAX-based parser for improved performance

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.

  • Do your best to adhere to the existing coding conventions and idioms.
  • Don't use hard tabs, and don't leave trailing whitespace on any line.
  • Do document every method you add using YARD annotations. Read the tutorial or just look at the existing code for examples.
  • Don't touch the .gemspec, VERSION or AUTHORS files. If you need to change them, do so on your private branch only.
  • Do feel free to add yourself to the CREDITS file and the corresponding list in the the README. Alphabetical order applies.
  • Do note that in order for us to merge any non-trivial changes (as a rule of thumb, additions larger than about 15 lines of code), we need an explicit public domain dedication on record from you.

License

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

FEEDBACK

Something went wrong with that request. Please try again.