How to add rdf:datatype with EasyRdf

305 Views Asked by At

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>
1

There are 1 best solutions below

3
On BEST ANSWER

This produces the desired effect

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