Class: Rafflesia::OntologyRelationData

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

Constant Summary collapse

HASH_ATTRS =
{
  aliases: :aliases,
  columns: :columns,
  default_order: :default_order,
  description: :description,
  domain: :domain,
  entity_type: :entity_type,
  evidence_relationship_contracts: :evidence_relationship_contracts,
  grain: :grain,
  id: :id,
  name: :name,
  object: :object,
  ontology_digest: :ontology_digest,
  ontology_version: :ontology_version,
  partition_scope: :partition_scope,
  primary_key: :primary_key,
  quality_notes: :quality_notes,
  recommended_filters: :recommended_filters,
  relationships: :relationships,
  row_scope_column: :row_scope_column,
  schema_hash: :schema_hash,
  schema_version: :schema_version,
  url: :url
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ OntologyRelationData

Returns a new instance of OntologyRelationData.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 57

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @aliases = (hash[:aliases] || [])
  @columns = (hash[:columns] || []).map { |item| item ? Rafflesia::OntologyColumnData.new(item) : nil }
  @default_order = (hash[:default_order] || [])
  @description = hash[:description]
  @domain = hash[:domain]
  @entity_type = hash[:entity_type]
  @evidence_relationship_contracts = (hash[:evidence_relationship_contracts] || []).map { |item| item ? Rafflesia::OntologyEvidenceRelationshipContractData.new(item) : nil }
  @grain = hash[:grain]
  @id = hash[:id]
  @name = hash[:name]
  @object = hash[:object]
  @ontology_digest = hash[:ontology_digest]
  @ontology_version = hash[:ontology_version]
  @partition_scope = hash[:partition_scope]
  @primary_key = (hash[:primary_key] || [])
  @quality_notes = (hash[:quality_notes] || [])
  @recommended_filters = (hash[:recommended_filters] || [])
  @relationships = (hash[:relationships] || []).map { |item| item ? Rafflesia::OntologyRelationshipData.new(item) : nil }
  @row_scope_column = hash[:row_scope_column]
  @schema_hash = hash[:schema_hash]
  @schema_version = hash[:schema_version]
  @url = hash[:url]
end

Instance Attribute Details

#aliasesObject

Returns the value of attribute aliases.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def aliases
  @aliases
end

#columnsObject

Returns the value of attribute columns.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def columns
  @columns
end

#default_orderObject

Returns the value of attribute default_order.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def default_order
  @default_order
end

#descriptionObject

Returns the value of attribute description.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def description
  @description
end

#domainObject

Returns the value of attribute domain.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def domain
  @domain
end

#entity_typeObject

Returns the value of attribute entity_type.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def entity_type
  @entity_type
end

#evidence_relationship_contractsObject

Returns the value of attribute evidence_relationship_contracts.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def evidence_relationship_contracts
  @evidence_relationship_contracts
end

#grainObject

Returns the value of attribute grain.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def grain
  @grain
end

#idObject

Returns the value of attribute id.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def id
  @id
end

#nameObject

Returns the value of attribute name.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def name
  @name
end

#objectObject

Returns the value of attribute object.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def object
  @object
end

#ontology_digestObject

Returns the value of attribute ontology_digest.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def ontology_digest
  @ontology_digest
end

#ontology_versionObject

Returns the value of attribute ontology_version.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def ontology_version
  @ontology_version
end

#partition_scopeObject

Returns the value of attribute partition_scope.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def partition_scope
  @partition_scope
end

#primary_keyObject

Returns the value of attribute primary_key.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def primary_key
  @primary_key
end

#quality_notesObject

Returns the value of attribute quality_notes.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def quality_notes
  @quality_notes
end

Returns the value of attribute recommended_filters.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def recommended_filters
  @recommended_filters
end

#relationshipsObject

Returns the value of attribute relationships.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def relationships
  @relationships
end

#row_scope_columnObject

Returns the value of attribute row_scope_column.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def row_scope_column
  @row_scope_column
end

#schema_hashObject

Returns the value of attribute schema_hash.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def schema_hash
  @schema_hash
end

#schema_versionObject

Returns the value of attribute schema_version.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def schema_version
  @schema_version
end

#urlObject

Returns the value of attribute url.



33
34
35
# File 'lib/rafflesia/ontology/ontology_relation_data.rb', line 33

def url
  @url
end