myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3414] branches/wf4ever/app: changed method for g


From: noreply
Subject: [myexperiment-hackers] [3414] branches/wf4ever/app: changed method for getting pack resource types
Date: Mon, 11 Feb 2013 13:57:41 +0000 (UTC)

Revision
3414
Author
dgc
Date
2013-02-11 13:57:40 +0000 (Mon, 11 Feb 2013)

Log Message

changed method for getting pack resource types

Modified Paths

Diff

Modified: branches/wf4ever/app/helpers/research_objects_helper.rb (3413 => 3414)


--- branches/wf4ever/app/helpers/research_objects_helper.rb	2013-02-11 13:32:10 UTC (rev 3413)
+++ branches/wf4ever/app/helpers/research_objects_helper.rb	2013-02-11 13:57:40 UTC (rev 3414)
@@ -50,7 +50,12 @@
   end
   
   def resource_types(annotations, resource_uri)
-    annotations.graph.query([RDF::URI(resource_uri), RDF::type, nil]).map do |s,p,type|
+    if annotations.is_a?(ROSRS::RDFGraph)
+      graph = annotations.graph
+    else
+      graph = annotations
+    end
+    graph.query([RDF::URI(resource_uri), RDF::type, nil]).map do |s,p,type|
       type.to_s
     end
   end

Modified: branches/wf4ever/app/views/packs/_items.rhtml (3413 => 3414)


--- branches/wf4ever/app/views/packs/_items.rhtml	2013-02-11 13:32:10 UTC (rev 3413)
+++ branches/wf4ever/app/views/packs/_items.rhtml	2013-02-11 13:57:40 UTC (rev 3414)
@@ -100,8 +100,7 @@
           <% 
           label = e.ro_local_uri
           label = label.split("/").last unless label.starts_with?("http:")
-          annotations = get_annotations(pack.ro_uri, e.uri)
-          types = resource_types_as_labels(annotations, e.uri)
+          types = resource_types_as_labels(@all_annotations, e.uri)
           %>
           <li>
             <%= link_to(label, pack_resources_path(pack) + '/' + e.ro_local_uri) -%>

reply via email to

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