myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3262] trunk/lib/workflow_processors/taverna2.rb:


From: noreply
Subject: [myexperiment-hackers] [3262] trunk/lib/workflow_processors/taverna2.rb: Exposed t2flow semantic annotations in components element of REST API
Date: Fri, 14 Dec 2012 15:07:26 +0000 (UTC)

Revision
3262
Author
fbacall
Date
2012-12-14 15:07:26 +0000 (Fri, 14 Dec 2012)

Log Message

Exposed t2flow semantic annotations in components element of REST API

Modified Paths

Diff

Modified: trunk/lib/workflow_processors/taverna2.rb (3261 => 3262)


--- trunk/lib/workflow_processors/taverna2.rb	2012-12-14 14:36:35 UTC (rev 3261)
+++ trunk/lib/workflow_processors/taverna2.rb	2012-12-14 15:07:26 UTC (rev 3262)
@@ -245,6 +245,15 @@
           node
         end
 
+        def build_semantic_annotation_element(object)
+          build('semantic_annotation') do |semantic_annotation_element|
+            if object.semantic_annotation
+              semantic_annotation_element << build('type', object.semantic_annotation.type)
+              semantic_annotation_element << build('content', object.semantic_annotation.content)
+            end
+          end
+        end
+
         build(tag) do |components|
 
           components << build('dataflows') do |dataflows_element|
@@ -283,6 +292,8 @@
                           end
                         end
                       end
+
+                      source_element << build_semantic_annotation_element(source) if source.semantic_annotation
                     end
                   end
                 end
@@ -299,7 +310,6 @@
 
                         if sink.descriptions
                           sink.descriptions.each do |sink_description|
-
                             sink_descriptions_element << build('description', sink_description)
                           end
                         end
@@ -314,6 +324,7 @@
                           end
                         end
                       end
+                      sink_element << build_semantic_annotation_element(sink) if sink.semantic_annotation
                     end
                   end
                 end
@@ -337,6 +348,7 @@
                       processor_element << build('biomoby-service-name',   processor.biomoby_service_name)   if processor.biomoby_service_name
                       processor_element << build('biomoby-category',       processor.biomoby_category)       if processor.biomoby_category
                       processor_element << build('value',                  processor.value)                  if processor.value
+                      processor_element << build_semantic_annotation_element(processor)                      if processor.semantic_annotation
 
                       if processor.dataflow_id
                         nested_dataflow = base_model.dataflow(processor.dataflow_id)
@@ -366,6 +378,8 @@
                     end
                   end
                 end
+
+                dataflow_element << build_semantic_annotation_element(dataflow.annotations) if dataflow.annotations.semantic_annotation
               end
             end
           end

reply via email to

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