require 'voruby/voevent/loader' #require 'voruby/stc/stc_v1_30' #include VORuby::STC::V1_30 module VORuby module VOEvent module V1_1 # Forward declarations class VOEvent; end class Who; end class Author; end class What; end class Param; end class Group; end class WhereWhen; end class How; end class Why; end class Name; end class Concept; end class Inference; end class Citations; end class EventIVORN < VORuby::Resources::VOResource::V0_10::AnyURI; end class Description; end class Reference; end # VOEvent is the root element for describing observations # of immediate astronomical events. For more information, see # http://www.ivoa.net/twiki/bin/view/IVOA/IvoaVOEvent. class VOEvent include XML::Mapping text_node :version, '@version', :optional => false, :default_value => '1.1' text_enumeration_node :role, '@role', :optional => true, :default_value => 'observation', :choices => ['observation', 'prediction', 'utility', 'test'] object_node :who, 'Who', :class => Who, :optional => true object_node :what, 'What', :class => What, :optional => true object_node :where_when, 'WhereWhen', :class => WhereWhen, :optional => true object_node :how, 'How', :class => How, :optional => true object_node :why, 'Why', :class => Why, :optional => true object_node :citations, 'Citations', :class => Citations, :optional => true object_node :description, 'Description', :class => Description, :optional => true object_node :reference, 'Reference', :class => Reference, :optional => true object_node :ivorn, '@ivorn', :class => VORuby::Resources::VOResource::V0_10::AnyURI, :optional => false end # Curation Metadata. class Who include XML::Mapping date_time_node :date, 'Date', :optional => false array_node :author_ivorns, 'AuthorIVORN', :class => VORuby::Resources::VOResource::V0_10::AnyURI, :optional => false array_node :descriptions, 'Description', :class => Description, :optional => true array_node :references, 'Reference', :class => Reference, :optional => true array_node :authors, 'Author', :class => Author, :optional => true end class Author include XML::Mapping text_node :title, 'title', :optional => true text_node :short_name, 'shortName', :optional => true text_node :logo_url, 'logoURL', :optional => true text_node :contact_name, 'contactName', :optional => true text_node :contact_email, 'contactEmail', :optional => true text_node :contact_phone, 'contactPhone', :optional => true text_node :contributor, 'contributor', :optional => true end # Event Characterization. class What include XML::Mapping array_node :params, 'Param', :class => Param, :optional => true, :default_value => [] array_node :groups, 'Group', :class => Group, :optional => true, :default_value => [] array_node :descriptions, 'Description', :class => Description, :optional => true, :default_value => [] array_node :references, 'Reference', :class => Reference, :optional => true, :default_value => [] end class Param include XML::Mapping text_node :name, '@name', :optional => false text_node :ucd, '@ucd', :optional => true text_node :value, '@value', :optional => false text_node :unit, '@unit', :optional => true end class Group include XML::Mapping text_node :name, '@name', :optional => true text_node :group_type, '@type', :optional => true array_node :params, 'Param', :class => Param, :optional => true, :default_value => [] array_node :descriptions, 'Description', :class => Description, :optional => true, :default_value => [] array_node :references, 'Reference', :class => Reference, :optional => true, :default_value => [] end # Space-Time Coordinates, uses the VO STC schema. class WhereWhen include XML::Mapping # I haven't modeled STC yet... #object_node :observation_location, 'ObservationLocation', :class => ObservationLocationType, # :optional => true object_node :description, 'Description', :class => Description, :optional => true object_node :reference, 'Reference', :class => Reference, :optional => true end # Instrument Configuration, references to RTML documents. class How include XML::Mapping array_node :descriptions, 'Description', :class => Description, :optional => true, :default_value => [] array_node :references, 'Reference', :class => Reference, :optional => true, :default_value => [] end # Initial Scientific Assessment. class Why include XML::Mapping numeric_node :importance, '@importance', :optional => true date_time_node :expires, '@expires', :optional => true array_node :names, 'Name', :class => Name, :optional => false array_node :concepts, 'Concept', :class => Concept, :optional => false array_node :inferences, 'Inference', :class => Inference, :optional => true array_node :descriptions, 'Description', :class => Description, :optional => true array_node :references, 'Reference', :class => Reference, :optional => true end class Name include XML::Mapping text_node :value, '', :optional => false end class Concept include XML::Mapping text_node :value, '', :optional => false end class Inference include XML::Mapping numeric_node :probability, '@probability', :optional => true text_node :relation, '@relation', :optional => true array_node :names, 'Name', :class => Name, :optional => false array_node :concepts, 'Concept', :class => Concept, :optional => false array_node :descriptions, 'Description', :class => Description, :optional => true array_node :references, 'Reference', :class => Reference, :optional => true end # Follow-up Observations. class Citations include XML::Mapping array_node :event_ivorns, 'EventIVORN', :class => EventIVORN, :optional => false array_node :descriptions, 'Description', :class => Description, :optional => true array_node :references, 'Reference', :class => Reference, :optional => true end class EventIVORN text_enumeration_node :cite, '@cite', :optional => false, :choices => ['followup', 'supersedes', 'retraction'] end # Human readable text. class Description include XML::Mapping text_node :value, '', :optional => false text_node :format, '@format', :optional => true, :default_value => 'text/plain' end # External Content. class Reference include XML::Mapping text_node :name, '@name', :optional => true text_node :reference_type, '@type', :optional => true, :default_value => 'url' object_node :uri, '@uri', :class => VORuby::Resources::VOResource::V0_10::AnyURI, :optional => false end end end end