Habush / atomspace-rpc

A gRPC server and client to execute pattern matching queries
GNU Affero General Public License v3.0
2 stars 1 forks source link

scheme parsing is adding extra parentheses for pattern matching commands #5

Open mjsduncan opened 2 years ago

mjsduncan commented 2 years ago

for atomspace commit 16790c7005a80eb70a1281cfac85a00512140bb8 (october 7, 2021) and Habush/atomspace-rpc current master and current atomspace from mozi.ai running the annotation service docker locally produces this error:

...
Server listening on 0.0.0.0:50051
Error: Unbalanced parenthesis >>; [5a6822854d80fb0c][1]
    (ListLink
      (GeneNode "BRCA2") ; [1bd83328eeb5d294][1]
      (VariableNode "$name") ; [75727d82789ac7d3][1]
    ) ; [84dd65680014bcb3][1]
  ) ; [d7f6fd7b9a2c82a1][1]
) ; [b4e851f7c5197785][1]<<

accessing from the guile REPL works for find-similar-node but not for exec-pattern:

scheme@(guile-user)> (find-similar-node "prod-atom" "Gene" "BRC")
$27 = ((GeneNode "BRCA3")
 (GeneNode "BRCA2")
 (GeneNode "BRCC3")
 (GeneNode "BRCA1")
 (GeneNode "BRCA2(IV)")
)
scheme@(guile-user)> (exec-pattern "prod-atom" (Meet (Member (Gene "IGF1") (Variable "$pway"))))
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Throw to key `C++-EXCEPTION' with args `("exec-pattern" "Executing pattern failed. Reason: Unbalanced parenthesis >>; [37b917f182563377][1]\n    (VariableNode \"$pway\") ; [6f5de7f213daa0f5][1]\n  ) ; [856d2984e6de3e64][1]\n) ; [834184a90d6d83b9][1]<<\nFunction args:\n(prod-atom (MeetLink\n  (MemberLink\n    (GeneNode \"IGF1\")\n    (VariableNode \"$pway\")))\n)")'.

corresponding error output from atomspace-rpc binary is:

Error: Unbalanced parenthesis >>; [37b917f182563377][1]
    (VariableNode "$pway") ; [6f5de7f213daa0f5][1]
  ) ; [856d2984e6de3e64][1]
) ; [834184a90d6d83b9][1]<<