Getting started with TMQL

Forum is for miscellaneous user help requests.

Getting started with TMQL

Postby mordenkainen » Thu Mar 05, 2015 12:43 am

I'm studying TMQL. I'm trying to build some simple querys using tutorial provided by the following sites:

http://tmql4j.topicmapslab.de/
http://www.isotopicmaps.org/tmql/tmql.html
http://kill.devc.at/system/files/language.html

Some of them works as expected, some suddenly returns nothing. I post example queries here and hope that someone shall point me to my errors:

Basic Navigation - works
Code: Select all
%prefix core http://wandora.org/si/core/
core:wandora-class << types [ . >> characteristics tm:name >> atomify == "AAA" ] << types [ . >> characteristics tm:name >> atomify == "BBB" ]


Navigation with Sugar - works
Code: Select all
%prefix core http://wandora.org/si/core/
core:wandora-class >> instances [ . / tm:name == "AAA" ] >> instances [ . / tm:name == "BBB" ]


Select by Name Basic - fails
Code: Select all
%prefix core http://wandora.org/si/core/
select $t
where
    $t >> characteristics tm:name >> atomify == "AAA"


Select by Name Sugar - fails
Code: Select all
%prefix core http://wandora.org/si/core/
select $t
where
    $t / tm:name == "AAA"


Select by Some Navigation - works
Code: Select all
%prefix core http://wandora.org/si/core/
select $t
where
    some $t in core:wandora-class << types [ . / tm:name == "AAA" ] << types [ . / tm:name == "BBB" ] satisfies true


Select by Some Type and Name - fails
Code: Select all
%prefix core http://wandora.org/si/core/
select $t
where
    some $t in core:wandora-class << types [ . / tm:name == "AAA" ] << types satisfies $t / tm:name == "BBB"


Select by Type - works
Code: Select all
%prefix core http://wandora.org/si/core/
select $t
where
    $t isa core:wandora-class << types [ . / tm:name == "AAA" ]


Select by Type and Name - fails
Code: Select all
%prefix core http://wandora.org/si/core/
select $t
where
    $t isa core:wandora-class << types [ . / tm:name == "AAA" ]
 &  $t / tm:name == "BBB"
mordenkainen
 
Posts: 24
Joined: Fri Feb 13, 2015 5:11 pm

Re: Getting started with TMQL

Postby mordenkainen » Thu Mar 05, 2015 7:03 pm

I uploaded sample Wandora project to tinyupload:

http://s000.tinyupload.com/?file_id=458 ... 9699681537

I prefer to store it locally in this forum, but failed to found upload/attach link
mordenkainen
 
Posts: 24
Joined: Fri Feb 13, 2015 5:11 pm

Re: Getting started with TMQL

Postby akivela » Tue Mar 10, 2015 12:37 pm

Hi Mordenkainen

Thank you for testing TMQL in Wandora. Your tests are very valuable not only to other Wandora users but to makers of Wandora too.

I have given you the permission to upload files to the Wandora forum. Please, try to keep the uploads moderately small and related to Wandora.

Do you mind if I upload your test topic maps here? I would appreciate if they were stored in Wandora forum too.

Kind Regards,
Aki / Wandora Team
akivela
Site Admin
 
Posts: 256
Joined: Tue Sep 18, 2007 10:20 am
Location: Helsinki, Finland

Re: Getting started with TMQL

Postby mordenkainen » Tue Mar 10, 2015 2:43 pm

Feel free to redistribute sample maps in any way. They were created for illustration purpose. So you may upload it in Wandora forum or add to examples in the site.
mordenkainen
 
Posts: 24
Joined: Fri Feb 13, 2015 5:11 pm

Re: Getting started with TMQL

Postby akivela » Tue Mar 10, 2015 5:13 pm

Here is the project file for Wandora, Mordenkainen refers above.
Attachments
querytest.wpr
(2.72 KiB) Downloaded 1012 times
akivela
Site Admin
 
Posts: 256
Joined: Tue Sep 18, 2007 10:20 am
Location: Helsinki, Finland


Return to How to... and problems

Who is online

Users browsing this forum: No registered users and 1 guest