Class: Rafflesia::OntologySnapshotData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/ontology/ontology_snapshot_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  available_digests: :available_digests,
  connectivity_classifications: :connectivity_classifications,
  coordinate_systems: :coordinate_systems,
  description: :description,
  entity_types: :entity_types,
  id: :id,
  identifier_namespaces: :identifier_namespaces,
  object: :object,
  ontology_digest: :ontology_digest,
  ontology_version: :ontology_version,
  relations: :relations,
  relationship_count: :relationship_count,
  semantic_digest: :semantic_digest,
  snapshot_digest: :snapshot_digest,
  source_digest: :source_digest,
  units: :units,
  url: :url,
  value_kinds: :value_kinds
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ OntologySnapshotData

Returns a new instance of OntologySnapshotData.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 49

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @available_digests = (hash[:available_digests] || [])
  @connectivity_classifications = (hash[:connectivity_classifications] || []).map { |item| item ? Rafflesia::OntologyConnectivityClassificationData.new(item) : nil }
  @coordinate_systems = (hash[:coordinate_systems] || []).map { |item| item ? Rafflesia::OntologyVocabularyData.new(item) : nil }
  @description = hash[:description]
  @entity_types = (hash[:entity_types] || []).map { |item| item ? Rafflesia::OntologyVocabularyData.new(item) : nil }
  @id = hash[:id]
  @identifier_namespaces = (hash[:identifier_namespaces] || []).map { |item| item ? Rafflesia::OntologyVocabularyData.new(item) : nil }
  @object = hash[:object]
  @ontology_digest = hash[:ontology_digest]
  @ontology_version = hash[:ontology_version]
  @relations = (hash[:relations] || []).map { |item| item ? Rafflesia::OntologyRelationData.new(item) : nil }
  @relationship_count = hash[:relationship_count]
  @semantic_digest = hash[:semantic_digest]
  @snapshot_digest = hash[:snapshot_digest]
  @source_digest = hash[:source_digest]
  @units = (hash[:units] || []).map { |item| item ? Rafflesia::OntologyVocabularyData.new(item) : nil }
  @url = hash[:url]
  @value_kinds = (hash[:value_kinds] || []).map { |item| item ? Rafflesia::OntologyVocabularyData.new(item) : nil }
end

Instance Attribute Details

#available_digestsObject

Returns the value of attribute available_digests.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def available_digests
  @available_digests
end

#connectivity_classificationsObject

Returns the value of attribute connectivity_classifications.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def connectivity_classifications
  @connectivity_classifications
end

#coordinate_systemsObject

Returns the value of attribute coordinate_systems.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def coordinate_systems
  @coordinate_systems
end

#descriptionObject

Returns the value of attribute description.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def description
  @description
end

#entity_typesObject

Returns the value of attribute entity_types.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def entity_types
  @entity_types
end

#idObject

Returns the value of attribute id.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def id
  @id
end

#identifier_namespacesObject

Returns the value of attribute identifier_namespaces.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def identifier_namespaces
  @identifier_namespaces
end

#objectObject

Returns the value of attribute object.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def object
  @object
end

#ontology_digestObject

Returns the value of attribute ontology_digest.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def ontology_digest
  @ontology_digest
end

#ontology_versionObject

Returns the value of attribute ontology_version.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def ontology_version
  @ontology_version
end

#relationsObject

Returns the value of attribute relations.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def relations
  @relations
end

#relationship_countObject

Returns the value of attribute relationship_count.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def relationship_count
  @relationship_count
end

#semantic_digestObject

Returns the value of attribute semantic_digest.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def semantic_digest
  @semantic_digest
end

#snapshot_digestObject

Returns the value of attribute snapshot_digest.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def snapshot_digest
  @snapshot_digest
end

#source_digestObject

Returns the value of attribute source_digest.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def source_digest
  @source_digest
end

#unitsObject

Returns the value of attribute units.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def units
  @units
end

#urlObject

Returns the value of attribute url.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def url
  @url
end

#value_kindsObject

Returns the value of attribute value_kinds.



29
30
31
# File 'lib/rafflesia/ontology/ontology_snapshot_data.rb', line 29

def value_kinds
  @value_kinds
end