Package RDFClosure :: Module OWLRLExtras :: Class OWLRL_Extension
[hide private]
[frames] | no frames]

Class OWLRL_Extension

source code

                Closure.Core --+        
                               |        
      RDFSClosure.RDFS_Semantics --+    
                                   |    
                Closure.Core --+   |    
                               |   |    
           OWLRL.OWLRL_Semantics --+    
                                   |    
CombinedClosure.RDFS_OWLRL_Semantics --+
                                       |
                                      OWLRL_Extension
Known Subclasses:

Additional rules to OWL 2 RL. The initialization method also adds the owl:rational datatype to the set of allowed datatypes with the _strToRational function as a conversion between the literal form and a Rational. The xsd:decimal datatype is also set to be a subclass of owl:rational. Furthermore, the restricted datatypes are extracted from the graph using a separate method in a different module, and all those datatypes are also added to the set of allowed datatypes. In the case of the restricted datatypes and extra subsumption relationship is set up between the restricted and the base datatypes.

Instance Methods [hide private]
 
__init__(self, graph, axioms, daxioms, rdfs=False) source code
 
_subsume_restricted_datatypes(self)
A one-time-rule: all the literals are checked whether they are (a) of type restricted by a faceted (restricted) datatype and (b) whether the corresponding value abides to the restrictions.
source code
 
add_axioms(self)
Add the extra axioms, related to the self restrictions.
source code
 
one_time_rules(self)
This method is invoked only once at the beginning, and prior of, the forward chaining process.
source code
 
restriction_typing_check(self, v, t)
Helping method to check whether a type statement is in line with a possible restriction.
source code
 
rules(self, t, cycle_num)
Go through the additional rules implemented by this module.
source code

Inherited from CombinedClosure.RDFS_OWLRL_Semantics: add_d_axioms, post_process

Inherited from Closure.Core: add_error, closure, empty_stored_triples, flush_stored_triples, get_literal_value, pre_process, store_triple

Static Methods [hide private]

Inherited from CombinedClosure.RDFS_OWLRL_Semantics: add_new_datatype

Class Variables [hide private]
  extra_axioms = [(rdflib.term.URIRef(u'http://www.w3.org/2002/0...
additional axioms that have to be added to the deductive closure (in case the axiomatic triples are required)
Instance Variables [hide private]
array of restricted datatype instances restricted_datatypes
list of the datatype restriction

Inherited from CombinedClosure.RDFS_OWLRL_Semantics: full_binding_triples, rdfs

Inherited from Closure.Core: IMaxNum, added_triples, axioms, daxioms, error_messages, graph, literal_proxies

Method Details [hide private]

__init__(self, graph, axioms, daxioms, rdfs=False)
(Constructor)

source code 
Parameters:
  • graph (rdflib.Graph) - the RDF graph to be extended
  • axioms (Boolean) - whether (non-datatype) axiomatic triples should be added or not
  • daxioms (Boolean) - whether datatype axiomatic triples should be added or not
  • rdfs (boolean) - whether RDFS extension is done
Overrides: OWLRL.OWLRL_Semantics.__init__

_subsume_restricted_datatypes(self)

source code 

A one-time-rule: all the literals are checked whether they are (a) of type restricted by a faceted (restricted) datatype and (b) whether the corresponding value abides to the restrictions. If true, then the literal gets an extra tag as being of type of the restricted datatype, too.

add_axioms(self)

source code 

Add the extra axioms, related to the self restrictions.

Overrides: OWLRL.OWLRL_Semantics.add_axioms

one_time_rules(self)

source code 

This method is invoked only once at the beginning, and prior of, the forward chaining process.

At present, only the L{subsumption} of restricted datatypes<_subsume_restricted_datatypes>} is performed.

Overrides: OWLRL.OWLRL_Semantics.one_time_rules

restriction_typing_check(self, v, t)

source code 

Helping method to check whether a type statement is in line with a possible restriction. This method is invoked by rule "cls-avf" before setting a type on an allValuesFrom restriction.

The method is a placeholder at this level. It is typically implemented by subclasses for extra checks, eg, for datatype facet checks.

Parameters:
  • v - the resource that is to be 'typed'
  • t - the targeted type (ie, Class)
Returns:
boolean
Overrides: OWLRL.OWLRL_Semantics.restriction_typing_check

rules(self, t, cycle_num)

source code 

Go through the additional rules implemented by this module.

Parameters:
  • t - a triple (in the form of a tuple)
  • cycle_num - which cycle are we in, starting with 1. This value is forwarded to all local rules; it is also used locally to collect the bnodes in the graph.
Overrides: OWLRL.OWLRL_Semantics.rules

Class Variable Details [hide private]

extra_axioms

additional axioms that have to be added to the deductive closure (in case the axiomatic triples are required)
Value:
[(rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#hasSelf'),
  rdflib.term.URIRef(u'http://www.w3.org/1999/02/22-rdf-syntax-ns#type\
'),
  rdflib.term.URIRef(u'http://www.w3.org/1999/02/22-rdf-syntax-ns#Prop\
erty')),
 (rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#hasSelf'),
  rdflib.term.URIRef(u'http://www.w3.org/2000/01/rdf-schema#domain'),
  rdflib.term.URIRef(u'http://www.w3.org/1999/02/22-rdf-syntax-ns#Prop\
...