tmlab / tmql

Automatically exported from code.google.com/p/tmql
1 stars 0 forks source link

tm:subject[. isa tm:name] delivers no result #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Input:
    topic
        - "Name";.

Query:
    // tm:subject[. isa tm:name]

Result:
    []

Expected:
    [<item-which-represents-the-topic-name]

Original issue reported on code.google.com by lars.he...@gmail.com on 2 May 2011 at 12:36

GoogleCodeExporter commented 9 years ago
No, tm:subject is a concept of topics, and cannot deliver name objects or 
anything else

Original comment by Sven.Kro...@googlemail.com on 12 May 2011 at 4:16

GoogleCodeExporter commented 9 years ago
I think that's wrong

(a) //tm:subject / tm:subject [. isa tm:name]
(b) //tm:subject / tm:name

(a) and (b) should deliver the same results. (b) works with TMQL4J, (a) doesn't.

"tm:subject" is a kind of wildcard since everything is an instance of 
tm:subject, so (a) should effectively do something like this:

for topic in topicmap.getTopics():
    for child in topic.getChildren():
       if (child instanceof tm:subject) and (child instanceof tm:name):
           yield child

The query optimizer may remove the "child instanceof tm:subject" check since 
everything is an instance of tm:subject, though.

Original comment by lars.he...@gmail.com on 14 May 2011 at 12:58