Object

net.sansa_stack.inference.utils

RuleUtils

Related Doc: package utils

Permalink

object RuleUtils

Utility class for rules.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RuleUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class RuleExtension extends AnyRef

    Permalink

    Some convenience methods that can be called directly on a rule object.

  2. implicit class TriplePatternEqualiltyExtension extends AnyRef

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def asGraph(rule: Rule): Graph[Node, LDiEdge]

    Permalink

    Returns a graph representation of the triple patterns contained in the rule.

    Returns a graph representation of the triple patterns contained in the rule.

    rule

    the rule

    returns

    the directed labeled graph

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def byName(rules: Seq[Rule], name: String): Option[Rule]

    Permalink

    Returns a rule by the given name from a set of rules.

    Returns a rule by the given name from a set of rules.

    rules

    the set of rules

    name

    the name of the rule

    returns

    the rule if exist

  7. def canMerge(rule1: Rule, rule2: Rule): Boolean

    Permalink

    Returns true if rule1 and rule2 can be merged, i.e.

    Returns true if rule1 and rule2 can be merged, i.e. both rules denote the same input but probably different output, otherwise false.

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def entailmentType(rule: Rule): RuleEntailmentType

    Permalink

    Returns the type of entailment for the given rule

    Returns the type of entailment for the given rule

    rule

    the rule to analyze

    returns

    the entailment type

  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def graphOfBody(rule: Rule): Graph[Node, LDiEdge]

    Permalink

    Returns a graph representation of the triple patterns contained in the body of the rule.

    Returns a graph representation of the triple patterns contained in the body of the rule.

    rule

    the rule

    returns

    the directed labeled graph

  15. def graphOfHead(rule: Rule): Graph[Node, LDiEdge]

    Permalink

    Returns a graph representation of the triple patterns contained in the head of the rule.

    Returns a graph representation of the triple patterns contained in the head of the rule.

    rule

    the rule

    returns

    the directed labeled graph

  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. def isAssertional(rule: Rule): Boolean

    Permalink

    Checks whether a rule is assertional.

    Checks whether a rule is assertional.

    An rule is considered as assertional, if and only if it contains only assertional triples in its premises and conclusion.

    rule

    the rule to check

    See also

    org.dissect.inference.utils.TripleUtils#isAssertional

  18. def isCyclic(rule: Rule): Boolean

    Permalink

    Checks whether a rule itself is cyclic.

    Checks whether a rule itself is cyclic. Intuitively, this means to check for triples produced in the conclusion that are used as input in the premise.

    This is rather tricky, i.e. a naive approach which simply looks e.g. for predicates that occur in both, premise and conclusion is not enough because, e.g. a rule [(?s ?p ?o) -> (?o ?p ?s)] would lead to an infinite loop without producing anything new after one iteration. On the other hand, for rules like [(?s ?p ?o1), (?o1 ?p ?o2) -> (?s ?p ?o2)] it's valid. TODO we do not only have to check for common predicates, but also have to analyze the subjects/objects of the triple patterns.

    rule

    the rule to check

    returns

    whether it's cyclic or not

  19. def isHybrid(rule: Rule): Boolean

    Permalink

    Checks whether a rule is assertional.

    Checks whether a rule is assertional.

    An rule is considered as hybrid, if and only if it contains both assertional and terminological triples in its premises and only assertional triples in its conclusion.

    rule

    the rule to check

    See also

    org.dissect.inference.utils.TripleUtils#isAssertional

  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. def isInverseOf(rule1: Rule, rule2: Rule): Boolean

    Permalink

    Checks whether a rule r1 is simply the opposite of another rule r2, i.e.

    Checks whether a rule r1 is simply the opposite of another rule r2, i.e. whether it holds that the head of r1 is the body of r2 and vice versa (modulo variable names).

    rule1

    the first rule

    rule2

    the second rule

    returns

    whether rule1 is the inverse of rule2

    Example:
    1. [r1: (?s p1 ?o), (?o p1 ?s) -> (?s p2 ?o)] and [r2: (?s p2 ?o) -> (?o p1 ?s)

  22. def isTerminological(rule: Rule): Boolean

    Permalink

    Checks whether a rule is terminological.

    Checks whether a rule is terminological.

    An rule is considered as terminological, if and only if it contains only terminological triples in its conclusion.

    rule

    the rule to check

    See also

    org.dissect.inference.utils.TripleUtils#isTerminological

  23. def isTransitiveClosure(rule: Rule, property: Node = null): Boolean

    Permalink

    Checks whether a rule denotes the transitive closure(TC) for a given predicate p, i.e.

    Checks whether a rule denotes the transitive closure(TC) for a given predicate p, i.e. the rule looks like (?s p ?o1), (?o1, p ?o2) -> (?s p ?o2)

    rule

    the rule to check

    returns

    whether it denotes the TC or not

  24. def load(filename: String): Seq[Rule]

    Permalink

    Load a set of rules from the given file.

    Load a set of rules from the given file.

    filename

    the file

    returns

    a set of rules

  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. def sameBody(rule1: Rule, rule2: Rule): Boolean

    Permalink

    Returns true if rule1 has the same body as rule2, otherwise false .

  29. def sameHead(rule1: Rule, rule2: Rule): Boolean

    Permalink

    Returns true if rule1 has the same head as rule2, otherwise false.

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  32. def varsOf(tp: Triple): List[Node]

    Permalink
  33. def varsOf(tp: TriplePattern): List[Node]

    Permalink

    Returns all variables that occur in the triple pattern.

    Returns all variables that occur in the triple pattern.

    tp

    the triple pattern

    returns

    the variables

  34. def varsOfBody(rule: Rule): Set[Node]

    Permalink

    Returns all variables that occur in the body.

    Returns all variables that occur in the body.

    rule

    the rule

    returns

    the variables

  35. def varsOfHead(rule: Rule): Set[Node]

    Permalink

    Returns all variables that occur in the head.

    Returns all variables that occur in the head.

    rule

    the rule

    returns

    the variables

  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped