
Apache::XPointer::RDQL::RDFStore - mod_perl handler to address XML fragments using the RDF Data Query Language.

<Directory /foo/bar> <FilesMatch "\.rdf$"> SetHandler perl-script PerlHandler Apache::XPointer::RDQL::RDFStore PerlSetVar XPointerSendRangeAs "XML" </FilesMatch> </Directory> # my $ua = LWP::UserAgent->new(); my $req = HTTP::Request->new(GET => "http://example.com/foo/bar/baz.rdf"); $req->header("Range" => qq(SELECT ?title, ?link WHERE (?item, <rdf:type>, <rss:item>), (?item, <rss::title>, ?title), (?item, <rss::link>, ?link) USING rdf for <http://www.w3.org/1999/02/22-rdf-syntax-ns#>, rss for <http://purl.org/rss/1.0/>)); my $res = $ua->request($req);

Apache::XPointer is a mod_perl handler to address XML fragments using the HTTP 1.1 Range header and the RDF Data Query Language (RDQL), as described in the paper : A Semantic Web Resource Protocol: XPointer and HTTP.
Additionally, the handler may also be configured to recognize a conventional CGI parameter as a valid range identifier.
If no 'range' property is found, then the original document is sent unaltered.

If set to On then the handler will check the CGI parameters sent with the request for an argument defining an XPath range.
CGI parameters are checked only if no HTTP Range header is present.
Case insensitive.
The name of the CGI parameter to check for an XPath range.
Default is range
Returns matches as type multipart/mixed :
--match
Content-type: text/xml; charset=UTF-8
<rdf:RDF
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:rdfstore='http://rdfstore.sourceforge.net/contexts/'
xmlns:voc0='http://purl.org/rss/1.0/'>
<rdf:Description rdf:about='rdf:resource:rdfstore123'>
<voc0:title>The Daily Cartoon for November 15</voc0:title>
<voc0:link>http://feeds.feedburner.com/BenHammersleysDangerousPrecedent?m=1</voc0:link>
</rdf:Description>
</rdf:RDF>
--match
Content-type: text/xml; charset=UTF-8
<rdf:RDF
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:rdfstore='http://rdfstore.sourceforge.net/contexts/'
xmlns:voc0='http://purl.org/rss/1.0/'>
<rdf:Description rdf:about='rdf:resource:rdfstore456'>
<voc0:title>Releasing RadioPod</voc0:title>
<voc0:link>http://feeds.feedburner.com/BenHammersleysDangerousPrecedent?m=178</voc0:link>
</rdf:Description>
</rdf:RDF>
--match--
Return matches as type application/rdf+xml :
<rdf:RDF
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:rdfstore='http://rdfstore.sourceforge.net/contexts/'
xmlns:voc0='http://purl.org/rss/1.0/'>
<rdf:Description rdf:about='rdf:resource:rdfstoreS789'>
<rdf:type rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq' />
<rdf:type rdf:resource='x-urn:cpan:ascope:apache-xpointer-rdql:range'/ >
<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#_1' />
<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#_2' />
</rdf:Description>
<rdf:Description rdf:about='http://www.w3.org/1999/02/22-rdf-syntax-ns#_1'>
<voc0:title>The Daily Cartoon for November 15</voc0:title>
<voc0:link>http://feeds.feedburner.com/BenHammersleysDangerousPrecedent?m=1</voc0:link>
</rdf:Description>
<rdf:Description rdf:about='http://www.w3.org/1999/02/22-rdf-syntax-ns#_2'>
<voc0:title>Releasing RadioPod</voc0:title>
<voc0:link>http://feeds.feedburner.com/BenHammersleysDangerousPrecedent?m=178</voc0:link>
</rdf:Description>
</rdf:RDF>
Default is XML; case-insensitive.

This handler will work with both mod_perl 1.x and mod_perl 2.x; it works better in 1.x because it supports Apache::Request which does a better job of parsing CGI parameters.

1.0

$Date: 2004/11/15 14:42:10 $

Aaron Straup Cope <ascope@cpan.org>


Copyright (c) 2004 Aaron Straup Cope. All rights reserved.
This is free software, you may use it and distribute it under the same terms as Perl itself.