public
Description: Tamarind was designed to make it as easy as possible for developers to participate in the Semantic Web by exposing their data in accordance with applicable standards and ontologies. In particular, Tamarind targets developers using Ruby frameworks and ORMs.
Clone URL: git://github.com/pius/tamarind.git
name age message
file History.txt Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
file License.txt Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
file Manifest.txt Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
file README.txt Sat Mar 08 20:15:16 -0800 2008 Enhanced the etymology of Tamarind. [pius]
file Rakefile Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
directory config/ Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
directory lib/ Sat Mar 08 11:46:25 -0800 2008 Got rid of my e-mail in the Generator Agent met... [pius]
directory log/ Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
directory pkg/ Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
directory script/ Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
file setup.rb Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
directory spec/ Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
directory tasks/ Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
directory test/ Fri Mar 07 21:30:07 -0800 2008 Initial commit [pius]
directory website/ Sat Mar 08 08:14:28 -0800 2008 Added proper installation instructions to the w... [pius]
README.txt
Tamarind was designed to make it as easy as possible for developers to participate in the Semantic Web by exposing their 
data 
in accordance with applicable standards and ontologies.  In particular, Tamarind targets developers using Ruby 
frameworks and ORMs.

Note that this release is not intended for production use.  Please consider all pre-1.0 releases "developer" releases.

Oh, and where does the name come from?  Well, the Old Testament, Koran, and Torah refer to the Tree of Knowledge in the 
Garden of Eden as a Tamarind tree.  (Book of Enoch 31:4).  Each ontology Tamarind supports is referred to as a branch.

==Installation

When Tamarind is ready for production use, the gem will be published on Rubyforge.  Developers who'd like to use it now
should:

1.  Git it.  (git clone git://github.com/pius/tamarind.git)
2.  Install the gem.  (cd tamarind; rake local_deploy)

==Adding New Ontologies

To add an ontology, a developer need only follow these steps:

1.  Under tamarind/branches, create a directory for the ontology along with a module that identifies the data fields
  necessary for filling in the ontology.  (See the FOAF ontology as an example.)
2.  Write the template using Ruby builder syntax and save it under the directory from step 1.  Fields that must come 
from 
  the database should be prefixed by the "@" sign.  (Again, see the FOAF ontology as an example.)
3.  There is no step three.

==General Process for Using Ontologies In Your Application

To use an ontology, a developer need only follow these steps:

1.  Require the gem in your application
2.  Check out the documentation for the gem to find what ontologies are supported and learn how to use the "offers_*" 
  methods.
3.  In your model file, call offers_<ontology>, where <ontology> is the lowercase RDF type (e.g. offers_foaf).
  
====Instructions for Merb (0.9.1 or greater)

*in config/init.rb

Merb::BootLoader.before_app_loads do
 dependency 'tamarind'
end

Merb::BootLoader.after_app_loads do
  Merb.add_mime_type(:rdf,:to_rdf,%w[application/rdf+xml])
end

*in any controller that's going to use Tamarind, add:

provides :rdf

*in the model (e.g. User), add:
  offers_foaf :name => 'username', 
        :email => 'email',  #takes a hash mapping the ontology's canonical attributes to the model's accessors
              #defaults to using the same names

*in any view (e.g. the User show action) using Tamarind, add this to enable auto-discovery:
<link rel="meta" type="application/rdf+xml" title="foo" href="<%=@user.id%>.rdf" />

==TODO

  Add generator for new ontologies
  Add specs
  Support templating engines besides Builder
  Automatically parse the variables out of the template rather than require them to be explicitly declared
  Improve the documentation
  Firm up support for hashes that bind model attributes to ontology attributes