Class: Rafflesia::OntologyRelationshipData

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

Constant Summary collapse

HASH_ATTRS =
{
  cardinality: :cardinality,
  coordinate_notes: :coordinate_notes,
  from_relation: :from_relation,
  id: :id,
  is_lossy: :is_lossy,
  is_range_mapping: :is_range_mapping,
  object: :object,
  ontology_digest: :ontology_digest,
  ontology_version: :ontology_version,
  safety: :safety,
  safety_reason: :safety_reason,
  to_relation: :to_relation,
  url: :url,
  variants: :variants
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ OntologyRelationshipData

Returns a new instance of OntologyRelationshipData.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 41

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @cardinality = hash[:cardinality]
  @coordinate_notes = hash[:coordinate_notes]
  @from_relation = hash[:from_relation]
  @id = hash[:id]
  @is_lossy = hash[:is_lossy]
  @is_range_mapping = hash[:is_range_mapping]
  @object = hash[:object]
  @ontology_digest = hash[:ontology_digest]
  @ontology_version = hash[:ontology_version]
  @safety = hash[:safety]
  @safety_reason = hash[:safety_reason]
  @to_relation = hash[:to_relation]
  @url = hash[:url]
  @variants = (hash[:variants] || []).map { |item| item ? Rafflesia::OntologyJoinStep.new(item) : nil }
end

Instance Attribute Details

#cardinalityObject

Returns the value of attribute cardinality.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def cardinality
  @cardinality
end

#coordinate_notesObject

Returns the value of attribute coordinate_notes.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def coordinate_notes
  @coordinate_notes
end

#from_relationObject

Returns the value of attribute from_relation.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def from_relation
  @from_relation
end

#idObject

Returns the value of attribute id.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def id
  @id
end

#is_lossyObject

Returns the value of attribute is_lossy.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def is_lossy
  @is_lossy
end

#is_range_mappingObject

Returns the value of attribute is_range_mapping.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def is_range_mapping
  @is_range_mapping
end

#objectObject

Returns the value of attribute object.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def object
  @object
end

#ontology_digestObject

Returns the value of attribute ontology_digest.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def ontology_digest
  @ontology_digest
end

#ontology_versionObject

Returns the value of attribute ontology_version.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def ontology_version
  @ontology_version
end

#safetyObject

Returns the value of attribute safety.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def safety
  @safety
end

#safety_reasonObject

Returns the value of attribute safety_reason.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def safety_reason
  @safety_reason
end

#to_relationObject

Returns the value of attribute to_relation.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def to_relation
  @to_relation
end

#urlObject

Returns the value of attribute url.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def url
  @url
end

#variantsObject

Returns the value of attribute variants.



25
26
27
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25

def variants
  @variants
end