From: kal <ka...@te...> - 2004-08-31 08:00:10
|
Hi Stefan Ste...@sw... wrote: > Hi > > > > I have the following two questions using tolog: > > > > [1] > > I would like to define a topic like "status-of/has-status" or > "father/son", means with a slash in its name. Wouldn't it possible to > query an association which is a instance of such a topic? E.g. select > $A from father/son($A,$B) ? > > > > Is there a way to tell the parser that this slash is part of the name? > You should not be able to use a slash as part of the ID of a topic - the ID should match the production for an XML ID (which only allows letters, numbers and a small range of other characters). So that means that you cannot use the slash character in that way. You can use an underscore character, so father_son and status-of_has-status are allowed. Most of the time I choose a single name e.g. has-status or parent-of > > > [2] > > In test classes of tm4j-0.9.4 I found the following query: > > > > select $A from i\http://www.topicmaps.org/xtm/1.0/core.xtm#class-instance\ > > (shape:i\"http://www.topicmaps.org/xtm/1.0/core.xtm#class\", > > $A:i\"http://www.topicmaps.org/xtm/1.0/core.xtm#instance\") ? > > > > I think such a query works with local files as well. Which syntax I > have to use? Select $A from i\"file:///c:/myTM.xtm#test\"($A,$B) ? > > > > I got always the same error: TopicMapRuntimeException->Cannot find > topic with subject indiciator.. > > > > > The i"<uri>" means that the quoted uri is treated as a subject indicator to lookup the topic. If you have a topic with ID "test" in the file "myTM.xtm", then you can look it up by its *source locator* which requires you to use s"<uri>". For more on this, see the Ontopia tutorial for tolog (the section is file:///C:/kal/dev/oks-professional-2.0.3/doc/query/tutorial.html#sect-topic-ref). Cheers, Kal |