Supports plain XML, HTML, and SVG out-of-the-box, and is extendible for new host languages.
Supported host languages:
RDFaXMLParser - for plain XML documents
RDFaXHTMLParser - for HTML documents delivered in application/xhtml+xml
RDFaHTMLParser - for HTML documents delivered in text/html
File index
bin/httpd.js - an HTTP server for use with the RDFa Test Suite
bin/rdfa-turtle.js - read a file and print extracted triples
defaults.json - list of RDFa Initial Context vocabulary & terms
index.js - the bulk of the logic
test/suite.js - runs the library against a local copy of the RDFa test suite
API
parseDOM(Processor, base, document, options)
Extracts RDF statements out of a DOM document document, assuming a URI base base (always ignoring the URI in the DOM node, if any).
Returns an RDFaParser instance (see below).
Processor: a reference to a subclass of RDFaParser
base: the URI base for the document (where the document was downloaded from)
document: DOM document
options: object with additional configuration
forceVersion: RDFa version to use. This is normally detected.
defaultLanguage: default language for when no language is specified by the document (use the language specified in the Content-Language header, if any)