Module: BEL::Gen::Nanopub
- Includes:
- Annotation, Citation, DocumentHeader, Namespace, Parameter, Statement, Term
- Defined in:
- lib/bel/gen/nanopub.rb
Overview
Constant Summary
Constants included from Term
Constants included from Namespace
BEL::Gen::Namespace::NAMESPACES
Constants included from Statement
Constants included from Annotation
Instance Method Summary collapse
-
#nanopub ⇒ BEL::Nanopub::Nanopub
Returns a random Nanopub::Nanopub.
Methods included from Term
Methods included from Parameter
#bel_parameter, #bel_parameter_with_namespace, #bel_parameter_without_namespace
Methods included from Namespace
#namespace, #referenced_namespaces
Methods included from Statement
Methods included from Citation
#citation, #citation_authors, #citation_comment, #citation_date, #citation_id, #citation_name, #citation_type
Methods included from Annotation
#annotation, #referenced_annotations
Methods included from DocumentHeader
#document_authors, #document_contact_info, #document_copyright, #document_description, #document_header, #document_licenses, #document_name, #document_version
Instance Method Details
#nanopub ⇒ BEL::Nanopub::Nanopub
Returns a random Nanopub::Nanopub.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/bel/gen/nanopub.rb', line 32 def nanopub nanopub = BEL::Nanopub::Nanopub.new nanopub.bel_statement = bel_statement nanopub.citation = citation nanopub.support = BEL::Nanopub::Support.new( Rantly { sized(120) {string(:alpha)} } ) nanopub.experiment_context = BEL::Nanopub::ExperimentContext.new( (1..5).to_a.sample.times.map { annotation } ) nanopub.references = BEL::Nanopub::References.new({ :namespaces => referenced_namespaces.map { |prefix, ns_def| { :keyword => prefix, :uri => ns_def.url } }.sort_by { |ns| ns[:keyword] }, :annotations => referenced_annotations.map { |keyword, anno_def| { :keyword => keyword, :type => :uri, :domain => anno_def.url } } }) nanopub. = BEL::Nanopub::Metadata.new({ :document_header => document_header }) nanopub end |