net.sansa_stack.inference.spark.forwardchaining.triples
Applies forward chaining to the given RDF graph and returns a new RDF graph that contains all additional triples based on the underlying set of rules.
Applies forward chaining to the given RDF graph and returns a new RDF graph that contains all additional triples based on the underlying set of rules.
the RDF graph
the materialized RDF graph
Applies forward chaining to the given RDD of RDF triples and returns a new RDD of RDF triples that contains all additional triples based on the underlying set of rules.
Applies forward chaining to the given RDD of RDF triples and returns a new RDD of RDF triples that contains all additional triples based on the underlying set of rules.
the RDF triples
the materialized set of RDF triples
Computes the transitive closure for a Dataframe of triples
Computes the transitive closure for a Dataframe of triples
the Dataframe of triples
a Dataframe containing the transitive closure of the triples
Computes the transitive closure for an RDD of tuples
Computes the transitive closure for an RDD of tuples
the RDD of tuples
an RDD containing the transitive closure of the tuples
Computes the transitive closure for the given predicate on an RDD of triples.
Computes the transitive closure for the given predicate on an RDD of triples.
the RDD of triples
the predicate
an RDD containing the transitive closure of the triples
Computes the transitive closure on an RDD of triples.
Computes the transitive closure on an RDD of triples. Note, that the assumption is that all triples do have the same predicate.
the RDD of triples
an RDD containing the transitive closure of the triples
Computes the transitive closure on a set of triples, i.e.
Computes the transitive closure on a set of triples, i.e. it is computed in-memory by the driver. Note, that the assumption is that all triples do have the same predicate.
the set of triples
a set containing the transitive closure of the triples
Semi-naive computation of the transitive closure T
for an RDD of tuples R=(x,y)
.
Semi-naive computation of the transitive closure T
for an RDD of tuples R=(x,y)
.
(1) T = R (2) ∆T = R (3) while ∆T != ∅ do (4) ∆T = ∆T ◦ R − T (5) T = T ∪ ∆T (6) end
the RDD of tuples (x,y)
an RDD containing the transitive closure of the tuples
CR1: C1 \sqsubseteq C2, C2 \sqsubseteq D => C1 \sqsubseteq D
CR10: C \sqsubseteq \exists r.D, r \sqsubseteq s => C \sqsubseteq \exists s.D
CR11: C \sqsubseteq \exists r1.D, D \sqsubseteq \exists r2.E, r1 o r2 \sqsubseteq r3 => C \sqsubseteq \exists r3.E
CR2: C \sqsubseteq C1, C \sqsubseteq C2, C1 \sqcap C2 \sqsubseteq D => C \sqsubseteq D
CR3: C1 \sqsubseteq C2, C2 \sqsubseteq \exists r.D => C1 \sqsubseteq \exists r.D
CR4: C \sqsubseteq \exists r.D, D \sqsubseteq D2, \exists r.D2 \sqsubseteq E => C \sqsubseteq E
CR5: C\sqsubseteq \exists r.D, D \sqsubseteq owl:Noting => C \sqsubseteq owl:Nothing
Extracts all triples that match the given subject, predicate and object if defined.
Extracts all triples that match the given subject, predicate and object if defined.
the RDD of triples
the subject
the predicate
the object
the RDD of triples that match
Extracts all triples for the given predicate.
Extracts all triples for the given predicate.
the RDD of triples
the predicate
the RDD of triples that contain the predicate
Extracts all triples for the given predicate.
Extracts all triples for the given predicate.
the triples
the predicate
the set of triples that contain the predicate
This rule-based forward chaining reasoner implementation is based on the paper
'Pushing the EL envelope' by Baader, Brandt, Lutz. IJCAI. Vol. 5. 2005.
The paper does not cover the whole OWL 2 EL profile and makes some assumptions w.r.t. the allowed axioms. Given the set BC that contains
- owl:Thing - all concept names - all nominals { a } (with just one individual!) - concrete domain descriptions p(f1, ..., fk) (not used here)
The allowed general concept inclusions are the following (with C1, C2 \in BC, D \in BC \cup { owl:Nothin }):
- C1 \sqsubseteq D - C1 \sqcap C2 \sqsubseteq D - C1 \sqsubseteq \exists r.C2 - \exists r.C1 \sqsubseteq D
Role inclusions may be of the form
- r \sqsubseteq s , or - r1 o r2 \sqsubseteq s
We implemented the completion rules that were feasible in our setting.
Naming conventions: - C, C1, C2 --> class names, or nominals (with just one individual), or owl:Thing - D, D1, D2 --> class names, or nominals (with just one individual), owl:Thing, or owl:Nothing