RDF::RDFa::Parser - RDFa parser using XML::LibXML.
use RDF::RDFa::Parser; $parser = RDF::RDFa::Parser->new($xhtml, $baseuri); $parser->set_callbacks(\&func1, \&func2); $parser->consume;
0.02
This method creates a new RDF::RDFa::Parser object and returns it. The XHTML document is parsed using XML::LibXML, which will throw an exception if it is not well-formed. RDF::RDFa::Parser does not catch the exception. The base URI is used to resolve relative URIs found in the document.
RDF::RDFa::Parser
The document is parsed for RDFa. Nothing of interest is returned by this function, but the triples extracted from the document are passed to the callbacks as each one is found.
Set callbacks for handling RDF triples extracted from RDFa document. The first function is called when a triple is generated taking the form of (resource, resource, resource). The second function is called when a triple is generated taking the form of (resource, resource, literal).
The parameters passed to the first callback function are:
* A reference to the RDF::RDFa::Parser object * A reference to the XML::LibXML element being parsed * Subject URI or bnode * Predicate URI * Resource URI or bnode
The parameters passed to the second callback function are:
* A reference to the RDF::RDFa::Parser object * A reference to the XML::LibXML element being parsed * Subject URI or bnode * Predicate URI * Resource literal * Datatype URI (possibly undef or '') * Language (possibly undef or '')
RDF::RDFa::Parser has a feature that allows it to use thing-described-by.org to create URIs for some blank nodes. It is disabled by default. This function can be used to turn it on (1) or off (0). May be called without a parameter which just returns the current status.
Returns the parsed XML::LibXML::Document.
http://buzzword.org.uk/swignition/rdfa
Copyright 2008, 2009 Toby Inkster This file is dual licensed under: The Artistic License GNU General Public License 3.0 You may choose which of those two licences you are going to honour the terms of, but you cannot pick and choose the parts which you like of each. You must fulfil the licensing requirements of at least one of the two licenses. The Artistic License <http://www.perl.com/language/misc/Artistic.html> GNU General Public License 3.0 <http://www.gnu.org/licenses/gpl-3.0.html> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
To install RDF::RDFa::Parser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::RDFa::Parser
CPAN shell
perl -MCPAN -e shell install RDF::RDFa::Parser
For more information on module installation, please visit the detailed CPAN module installation guide.