module RDF::JSON::Extensions::Literal
RDF/JSON extensions for ‘RDF::Literal`.
Public Instance Methods
to_rdf_json()
click to toggle source
Returns the RDF/JSON representation of this literal.
@return [Hash]
# File lib/rdf/json/extensions.rb, line 73 def to_rdf_json case when has_datatype? {:type => :literal, :value => value.to_s, :datatype => datatype.to_s} when has_language? {:type => :literal, :value => value.to_s, :lang => language.to_s} else {:type => :literal, :value => value.to_s} end end