From: Kal A. <ka...@te...> - 2005-01-12 16:59:24
|
Hi Richard, You don't need the curly braces there in the rule. Does it parse ok with the braces removed ? Cheers, Kal On 12 Jan 2005, at 12:40, Richard Gregory wrote: > 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.ja > va: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.ja > va: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 > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users > > |