DESCRIPTION

While RDF::RDFa::Parser is a good RDFa parser, its interface is a tad... shall we say... crufty.

RDF::TrineX::Parser::RDFa provides a much nicer interface, and is a subclass of RDF::Trine::Parser, so you get super-polymorphic benefits. Yay!

Class Method

As per the method of the same name in RDF::Trine::Parser, this retrieves the \s-1URL\s0 and parses it into a model. Unlike RDF::Trine::Parser, this method always assumes you're trying to parse some variety of RDFa.

Constructor

Constructs a new RDF::TrineX::Parser::RDFa parser. The two important options are flavour (which defaults to 'xhtml') and version (which defaults to '1.1'). Other options are documented in RDF::RDFa::Parser::Config. Let's imagine that you want to parse RDFa 1.1 in \s-1HTML5\s0, and you want to also parse the \*(C`role\*(C', \*(C`longdesc\*(C' and \*(C`cite\*(C' attibutes (which are not strictly part of RDFa, but nevertheless often interesting). Then you'd use:

  my $parser = RDF::TrineX::Parser::RDFa->new(
    flavour        => 'html5',
    version        => '1.1',
    role_attr      => 1,
    longdesc_attr  => 1,
    cite_attr      => 1,
  );

Object Methods

The following methods are supported, as documented in RDF::Trine::Parser.

The following additional methods are supported: Returns the RDFa host language being used. Returns the RDFa version number being used.

Subclasses

The following subclasses of RDF::TrineX::Parser::RDFa exist:

RDF::TrineX::Parser::XHTML_RDFa10
RDF::TrineX::Parser::HTML32_RDFa10
RDF::TrineX::Parser::HTML4_RDFa10
RDF::TrineX::Parser::HTML5_RDFa10
RDF::TrineX::Parser::XHTML5_RDFa10
RDF::TrineX::Parser::Atom_RDFa10
RDF::TrineX::Parser::DataRSS_RDFa10
RDF::TrineX::Parser::SVG_RDFa10
RDF::TrineX::Parser::XML_RDFa10
RDF::TrineX::Parser::OpenDocument_RDFa10
RDF::TrineX::Parser::XHTML_RDFa11
RDF::TrineX::Parser::HTML32_RDFa11
RDF::TrineX::Parser::HTML4_RDFa11
RDF::TrineX::Parser::HTML5_RDFa11
RDF::TrineX::Parser::XHTML5_RDFa11
RDF::TrineX::Parser::Atom_RDFa11
RDF::TrineX::Parser::DataRSS_RDFa11
RDF::TrineX::Parser::SVG_RDFa11
RDF::TrineX::Parser::XML_RDFa11
RDF::TrineX::Parser::OpenDocument_RDFa11

By using these classes, you can skip the need to pass the 'flavour' and 'version' options to the constructor. For example:

my $parser = RDF::TrineX::Parser::HTML5_RDFa11->new( role_attr => 1, longdesc_attr => 1, cite_attr => 1, );

Note that these are classes, but they are not modules. You should not attempt to load them with \*(C`require\*(C' or \*(C`use\*(C'.

RELATED TO RDF::TrineX::Parser::RDFa…

RDF::Trine::Parser, RDF::RDFa::Parser, RDF::RDFa::Parser::Config.

<http://www.perlrdf.org/>, <http://rdfa.info/>.

AUTHOR

Toby Inkster <[email protected]>.

COPYRIGHT AND LICENCE

Copyright 2012 Toby Inkster

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES

\s-1THIS\s0 \s-1PACKAGE\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.