RDFStore::Literal - An RDF Literal Node implementation
use RDFStore::Literal;
my $literal = new RDFStore::Literal('Tim Berners-Lee');
my $literal1 = new RDFStore::Literal('Today is a sunny day, again :)');
print $literal->toString." is ";
print "not"
unless $literal->equals($literal1);
print " equal to ".$literal1->toString."\n";
An RDF Literal Node implementation using Storable(3). A Literal object
can either contain plain (utf8) strings. Such an implementation allows to
create really generic RDF statements about Perl data-structures or objects for
example. Generally an RDFStore::Literal can be thought like an atomic perl
scalar. XML well-formed literal values are supported simply by storing the
resulting utf8 bytes into a perl scalar; none methods are being provided
tomanage literals as XML (e.g. SAX2 events and stuff like that)
- new ( LITERAL )
- This is a class method, the constructor for RDFStore::Literal. The only
parameter passed is either a plain perl scalar (LITERAL)
- getParseType
- Return the parseType of the RDF Literal; possible values are
Literal or Resource (default).
- getLang
- Return the language of the RDF Literal eventually coming from xml:lang
attribute on parsing.
- getDataType
- Return the RDFStore::Resource representing the XMLSchema data type of the
RDF Literal.
- getLabel
- Return the literal text of the node.
- getDigest
- Return a Cryptographic Digest (SHA-1 by default) of the RDF Literal; the
actual digest message is guranteed to be different for URI representing
RDF Resources or RDF Literals.
- equals
- Compare two literals.
http://www.w3.org/TR/rdf-primer/
http://www.w3.org/TR/rdf-mt
http://www.w3.org/TR/rdf-syntax-grammar/
http://www.w3.org/TR/rdf-schema/
http://www.w3.org/TR/1999/REC-rdf-syntax-19990222 (obsolete)
The language of the literal as recently specified by the RDF Core WG is not
supported and the typed literals are not implemented; the latter is due mainly
because perl is an untyped language and perhaps such data-typing abstractions
should fit in a higher level application specific API.
Alberto Reggiori <areggiori@webweaving.org>
Hey! The above document had some coding errors, which are explained
below:
- Around line 121:
- You forgot a '=back' before '=head1'