myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3140] branches/wf4ever/app: added AO annotations


From: noreply
Subject: [myexperiment-hackers] [3140] branches/wf4ever/app: added AO annotations and cleaned up terminology
Date: Mon, 1 Oct 2012 23:55:40 +0000 (UTC)

Revision
3140
Author
dgc
Date
2012-10-01 23:55:40 +0000 (Mon, 01 Oct 2012)

Log Message

added AO annotations and cleaned up terminology

Modified Paths

Diff

Modified: branches/wf4ever/app/models/research_object.rb (3139 => 3140)


--- branches/wf4ever/app/models/research_object.rb	2012-09-27 16:36:18 UTC (rev 3139)
+++ branches/wf4ever/app/models/research_object.rb	2012-10-01 23:55:40 UTC (rev 3140)
@@ -177,5 +177,27 @@
     end
   end
 
+  def ao_annotations
+
+    results = []
+
+    annotation_bodies = annotations.find(:all,
+        :conditions => ['predicate_text = ?', 'http://purl.org/ao/body'])
+
+    annotation_bodies.each do |body|
+
+      type = annotations.find(:first,
+          :conditions => ['predicate_text = ? AND subject_text = ?',
+          'http://www.w3.org/1999/02/22-rdf-syntax-ns#type',
+          body.subject_text])
+
+      next if type.nil?
+
+      results << { :type => type.objekt_text, :body => body.objekt_text }
+    end
+
+    results
+  end
+
 end
 

Modified: branches/wf4ever/app/views/research_objects/show.rhtml (3139 => 3140)


--- branches/wf4ever/app/views/research_objects/show.rhtml	2012-09-27 16:36:18 UTC (rev 3139)
+++ branches/wf4ever/app/views/research_objects/show.rhtml	2012-10-01 23:55:40 UTC (rev 3140)
@@ -34,11 +34,12 @@
 
 </table>
 
-<% resources = @contributable.wf4ever_resources %>
+<% resources   = @contributable.wf4ever_resources %>
+<% annotations = @contributable.ao_annotations    %>
 
 <% if resources.length > 0 %>
 
-  <h2>wf4ever resource summary</h2>
+  <h2>Aggregated resources</h2>
 
   <table class="simple">
     <tr>
@@ -61,13 +62,36 @@
 
 <% end %>
 
+<% if annotations.length > 0 %>
+
+  <h2>Annotations</h2>
+
+  <table class="simple">
+    <tr>
+      <th>Type</th>
+      <th>Value</th>
+    </tr>
+    <% annotations.each do |annotation| %>
+      <tr>
+        <td><%=h annotation[:type] -%></td>
+        <td><%=h annotation[:body] -%></td>
+      </tr>
+    <% end %>
+  </table>
+
+  <br />
+
+<% end %>
+
 <% if @contributable.annotations.length > 0 %>
 
   <div class="fold">
 
-    <div class="foldTitle">Annotation summary</div>
+    <div class="foldTitle">RDF statements (<%= @contributable.annotations.length -%>)</div>
     <div class="foldContent" style="display: none;">
 
+      <h2>Summary</h2>
+
       <table class="simple">
         <tr>
           <th>URI</th>
@@ -84,14 +108,9 @@
           </tr>
         <% end %>
       </table>
-    </div>
-  </div>
 
-  <div class="fold">
+      <h2>Statements</h2>
 
-    <div class="foldTitle">Complete annotation list (<%= @contributable.annotations.length -%>)</div>
-    <div class="foldContent" style="display: none;">
-
       <div id="annotation_list">
         <% @contributable.annotations.each do |annotation| %>
           <div>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]