class BELParser::Resource::JenaTDBReader::Concept

Attributes

dataset[R]
encodings[R]
identifier[R]
name[R]
synonyms[R]
title[R]
uri[R]

Public Class Methods

new(dataset, uri, pref_label, identifier, title, alt_labels, types) click to toggle source
# File lib/bel_parser/resource/jena_tdb_reader.rb, line 187
def initialize(dataset, uri, pref_label, identifier,
               title, alt_labels, types)

  @dataset    = dataset
  @uri        = uri
  @name       = pref_label.to_s
  @identifier = identifier.to_s
  @title      = title.to_s
  @synonyms   =
    if alt_labels.respond_to?(:each)
      alt_labels.map(&:to_s)
    else
      alt_labels.to_s.split('|')
    end
  @encodings  =
    if types.respond_to?(:each)
      convert_encoding_types(types.map(&:to_s))
    else
      convert_encoding_types(types.to_s.split('|'))
    end
end

Private Instance Methods

convert_encoding_types(types) click to toggle source
# File lib/bel_parser/resource/jena_tdb_reader.rb, line 211
def convert_encoding_types(types)
  types.map do |type|
    case type
    when BELV.AbundanceConcept
      :A
    when BELV.BiologicalProcessConcept
      :B
    when BELV.ComplexConcept
      :C
    when BELV.GeneConcept
      :G
    when BELV.LocationConcept
      :L
    when BELV.MicroRNAConcept
      :M
    when BELV.MolecularActivityConcept
      :T
    when BELV.PathologyConcept
      :O
    when BELV.ProteinConcept
      :P
    when BELV.ProteinModificationConcept
      :E
    when BELV.RNAConcept
      :R
    end
  end.compact
end