Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Ruby Microdata parser for RDF.rb
branch: develop

Release 2.0.1

* Simplify error detection and handling, and guard against recursive `@itemref`.
* Only consider data and meter elements if they have an @value attribute.
latest commit b80c08885f
@gkellogg gkellogg authored
Failed to load latest commit information.
etc Generate doap versions using this version of Microdata.
examples Some examples.
lib/rdf Only consider data and meter elements if they have an @value attribute.
script Make sure registry_uri is processed for each invocation, allowing it …
spec Placate JRuby Nokogiri not liking itemscope without a value.
.gitignore Release 1.0.0.
.travis.yml Enable Ruby 2.2 in Travis-CI.
Gemfile Yardoc updates.
README First commit, completed, but un-debugged, reader. Update README to clarify question #3.
Rakefile Update doap generation and description to include doap:implements.
UNLICENSE First commit, completed, but un-debugged, reader.
VERSION Version 2.0.1.
rdf-microdata.gemspec Update processing for new version of note.

RDF::Microdata reader/writer

Microdata parser for RDF.rb.

Gem Version Build Status


RDF::Microdata is a Microdata reader for Ruby using the RDF.rb library suite.


RDF::Microdata parses Microdata into statements or triples using the rules defined in Microdata RDF.

  • Microdata parser.
  • Uses Nokogiri for parsing HTML

Install with 'gem install rdf-microdata'

Living implementation

Microdata to RDF transformation is undergoing active development. This implementation attempts to be up-to-date as of the time of release, and is being used in developing the Microdata RDF specification.

This implementation includes support for the proposed @itemprop-reverse attribute.

Microdata Registry

The parser uses a build-in version of the Microdata RDF registry.


Reading RDF data in the Microdata format

require 'rdf/microdata'
graph = RDF::Graph.load("etc/doap.html", :format => :microdata)

Reading using content-negotation

require 'rdf/microdata'
graph = RDF::Graph.load("etc/doap.html", :content_type => "text/html")


This spec is based on the W3C HTML Data Task Force specification and does not support GRDDL-type triple generation, such as for html>head>title anchor tags.

If the RDFa parser is available, {RDF::Microdata::Format} will not assert content type text/html or file extension .html, as this is also asserted by RDFa. Instead, the RDFa reader will invoke the microdata reader if an @itemscope attribute is detected.



Full documentation available on

Principle Classes

  • {RDF::Microdata::Format} Asserts :html format, text/html mime-type and .html file extension.
  • {RDF::Microdata::Reader}
    • {RDF::Microdata::Reader::Nokogiri}

Additional vocabularies




  • 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.


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


Something went wrong with that request. Please try again.