owlrl.DeductiveClosure

class owlrl.DeductiveClosure(closure_class, improved_datatypes=True, rdfs_closure=False, axiomatic_triples=False, datatype_axioms=False)[source]

Entry point to generate the deductive closure of a graph. The exact choice deductive closure is controlled by a class reference. The important initialization parameter is the closure_class, a Class object referring to a subclass of Closure.Core. Although this package includes a number of such subclasses OWLRL_Semantics, RDFS_Semantics, RDFS_OWLRL_Semantics, and OWLRL_Extension, the user can use his/her own if additional rules are implemented.

Note that owl:imports statements are not interpreted in this class, that has to be done beforehand on the graph that is to be expanded.

Parameters:
  • closure_class (subclass of Closure.Core) – A closure class reference.
  • improved_datatypes (bool) – Whether the improved set of lexical-to-Python conversions should be used for datatype handling. See the introduction for more details. Default: True.
  • rdfs_closure (bool) – Whether the RDFS closure should also be executed. Default: False.
  • axiomatic_triples (bool) – Whether relevant axiomatic triples are added before chaining, except for datatype axiomatic triples. Default: False.
  • datatype_axioms (bool) – Whether further datatype axiomatic triples are added to the output. Default: false.
Variables:

improved_datatype_generic – Whether the improved set of lexical-to-Python conversions should be used for datatype handling in general, I.e., not only for a particular instance and not only for inference purposes. Default: False.

__init__(closure_class, improved_datatypes=True, rdfs_closure=False, axiomatic_triples=False, datatype_axioms=False)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(closure_class[, …]) Initialize self.
expand(graph) Expand the graph using forward chaining, and with the relevant closure type.
use_improved_datatypes_conversions() Switch the system to use the improved datatype conversion routines.
use_rdflib_datatypes_conversions() Switch the system to use the generic (RDFLib) datatype conversion routines

Attributes

improved_datatype_generic