Toby Inkster > RDF-Closure > RDF::Closure

Download:
RDF-Closure-0.001.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.001   Source  

NAME ^

RDF::Closure - pure Perl RDF inferencing

SYNOPSIS ^

 use RDF::Trine::Iterator qw[sgrep];
 use RDF::Closure qw[iri mk_filter FLT_NONRDF FLT_BORING];
 
 my $data = iri('http://bloggs.example.com/foaf.rdf');
 my $foaf = iri('http://xmlns.com/foaf/0.1/index.rdf');
 
 my $model = RDF::Trine::Model->temporary_model;
 my $p     = 'RDF::Trine::Parser';
 $p->parse_url_into_model($data->uri, $model, context => $data->uri);
 $p->parse_url_into_model($foaf->uri, $model, context => $foaf->uri);
 
 my $cl = RDF::Closure::Engine->new('rdfs', $model);
 $cl->closure;
 
 my $filter = mk_filter(FLT_NONRDF|FLT_BORING, [$foaf]);  
 my $output = &sgrep($filter, $model->as_stream);
 
 print RDF::Trine::Serializer
   ->new('RDFXML')
   ->serialize_iterator_to_string($output);

DESCRIPTION ^

This distribution is a pure Perl RDF inference engine designed as an add-in for RDF::Trine. It is largely a port of Ivan Herman's Python RDFClosure library, though there has been some restructuing, and there are a few extras thrown in.

Where one of the Perl modules has a direct equivalent in Ivan's library, this is noted in the POD.

Functions

This package inherits from RDF::Trine and exports the same functions, plus:

For convenience, RDF::Closure also exports variables called $RDF, $RDFS, $OWL and $XSD which are RDF::Trine::Namespace objects.

SEE ALSO ^

RDF::Closure::Engine, RDF::Closure::Model, RDF::Trine::Parser::OwlFn.

RDF::Trine, RDF::Query.

http://www.perlrdf.org/.

http://www.ivan-herman.net/Misc/2008/owlrl/.

AUTHOR ^

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT ^

Copyright 2011-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under any of the following licences:

DISCLAIMER OF WARRANTIES ^

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

syntax highlighting: