Daniel Luca CleanUnicorn
Daniel Luca CleanUnicorn

Reputation: 1097

How to add rdf:datatype with EasyRdf

I am using http://www.easyrdf.org/ PHP library to create an RDF document. I don't know how to add to the RDF document the rdf:datatype.

So what I am trying to achieve is

<rdf:Description rdf:datatype="&xsd:integer">58</rdf:Description>

Upvotes: 0

Views: 321

Answers (1)

Daniel Luca CleanUnicorn
Daniel Luca CleanUnicorn

Reputation: 1097

This produces the desired effect

// Add xsd:integer to the resource
$rdf_resource->add(
    'rdf:Description',
    EasyRdf_Literal::create(58, null, 'xsd:integer')
);

Upvotes: 1

Related Questions