module Spread2RDF::Schema::ResourceCreation

Public Instance Methods

resource_creation_mode() click to toggle source
# 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_namespace() click to toggle source
# 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