From: Richard G. <ric...@ya...> - 2005-01-12 12:40:56
|
Hi, I have the following code which adds a tolog rule and then executes a query using that rule, based on example 8.2 of the tm4j development guide. queryEval.addRule( "func-loc($PROTEIN, $LOCATION, $FUNCTION) :- { " + "at-located-in($LOCATION : tt-loc, $PROTEIN : tt-protein), " + "at-has-function($FUNCTION : tt-function, $PROTEIN : tt-protein) }."); TologResultsSet results = queryEval.execute( "select $PROTEIN, $FUNCTION, $LOCATION from { " + "topic-name($FUNCTION, $FUNCTION_NAME), " + "value($FUNCTION_NAME, \"11.06.01 rRNA modification\"), " + "topic-name($LOCATION, $LOCATION_NAME), " + "value($LOCATION_NAME, \"70.10.07 nucleolus\"), " + "func-loc($PROTEIN, $LOCATION, $FUNCTION) } " + "order by $PROTEIN? "); However, when I run the code I get a TologParserException message, suggesting that it doesn't like the closing '}' in my rule. Exception caught: org.tm4j.tologx.TologParserException: Parser error in rule string. org.tm4j.tologx.TologParserException: Parser error in rule string. at org.tm4j.tologx.memory.QueryEvaluatorImpl.addRule(QueryEvaluatorImpl.java:136) at mips.genre.topicmaps.TologTests.main(TologTests.java:71) Caused by: line 1:169: unexpected token: } at org.tm4j.tologx.parser.TologParser.orclause(TologParser.java:828) at org.tm4j.tologx.parser.TologParser.clause(TologParser.java:729) at org.tm4j.tologx.parser.TologParser.clauselist(TologParser.java:437) at org.tm4j.tologx.parser.TologParser.rule(TologParser.java:314) at org.tm4j.tologx.memory.QueryEvaluatorImpl.addRule(QueryEvaluatorImpl.java:132) I also tried using the addRulesModule() method, but I get the same exception generated by the same part of the rule. I anyone can tell me where I'm going wrong here (as I'm sure it's something I'm doing wrong), I'd be grateful. Cheers, Richard. ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com |