<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,16 @@
 module ActiveSesame::Behaviors
+
   module Ontology
+
+    def self.mimic(klass, options={})
+      defaults = {:repository =&gt; ActiveSesame::Repository.new, :ontology_attribute =&gt; :name}
+      defaults.merge!(options)
+      klass.send(:include, self)
+      klass.repository = defaults[:repository]
+      klass.ontology_attribute = defaults[:ontology_attribute]
+      return klass
+    end
+
     def self.included(klass)
       class &lt;&lt; klass
         attr_accessor :ontology_attribute, :repository
@@ -12,27 +23,16 @@ module ActiveSesame::Behaviors
           block_given? ? attribute_value = yield(value) : attribute_value = value
           self.ontology_attribute = value.to_sym
         end
+
+        def self.set_repository(repository)
+          self.repository = repository
+        end
       end
     end
 
-
     def ontology
-      @ontology ||= ActiveSesame::Ontology::Term.new(self.send(self.class.ontology_attribute))
+      @ontology ||= ActiveSesame::Ontology::Term.new(self.send(self.class.ontology_attribute), self.class.repository)
     end
   end
 
-  module FuzzyOntology
-    #tag class: default to owl:Thing or rdf:Type
-    #SPARQL for Radlex:
-    ##  SELECT ?name WHERE { {?term &lt;Preferred_Name&gt; ?name} UNION {?otherterm &lt;Synonym_Name&gt; ?name} }
-    def self.include_fuzzy_ontology(klass, attribute_name, options={})
-      options = {
-        :method_name =&gt; :terms,
-        :sparql =&gt; &quot;SELECT ?s WHERE { {?s rdf:Type owl:Thing} UNION {?s rdf:Type rdfs:Class} UNION {?s rdfs:subClass owl:Thing} }&quot;
-      }.merge(options)
-      repo = ActiveSesame::Repository.new
-      repo.find_by_sparql(options[:sparql])
-    end
-
-  end
 end</diff>
      <filename>lib/active_sesame/behaviors.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,8 +15,8 @@ module ActiveSesame::Ontology
       end
     end
 
-    def initialize(ontoterm)
-      @@repo ||= ActiveSesame::Repository.new
+    def initialize(ontoterm, repo = ActiveSesame::Repository.new)
+      @@repo = repo
       @term = ontoterm
       set_relationships
     end</diff>
      <filename>lib/active_sesame/ontology.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,8 +24,7 @@ describe ActiveSesame do
       before do
         class TermTest
           attr_accessor :name
-          include ActiveSesame::Behaviors::Ontology
-          set_ontology_attribute :name
+          ActiveSesame::Behaviors::Ontology.mimic(self)
         end
         @term = TermTest.new
         @term.name = &quot;http://www.owl-ontologies.com/Ontology1241733063.owl#RID3436&quot;
@@ -47,7 +46,7 @@ describe ActiveSesame do
     end
 
     it &quot;should make a sparql query&quot; do
-      ActiveSesame::Behaviors::FuzzyOntology.include_fuzzy_ontology(self, :bogus).should_not be_equal(nil)
+      #ActiveSesame::Behaviors::FuzzyOntology.include_fuzzy_ontology(self, :bogus).should_not be_equal(nil)
     end
   end
 </diff>
      <filename>lib/active_sesame/spec_active_sesame.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9f68b9aada0cf73b4e04a9c6c005dc81ce5a13dd</id>
    </parent>
  </parents>
  <author>
    <name>Max Warnock</name>
    <email>circuitshaman@email.com</email>
  </author>
  <url>http://github.com/mwarnock/activesesame/commit/aecb7b506e06b398a40020627383cb506648ea77</url>
  <id>aecb7b506e06b398a40020627383cb506648ea77</id>
  <committed-date>2009-07-09T19:57:51-07:00</committed-date>
  <authored-date>2009-07-09T19:57:51-07:00</authored-date>
  <message>Ontology Behavior Update

The ontology behavior can now be included in a class using the mimic
method.  The Ontology::Term now takes a repository as an argument so
that the default is not forced on the user.</message>
  <tree>05d7262585a2dd755553628f07d368011f17a47d</tree>
  <committer>
    <name>Max Warnock</name>
    <email>circuitshaman@email.com</email>
  </committer>
</commit>
