Class: Lutaml::Rdf::MappingRule

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/rdf/mapping_rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(predicate_name, namespace:, to:, lang_tagged: false) ⇒ MappingRule

Returns a new instance of MappingRule.



8
9
10
11
12
13
14
# File 'lib/lutaml/rdf/mapping_rule.rb', line 8

def initialize(predicate_name, namespace:, to:, lang_tagged: false)
  validate!(predicate_name, namespace, to)
  @predicate_name = predicate_name.to_s.freeze
  @namespace = namespace
  @to = to
  @lang_tagged = lang_tagged
end

Instance Attribute Details

#lang_taggedObject (readonly)

Returns the value of attribute lang_tagged.



6
7
8
# File 'lib/lutaml/rdf/mapping_rule.rb', line 6

def lang_tagged
  @lang_tagged
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



6
7
8
# File 'lib/lutaml/rdf/mapping_rule.rb', line 6

def namespace
  @namespace
end

#predicate_nameObject (readonly)

Returns the value of attribute predicate_name.



6
7
8
# File 'lib/lutaml/rdf/mapping_rule.rb', line 6

def predicate_name
  @predicate_name
end

#toObject (readonly)

Returns the value of attribute to.



6
7
8
# File 'lib/lutaml/rdf/mapping_rule.rb', line 6

def to
  @to
end

Instance Method Details

#prefixed_nameObject



20
21
22
# File 'lib/lutaml/rdf/mapping_rule.rb', line 20

def prefixed_name
  @namespace.prefixed(@predicate_name)
end

#uriObject



16
17
18
# File 'lib/lutaml/rdf/mapping_rule.rb', line 16

def uri
  @namespace[@predicate_name]
end