Top Level Namespace

Includes:
ActiveRdfBenchmark

Defined Under Namespace

Modules: ActiveRDF, ActiveRdfBenchmark, Kernel, RDF, RDFS Classes: ActiveRdfLogger, Array, Date, DateTime, DirectAccess, FalseClass, Float, Integer, LocalizedString, Logger, Module, OrderedSet, PropertyList, String, Time, TrueClass, VirtuosoBIF

Instance Method Summary collapse

Methods included from ActiveRdfBenchmark

#benchmark

Instance Method Details

#load_adapter(s) ⇒ Object



39
40
41
42
43
44
45
46
47
# File 'lib/active_rdf.rb', line 39

def load_adapter s
  begin
    require s
  rescue Exception => e
    ActiveRdfLogger::log_info "Could not load adapter #{s}: #{e}"
    #raise exception if the environment variable is specified
    raise ActiveRdfError, "Could not load adapter #{s}: #{e}" unless ENV['ACTIVE_RDF_ADAPTERS'].nil?
  end
end

#truefalse(val, default = nil) ⇒ Object

extract boolean from value

Raises:

  • (ArgumentError)


36
37
38
39
40
41
42
43
# File 'lib/active_rdf_helpers.rb', line 36

def truefalse(val, default = nil)
  raise ArgumentError, "truefalse: default must be a boolean: #{default}" if !default.nil? and !(default == true || default == false)
  case val
  when true,/^yes|y$/i then true
  when false,/^no|n$/i then false
  else default
  end
end