Package RDFClosure :: Module RDFSClosure :: Class RDFS_Semantics
[hide private]
[frames] | no frames]

Class RDFS_Semantics

source code

Closure.Core --+
               |
              RDFS_Semantics
Known Subclasses:

RDFS Semantics class, ie, implementation of the RDFS closure graph.

Note that the module does not implement the so called Datatype entailment rules, simply because the underlying RDFLib does not implement the datatypes (ie, RDFLib will not make the literal "1.00" and "1.00000" identical, although even with all the ambiguities on datatypes, this should be made equal...). Also, the so-called extensional entailment rules (Section 7.3.1 in the RDF Semantics document) have not been implemented either.

The comments and references to the various rule follow the names as used in the RDF Semantics document.

Instance Methods [hide private]
 
__init__(self, graph, axioms, daxioms, rdfs) source code
 
add_axioms(self)
Add axioms
source code
 
add_d_axioms(self)
This is not really complete, because it just uses the comparison possibilities that rdflib provides.
source code
 
one_time_rules(self)
Some of the rules in the rule set are axiomatic in nature, meaning that they really have to be added only once, there is no reason to add these in a cycle.
source code
 
rules(self, t, cycle_num)
Go through the RDFS entailment rules rdf1, rdfs4-rdfs12, by extending the graph.
source code

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

Instance Variables [hide private]

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

Method Details [hide private]

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

source code 
Parameters:
  • graph (rdflib.Graph) - the RDF graph to be extended
  • axioms (bool) - whether (non-datatype) axiomatic triples should be added or not
  • daxioms (bool) - whether datatype axiomatic triples should be added or not
  • rdfs (boolean) - whether RDFS inference is also done (used in subclassed only)
Overrides: Closure.Core.__init__

add_axioms(self)

source code 

Add axioms

Overrides: Closure.Core.add_axioms

add_d_axioms(self)

source code 

This is not really complete, because it just uses the comparison possibilities that rdflib provides.

Overrides: Closure.Core.add_d_axioms

one_time_rules(self)

source code 

Some of the rules in the rule set are axiomatic in nature, meaning that they really have to be added only once, there is no reason to add these in a cycle. These are performed by this method that is invoked only once at the beginning of the process.

In this case this is related to a 'hidden' same as rules on literals with identical values (though different lexical values)

Overrides: Closure.Core.one_time_rules

rules(self, t, cycle_num)

source code 

Go through the RDFS entailment rules rdf1, rdfs4-rdfs12, by extending the graph.

Parameters:
  • t - a triple (in the form of a tuple)
  • cycle_num - which cycle are we in, starting with 1. Can be used for some (though minor) optimization.
Overrides: Closure.Core.rules