Class RuleDerivation

All Implemented Interfaces:

public class RuleDerivation extends Object implements Derivation
Derivation records are used to determine how an inferred triple was derived from a set of source triples and a reasoner. SubClasses provide more specific information.
  • Constructor Details

    • RuleDerivation

      public RuleDerivation(Rule rule, Triple conclusion, List<Triple> matches, InfGraph infGraph)
      rule - the rule which created this derivation
      conclusion - the triple which the rule created
      matches - a list of matching Triples corresponding to the rule body patterns
      infGraph - the parent infGraph which was controlling the derivation
  • Method Details

    • toString

      public String toString()
      Return a short-form description of this derivation.
      Specified by:
      toString in interface Derivation
      toString in class Object
    • printTrace

      public void printTrace(PrintWriter out, boolean bindings)
      Print a deep traceback of this derivation back to axioms and source assertions.
      Specified by:
      printTrace in interface Derivation
      out - the stream to print the trace out to
      bindings - set to true to print intermediate variable bindings for each stage in the derivation
    • getConclusion

      public Triple getConclusion()
      the triple concluded by the derivation
    • getMatches

      public List<Triple> getMatches()
      the set of triples which were used in firing this rule derivation
    • getRule

      public Rule getRule()
      the rule which fired to create this derivation
    • sameAs

      public boolean sameAs(RuleDerivation other)
      Compare two derivations. This is a shallow comparison, two derivations are the same if they contain the same conclusion, rule and match list. They do not need to be derived from the same (or any) infGraph.