Sha256: 9041663baf13491dede71dedf82c292b7fb9f50bf2372d4736e0fa73617e712c

Contents?: true

Size: 551 Bytes

Versions: 2

Compression:

Stored size: 551 Bytes

Contents

module RDF
  class Literal
    # Support for XML Literals
    # Is this an XMLLiteral?
    def xmlliteral?
      datatype == RDF['XMLLiteral']
    end
    
    def anonymous?; false; end unless respond_to?(:anonymous?)
    
    ##
    # Returns a string representation of this literal.
    #
    # @return [String]
    def to_s
      quoted = value # FIXME
      output = "\"#{quoted.to_s.rdf_escape}\""
      output << "@#{language}" if has_language? && !has_datatype?
      output << "^^<#{datatype}>" if has_datatype?
      output
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rdf-n3-0.0.3 lib/rdf/n3/patches/literal_hacks.rb
rdf-n3-0.0.2 lib/rdf/n3/patches/literal_hacks.rb