Categories: None [Edit]
rtm-rails
==== Topic Maps for Rails (rtm-rails)
RTM-Rails is the Rails-Adapter for Ruby Topic Maps. It allows simple configuration of topicmaps in config/topicmaps.yml.
==== Overview
From a developer's perspective, RTM is a schema-less database management system.
The Topic Maps standard (described below) on which RTM is based provides a way of creating a self-describing schema just by using it.
You can use RTM as a complement data storage to ActiveRecord in your Rails apps.
==== Quickstart - existing Rails project
jruby script/generate topicmaps
Run the command above after installing rtm-rails. This will create
* a minimal default configuration: config/topicmaps.yml and
* a file with more examples and explanations config/topicmaps.example.yml
* a file README.topicmaps.txt which contains more information how to use it and where to find more information
* an initializer to load the topicmaps at startup
* a rake task to migrate the topic maps backends
in your rails application.
==== Quickstart - new Rails project
For a new Rails application these are the complete initial steps:
jruby -S rails my_topicmaps_app
cd my_topicmaps_app
jruby -S script/generate jdbc
jruby -S script/generate topicmaps
# The following lines are necessary because Rails does not have a template
# for the H2 database and Ontopia does not support the Rails default SQLite3.
sed -e "s/sqlite3/h2/" config/database.yml > config/database.yml.h2
mv config/database.yml.h2 config/database.yml
# Prepare the database and then check if all is OK
jruby -S rake topicmaps:migrate_backends
jruby -S rake topicmaps:check
==== Usage inside the application
When everything is fine, let's create our first topic:
jruby -S script/console
TM[:example].get!("http://example.org/my/first/topic")
# and save the topic map
TM[:example].commit
Access the configured topic maps anywhere in your application like this:
TM[:example]
To retrieve all topics, you can do
TM[:example].topics
To retrieve a specific topic by its subject identifier:
TM[:example].get("htt...
Total
Ranking: 93,761 of 180,709
Downloads: 7,716
Daily
Ranking: 135,887 of 180,702
Downloads: 0
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
Rank | Downloads | Name |
---|
Depends on
Rank | Downloads | Name |
---|---|---|
56,827 | 16,223 | rtm-javatmapi |
57,422 | 16,011 | rtm-ontopia |
Owners
# | Gravatar | Handle |
---|---|---|
1 | #162 |