diff --git a/src/main/scala/org/geneontology/rules/engine/ReteNodes.scala b/src/main/scala/org/geneontology/rules/engine/ReteNodes.scala index 86dcc22..5e242f0 100644 --- a/src/main/scala/org/geneontology/rules/engine/ReteNodes.scala +++ b/src/main/scala/org/geneontology/rules/engine/ReteNodes.scala @@ -220,7 +220,6 @@ final class ProductionNode(rule: Rule, parent: BetaNode, engine: RuleEngine) ext for { pattern <- rule.head } { - //FIXME get rid of casting val newTriple = Triple( produceNode(pattern.s, token).asInstanceOf[Resource], produceNode(pattern.p, token).asInstanceOf[URI], @@ -233,7 +232,7 @@ final class ProductionNode(rule: Rule, parent: BetaNode, engine: RuleEngine) ext private def produceNode(node: Node, token: Token): ConcreteNode = node match { case c: ConcreteNode => c case v: Variable => token.bindings(v) - //case AnyNode => error + case AnyNode => throw new RuntimeException("Invalid rule head containing AnyNode") } def addChild(node: BetaNode): Unit = () diff --git a/src/main/scala/org/geneontology/rules/engine/WorkingMemory.scala b/src/main/scala/org/geneontology/rules/engine/WorkingMemory.scala index 8ce0495..3794cc1 100644 --- a/src/main/scala/org/geneontology/rules/engine/WorkingMemory.scala +++ b/src/main/scala/org/geneontology/rules/engine/WorkingMemory.scala @@ -4,7 +4,7 @@ import scala.collection.immutable.Queue import scala.collection.mutable import scala.collection.mutable.AnyRefMap -final class WorkingMemory(var asserted: Set[Triple]) { +final class WorkingMemory(val asserted: Set[Triple]) { var agenda: Queue[Triple] = Queue.empty val facts: mutable.Set[Triple] = mutable.Set.empty ++ asserted @@ -60,7 +60,6 @@ final class BetaMemory(val spec: JoinNodeSpec, initialLinkedChildren: List[BetaN var tokens: List[Token] = Nil var checkRightLink: Boolean = true var checkLeftLink: Boolean = false - //val tokenIndex: mutable.Map[(Variable, ConcreteNode), mutable.Set[Token]] = AnyRefMap.empty val tokenIndex: mutable.Map[Variable, mutable.Map[ConcreteNode, List[Token]]] = AnyRefMap.empty var linkedChildren: List[BetaNode] = initialLinkedChildren