Class: RDF::Literal::XML
- Inherits:
-
RDF::Literal
- Object
- RDF::Literal
- RDF::Literal::XML
- Defined in:
- lib/rdf/model/literal/xml.rb
Overview
An XML literal.
Constant Summary collapse
- DATATYPE =
RDF.XMLLiteral
- GRAMMAR =
nil
Constants inherited from RDF::Literal
Instance Attribute Summary
Attributes inherited from RDF::Literal
Instance Method Summary collapse
-
#canonicalize! ⇒ RDF::Literal
Converts this literal into its canonical lexical representation.
-
#initialize(value, options = {}) ⇒ XML
constructor
A new instance of XML.
-
#to_s ⇒ String
Returns the value as a string.
Methods inherited from RDF::Literal
#==, #anonymous?, #canonicalize, #comperable_datatype?, datatyped_class, #eql?, #has_datatype?, #has_language?, #hash, #inspect, #invalid?, #literal?, new, #object, #plain?, #valid?, #validate!, #value
Methods included from Term
#<=>, #==, #constant?, #eql?, #variable?
Methods included from Value
#graph?, #inspect, #inspect!, #iri?, #literal?, #node?, #resource?, #statement?, #to_ntriples, #to_quad, #to_rdf, #type_error, #uri?, #variable?
Constructor Details
#initialize(value, options = {}) ⇒ XML
Returns a new instance of XML.
15 16 17 18 19 |
# File 'lib/rdf/model/literal/xml.rb', line 15 def initialize(value, = {}) @datatype = [:datatype] || self.class.const_get(:DATATYPE) @string = [:lexical] if .has_key?(:lexical) @object = value # TODO: parse XML string using REXML end |
Instance Method Details
#canonicalize! ⇒ RDF::Literal
Converts this literal into its canonical lexical representation.
26 27 28 29 |
# File 'lib/rdf/model/literal/xml.rb', line 26 def canonicalize! # TODO: implement XML canonicalization self end |
#to_s ⇒ String
Returns the value as a string.
35 36 37 |
# File 'lib/rdf/model/literal/xml.rb', line 35 def to_s @string || @object.to_s # TODO end |