Module: Spread2RDF::Schema::ResourceCreation

Included in:
Column, Sheet
Defined in:
lib/spread2rdf/schema/resource_creation_schema.rb

Instance Method Summary collapse

Instance Method Details

#resource_creation_modeObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/spread2rdf/schema/resource_creation_schema.rb', line 5

def resource_creation_mode
  attr = self.resource_creation_attributes
  case
    when ( attr.try(:fetch, :uri, nil) || attr ) == :bnode
      :bnode
    when !( attr.try(:fetch, :uri, nil).try(:fetch, :namespace, nil) ).nil?
      :from_column_with_suffix
    else
      :from_column
  end
end

#resource_creation_namespaceObject



17
18
19
20
21
22
# File 'lib/spread2rdf/schema/resource_creation_schema.rb', line 17

def resource_creation_namespace
  namespace_name =
      self.resource_creation_attributes.try(:fetch, :uri, nil).try(:fetch, :namespace, nil)
  return warn("No namespace for resource creation found") if namespace_name.nil?
  Namespace.resolve_to_namespace(namespace_name)
end