@ignore
protected function serialiseObject($object) {
if ($object instanceof EasyRdf_Resource) {
return $this
->serialiseResource($object);
}
else {
$value = strval($object);
$quoted = $this
->quotedString($value);
if ($datatype = $object
->getDatatypeUri()) {
$short = EasyRdf_Namespace::shorten($datatype, true);
if ($short) {
$this
->addPrefix($short);
if ($short == 'xsd:integer') {
return sprintf('%d', $value);
}
elseif ($short == 'xsd:decimal') {
return sprintf('%g', $value);
}
elseif ($short == 'xsd:double') {
return sprintf('%e', $value);
}
elseif ($short == 'xsd:boolean') {
return sprintf('%s', $value ? 'true' : 'false');
}
else {
return sprintf('%s^^%s', $quoted, $short);
}
}
else {
$datatypeUri = str_replace('>', '\\>', $datatype);
return sprintf('%s^^<%s>', $quoted, $datatypeUri);
}
}
elseif ($lang = $object
->getLang()) {
return $quoted . '@' . $lang;
}
else {
return $quoted;
}
}
}