Class OWLRL_Extension_Trimming
source code
Closure.Core --+
|
RDFSClosure.RDFS_Semantics --+
|
Closure.Core --+ |
| |
OWLRL.OWLRL_Semantics --+
|
CombinedClosure.RDFS_OWLRL_Semantics --+
|
OWLRL_Extension --+
|
OWLRL_Extension_Trimming
This Class adds only one feature to OWLRL_Extension: to initialize with a trimming flag set
to True
by default.
This is pretty experimental and probably contentious: this class
removes a number of triples from the Graph at the very end of the
processing steps. These triples are either the by-products of the
deductive closure calculation or are axiom like triples that are added
following the rules of OWL 2 RL. While these triples are necessary
for the correct inference of really 'useful' triples, they may not be of
interest for the application for the end result. The triples that are
removed are of the form (following a SPARQL-like notation):
-
?x owl:sameAs ?x
, ?x rdfs:subClassOf ?x
,
?x rdfs:subPropertyOf ?x
, ?x owl:equivalentClass
?x
type triples
-
?x rdfs:subClassOf rdf:Resource
, ?x
rdfs:subClassOf owl:Thing
, ?x rdf:type
rdf:Resource
, owl:Nothing rdfs:subClassOf ?x
type
triples
-
For a datatype that does not appear explicitly in a type
assignments (ie, in a
?x rdf:type dt
) the corresponding
dt rdf:type owl:Datatype
and dt rdf:type
owl:DataRange
triples, as well as the disjointness statements
with other datatypes
-
annotation property axioms
-
a number of axiomatic triples on
owl:Thing
,
owl:Nothing
and rdf:Resource
(eg,
owl:Nothing rdf:type owl:Class
, owl:Thing
owl:equivalentClass rdf:Resource
, etc.)
Trimming is the only feature of this class, done in the post_process step. If users extend OWLRL_Extension, this class can be safely mixed in via
multiple inheritance.
__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__
|