Sha256: 35840c10c4893023f2f05476b0b4d0a551513cc3c163d8c9ab134d36731b9608
Contents?: true
Size: 852 Bytes
Versions: 6
Compression:
Stored size: 852 Bytes
Contents
module Jena module Util # Return the given prefix map object as a `PrefixMapping`. Convert a hash # to a `PrefixMapping` if necessary def self.as_prefix_map( map ) return nil unless map return map if map.is_a? com.hp.hpl.jena.shared.PrefixMapping pm = com.hp.hpl.jena.shared.impl.PrefixMappingImpl.new map.each_pair do |k,v| pm.setNsPrefix k.to_s, v.to_s end pm end # Return a new resource URN made from a UUID. If the given def self.uuid_resource( model = nil ) (model || Core::ResourceFactory).createResource( Util::JenaUUID.factory.generate.asURN ) end # Return the current time as a literal def self.now cal = java.util.Calendar.getInstance cal.setTime( java.util.Date.new ) Core::ResourceFactory.createTypedLiteral( cal ) end end end
Version data entries
6 entries across 6 versions & 2 rubygems