lib/term_bootstrapper.rb
# NOTE: This must be updated if you intend to pick up new fields from EolTerms
This must be updated if you intend to pick up new fields from EolTerms
This must be updated if you intend to pick up new fields from EolTerms
def term_from_gem_by_uri
    return @term_from_gem_by_uri unless @term_from_gem_by_uri.nil?
    @term_from_gem_by_uri = {}
    EolTerms.list.each do |gem_term|
      term = {}
      RECOGNIZED_FIELDS.each do |field|
        term[field] = gem_term[field] || ''
        if field =~ /^is_/
          term[field] = false if term[field].blank?
        end
      end
      term['parent_uris'] = Array(term['parent_uris']).sort
      @term_from_gem_by_uri[term['uri']] = term
    end
    @term_from_gem_by_uri
  end
def term_from_gem_by_uri return @term_from_gem_by_uri unless @term_from_gem_by_uri . nil? @term_from_gem_by_uri = { } EolTerms . list . each do | gem_term | term = { } RECOGNIZED_FIELDS . each do | field | term [ field ] = gem_term [ field ] || '' if field =~ / ^is_ / term [ field ] = false if term [ field ] . blank? end end term [ 'parent_uris' ] = Array ( term [ 'parent_uris' ] ) . sort @term_from_gem_by_uri [ term [ 'uri' ] ] = term end @term_from_gem_by_uri end
NOTE: This must be updated if you intend to pick up new fields from EolTerms
NOTE : This must be updated if you intend to pick up new fields from EolTerms
# Sort the parents, to match results from neo4j: