Ruby Topic Maps integrates great with Active Record. You can link topic types with Active Record models and topics with Active Record instances. More about that will be documented soon.
Please find up-to-date documentation on http://docs.topicmapslab.de/rtm until this website is relaunched.
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.×.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)
RTM is provided by Benjamin Bock "as is". Use it at your own risk. For details see the disclaimer . Feedback, Comments, Questions? Please send any of these to bb--rtm-web at bockb dot de (yes, that's bb dash dash rtm dash web...) or use the bug tracker to submit bug reports and/or patches. Please tell us (and your friends) if you're using RTM.
Topic Maps Lab is a research group at the Chair for Natural Language Processing at the Department of Computer Science at the University of Leipzig, Germany .
We are looking for researchers and software developers with sound experiences in Topic Maps or other semantic technologies. We offer full time and student jobs and supervise theses .