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
end_bulk_ops is recomnmended.
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.
recalculate method is provided which allows you to re-run the inference from scratch.
new($input, [, engine => $engine ] [, store => $store ])
$engine is the inference engine to use; a string suitable for passing to
RDF::Closure::Engine->new; defaults to 'RDFS'.
$store is an RDF::Trine::Store to use to build the inferred model in; defaults to a new,
This package inherits from RDF::Trine::Model and provides all the methods it does. It additionally provides:
Returns a URI string identifying the type of inference in use.
Drops and re-infers all inferred data.
Take careful note of the
end_bulk_ops methods present in RDF::Trine::Model.
Judicious use of them can seriously speed up this module.
Toby Inkster <firstname.lastname@example.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:
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.