Source

p5-rdf-rdfa-api / example1.pl

use lib "lib";

use Data::Dumper;
use RDF::RDFa::API;

my $C     = RDF::RDFa::API::DataContext->new;
my $plain = RDF::RDFa::API::PlainLiteral->construct("Hello World", "en");
my $typed = RDF::RDFa::API::TypedLiteral->construct("Hello World", "xsd:string", dataContext => $C);
my $iri   = RDF::RDFa::API::IRI->construct("http://example.com/doc");
my $bnode = RDF::RDFa::API::BlankNode->construct("_:foobar");
my $st    = RDF::RDFa::API::RDFTriple->construct($bnode, $iri, $plain);

print Dumper(
{
	plain  => $plain,
	typed  => $typed,
	iri    => $iri,
	bnode  => $bnode,
	st     => $st,
	C      => $C,
}
);

print Dumper(\%RDF::RDFa::API::DataContext::DefaultConverters);

print "
{
	plain  => $plain,
	typed  => $typed,
	iri    => $iri,
	bnode  => $bnode,
	st     => $st,
}
";