Class: Lutaml::Rdf::Mapping

Inherits:
Object
  • Object
show all
Defined in:
lib/glossarist/rdf/ext/mapping_ext.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#namespace_set=(value) ⇒ Object (writeonly)

Sets the attribute namespace_set

Parameters:

  • value

    the value to set the attribute namespace_set to.



11
12
13
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 11

def namespace_set=(value)
  @namespace_set = value
end

#rdf_members=(value) ⇒ Object (writeonly)

Sets the attribute rdf_members

Parameters:

  • value

    the value to set the attribute rdf_members to.



11
12
13
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 11

def rdf_members=(value)
  @rdf_members = value
end

#rdf_predicates=(value) ⇒ Object (writeonly)

Sets the attribute rdf_predicates

Parameters:

  • value

    the value to set the attribute rdf_predicates to.



11
12
13
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 11

def rdf_predicates=(value)
  @rdf_predicates = value
end

#rdf_subject=(value) ⇒ Object (writeonly)

Sets the attribute rdf_subject

Parameters:

  • value

    the value to set the attribute rdf_subject to.



11
12
13
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 11

def rdf_subject=(value)
  @rdf_subject = value
end

#rdf_type=(value) ⇒ Object (writeonly)

Sets the attribute rdf_type

Parameters:

  • value

    the value to set the attribute rdf_type to.



11
12
13
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 11

def rdf_type=(value)
  @rdf_type = value
end

Instance Method Details

#has_types_or_predicates?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 32

def has_types_or_predicates?
  rdf_types.any? || rdf_predicates.any?
end

#rdf_typesObject



18
19
20
21
22
23
24
25
26
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 18

def rdf_types
  if defined?(@rdf_types) && @rdf_types
    @rdf_types
  elsif @rdf_type
    [@rdf_type.to_s]
  else
    []
  end
end

#rdf_types=(values) ⇒ Object



28
29
30
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 28

def rdf_types=(values)
  @rdf_types = values
end

#types(*values) ⇒ Object



14
15
16
# File 'lib/glossarist/rdf/ext/mapping_ext.rb', line 14

def types(*values)
  @rdf_types = values.flatten.map(&:to_s)
end