This page has moved to http://rtm.topicmapslab.de.
Some more details about referencing topics and creating topics by reference have been added below.
Finally, RTM is available now using the default RubyGems installation procedure:
gem install rtmThanks to Florent Solt from gRTM, a Gnome client for Remember the Milk, who - unknowingly - kidnapped the name slot and now changed the release name to their project name. Also thanks to the Ruby Forge admins for the support.
And, I forgot to say, the type-instance and supertype-subtype-stuff mentioned below, also works like this:
require 'rtm' RTM.connect tm = RTM.create "urn:/bla" tm.get!("a1").add_type("A") tm.get!("b2").add_type("B") tm.get!("c3").add_type("C") tm.get("A").add_subtype("B") tm.get("B").add_subtype("C")A bit shorter, isn't it? Should have mentioned that earlier... and it detects recursivity, of course.
Greetings from Oslo, Norway! After a 3 hour tutorial at the Topic Maps 2008 conference this morning some bugs were ironed out and RTM is now considered Beta. Try the new gem, it's in the Download section and will soon be in the official gem repository.
A new preview release is available.
It includes many bugfixes and 2 enhancements:
crare the short hand commands for
require 'rtm' RTM.connect tm = RTM.create "urn:/bla" a = tm.ca RTM::PSI[:type_instance] a.cr "a1", RTM::PSI[:instance] a.cr "A", RTM::PSI[:type] a2 = tm.ca RTM::PSI[:type_instance] a2.cr "b2", RTM::PSI[:instance] a2.cr "B", RTM::PSI[:type] a3 = tm.ca RTM::PSI[:type_instance] a3.cr "c3", RTM::PSI[:instance] a3.cr "C", RTM::PSI[:type] a4 = tm.ca RTM::PSI[:supertype_subtype] a4.cr "A", RTM::PSI[:supertype] a4.cr "B", RTM::PSI[:subtype] a5 = tm.ca RTM::PSI[:supertype_subtype] a5.cr "B", RTM::PSI[:supertype] a5.cr "C", RTM::PSI[:subtype] tm.get("A").direct_instances # returns topic a1 tm.get("A").instances # returns topics a1, b2, c3 tm.get("b2").direct_types # returns topic B tm.get("c3").types # returns topics A, B, CThe code for that is automatically created from the model, so it's possible to add own special associations. Documentation will follow later, be consoled for now: source code never lies (-;
I thought it is a good idea to also upload the slides from TMRA, so here they are: RTM presentation slides.
The day before TMRA, I gave a 3 hour tutorial on programming Ruby
and using RTM.
It covered standalone Ruby and basic usage of RTM in the first part. In the second part we created a Ruby on Rails web application and integrated RTM into it.
The slides were mostly a guideline through the tutorial and a reference for explaining things. Without these explanations and the demonstrations I did, it is a load of theory. I removed a bunch of organizational slides to not clutter it up too much.
This is the preliminary web site for Ruby Topic Maps which has been presented at TMRA 2007.
The Mailinglist interface can be found here: Mailing List
You can install the latest gem from the central rubyforge gem repository by typing
gem install rtmat your command prompt. Alternatively, you can download it here: rtm-0.1.1.gem.
Of course, don't forget to read the disclaimer below!
Rubyforge Project Page
You need activesupport, activerecord and json gems installed for RTM to work. To use the memory backend, you also need SQLite3.
Then install RTM:
If you're installing locally, use the exact gem name: gem install rtm-0.1.x.gem
Next, fire up irb and load RTM. On the command line do
To use another back end:
Within RTM, topics can be referenced using their identifiers.
Which specific type of identifier is used for querying is explained in the section "Querying topics" below.
For any write operations, i.e. setting a type, creating an occurrence, internally, the method
get! is used.
For any read operations, internally, the method
get is used.
# get a topic using its identifiers: # item identifier: t1 = tm.get("item-identifier") # subject identifier: t2 = tm.get("http://psi.example.org/t2") # subject locator: t3 = tm.get("=http://rtm.rubyforge.org")
t1 = tm.get("item-identifier") # * use relative IRIs # * returns nil if not found # for using absolute IRI: t1 = tm.by_item_identifier( "absolute:item-identifier") # * the latter might be TopicMapsConstruct, too
t1 = tm.get("absolute:identifier") # * use absolute IRIs # * returns nil if not found # or use the direct method: t1 = tm.topic_by_subject_identifier( "absolute:subject-identifier")
t1 = tm.get("=http://rtm.rubyforge.org") # * similar to subject identifier # * prefix with "=" # or use the direct method: t1 = tm.topic_by_subject_locator( "http://rtm.rubyforge.org") # * no prefix needed here
# similar to getting, add ! to method # item identifier: t1 = tm.get!("item-identifier") # subject identifier: t2 = tm.get!("http://psi.example.org/t2") # subject locator: t3 = tm.get!("=http://rtm.rubyforge.org")
# similar to getting, add ! to method # item identifier: t1 = tm.topic_by_item_identifier!( "item_identifier") # => always returns a Topic # subject identifier: t2 = tm.topic_by_subject_identifier!( "http://psi.example.org/t2") # subject locator: t3 = tm.topic_subject_locator( "http://rtm.rubyforge.org") # no =
(using an example topic t from a topic map tm)
Please send any of the above to bb--rtm-web at bockb dot de (yes, that's bb dash dash rtm dash web...)
Copyright (c) 2007,2008 Benjamin Bock. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Redistributions in any form must be accompanied by information on how to obtain complete source code for the software and any accompanying software that uses the software. The source code must either be included in the distribution or be available for no more than the cost of distribution plus a nominal fee, and must be freely redistributable under reasonable conditions. For an executable file, complete source code means the source code for all modules it contains. It does not include source code for modules or files that typically accompany the major components of the operating system on which the executable file runs. THIS SOFTWARE IS PROVIDED BY BENJAMIN BOCK ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL BENJAMIN BOCK BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.