<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;
&lt;p&gt;Behaviors are a means to extend traditional ruby classes/objects with ontological information.&lt;/p&gt;
&lt;/p&gt;
&lt;h2&gt;The &amp;#8220;Ontology&amp;#8221; Behavior&lt;/h2&gt;
&lt;p&gt;The ontology behavior uses a specified attribute of a class (default is name) as an ontology term.  A query is made to find all the relationships of the ontology term contained within a triple store.  These are accessed via the ontology method on an instance of a class.&lt;/p&gt;
&lt;h3&gt;Code Example&lt;/h3&gt;
&lt;p&gt;This example is based on some terms in the &lt;a href=&quot;http://www.rsna.org/radlex/&quot;&gt;Radlex 2.0 ontology&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;
require 'active_sesame'
class OntologyTest
  attr_accessor :owl_term
  ActiveSesame::Behaviors::Ontology.mimic(self)
end

ot = OntologyTerm.new
ot.owl_term = &quot;http://www.owl-ontologies.com/Ontology1241733063#RID3436&quot;
ot.ontology #Builds a ActiveSesame::Ontology::Term for the value of owl_term
ot.ontology.relationships
ot.ontology.Preferred_Name.term #Looks up relationships and returns the Ontology::Term for its value
ot.ontology.Is_A
ot.ontology.Is_A.Preferred_Name
end
&lt;/pre&gt;</body>
  <created-at type="datetime">2009-11-25T23:28:28-08:00</created-at>
  <id type="integer">261939</id>
  <permalink>behaviors</permalink>
  <repository-id type="integer">11798</repository-id>
  <title>Behaviors</title>
  <updated-at type="datetime">2009-07-10T17:18:56-07:00</updated-at>
  <user-id type="integer">8178</user-id>
</wiki>
