RDF::Closure::Model - RDF::Trine::Model-compatible inferface
This module provides a subclass of RDF::Trine::Model allowing you to dollop some reasoning into existing RDF::Trine code very easily. While RDF::Closure::Engine allows you to infer lots of new statements from an existing model, this class also allows you to add and remove statements from the reasoned model with new inferences calculated on-the-fly.
Removing a statement is much slower than adding one, though adding a statement isn't what you'd call fast. Juditious use of begin_bulk_ops and end_bulk_ops is recomnmended.
begin_bulk_ops
end_bulk_ops
If a lot of statements have been added and removed from a model since it was created, then it's theoretically possible for the inferred data to contain statements which are no longer entailed by the explicit data, or for the inferred data to be missing some inferences. A recalculate method is provided which allows you to re-run the inference from scratch.
recalculate
new($input, [, engine => $engine ] [, store => $store ])
Instantiates a module. $input may be undef, an existing RDF::Trine::Model or an RDF::Trine::Store. The input will not be modified.
$engine is the inference engine to use; a string suitable for passing to RDF::Closure::Engine->new; defaults to 'RDFS'.
$engine
RDF::Closure::Engine->new
$store is an RDF::Trine::Store to use to build the inferred model in; defaults to a new, temporary store.
$store
This package inherits from RDF::Trine::Model and provides all the methods it does. It additionally provides:
entailment_regime
Returns a URI string identifying the type of inference in use.
Drops and re-infers all inferred data.
RDF::Closure, RDF::Closure::Engine, RDF::Trine::Model.
Take careful note of the begin_bulk_ops and end_bulk_ops methods present in RDF::Trine::Model. Judicious use of them can seriously speed up this module.
http://www.perlrdf.org/.
Toby Inkster <tobyink@cpan.org>.
Copyright 2011-2012 Toby Inkster
This library is free software; you can redistribute it and/or modify it under any of the following licences:
The Artistic License 1.0 http://www.perlfoundation.org/artistic_license_1_0.
The GNU General Public License Version 1 http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt, or (at your option) any later version.
The W3C Software Notice and License http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231.
The Clarified Artistic License http://www.ncftp.com/ncftp/doc/LICENSE.txt.
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.
To install RDF::Closure, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::Closure
CPAN shell
perl -MCPAN -e shell install RDF::Closure
For more information on module installation, please visit the detailed CPAN module installation guide.