updates to RDF::Trine
Toby Inkster
mail at tobyinkster.co.uk
Fri Dec 25 12:24:16 CET 2009
On Thu, 2009-12-24 at 21:33 -0800, Gregory Williams wrote:
> 1) An RDFa parser (a trivial wrapper around tobyink's
> RDF::RDFa::Parser module)
This fakes streaming parsing, by getting the full graph and iterating
though it, but using RDF::RDFa::Parser's callbacks it could perform
proper streaming parsing.
The callbacks are a little annoying to use right now because they don't
get passed RDF::Trine::Statement objects, but rather strings containing
URIs, literals, etc. I hope to make callbacks a little nicer in 0.30.
> 2) A function for parsing RDF content from a URL with proper parser
> dispatching based on mime-type. This allows really trivial parsing of
> content:
>
> RDF::Trine::Parser->parse_url_into_model( $url, $model );
Given that RDF::Trine::Parser will have access to the HTTP::Response
object, you may want to consider (at least, optionally):
use HTTP::Link::Parser;
parse_links_into_model($resp, $model);
Also, note that this regexp doesn't do what you want it to do:
/(turtle|rdf+xml)/
--
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>
More information about the Dev
mailing list