Menu

#34 Unclear behaviour for creating typed literals

open
nobody
Model (10)
5
2007-08-13
2007-08-13
No

The PHPDoc for /api/model/Literal.php#setDatatype says:

“Instead of datatype URI, you can also use an datatype shortcuts like STRING or INTEGER. The array $short_datatype with the possible shortcuts is definded in ../constants.php”

Reading this, I would expect that setDatatype("STRING") would work, but it doesn't. After a short look at the code, I think the correct invocation would be setDatatype("datatype:STRING"). If this does indeed work, then the documentation should be updated.

Mentioning this feature in http://sites.wiwiss.fu-berlin.de/suhl/bizer/rdfapi/tutorial/usingtheModelAPI.htm#s7 wouldn't hurt either. (And the example in that section uses a wrong URI for xsd:integer -- correct one is <http://www.w3.org/2001/XMLSchema#integer>)

Discussion