class EasyRdf_Literal_Decimal extends EasyRdf_Literal
Class that represents an RDF Literal of datatype xsd:decimal
Constants
DECIMAL_REGEX |
written according to http://www.w3.org/TR/xmlschema-2/#decimal
|
Methods
static object |
create(mixed $value, string $lang = null, string $datatype = null)
Create a new literal object |
from EasyRdf_Literal |
static |
setDatatypeMapping(string $datatype, string $class)
Register an RDF datatype with a PHP class name |
from EasyRdf_Literal |
static |
deleteDatatypeMapping(string $datatype)
Remove the mapping between an RDF datatype and a PHP class name |
from EasyRdf_Literal |
static string |
getDatatypeForValue($value)
Get datatype URI for a PHP value. |
from EasyRdf_Literal |
EasyRdf_Literal_Decimal |
__construct(double|int|string $value, string $lang = null, string $datatype = null)
Constructor for creating a new decimal literal |
|
string |
getValue()
Return the value of the literal cast to a PHP string |
|
string |
getDatatypeUri()
Returns the full datatype URI of the literal. |
from EasyRdf_Literal |
string |
getDatatype()
Returns the shortened datatype URI of the literal. |
from EasyRdf_Literal |
string |
getLang()
Returns the language of the literal. |
from EasyRdf_Literal |
array |
toRdfPhp()
Returns the properties of the literal as an associative array |
from EasyRdf_Literal |
string |
__toString()
Magic method to return the value of a literal as a string |
from EasyRdf_Literal |
string |
dumpValue(string $format = 'html', string $color = 'black')
Return pretty-print view of the literal |
from EasyRdf_Literal |
static |
validate(string $value)
|
|
static string |
canonicalise(string $value)
Converts valid xsd:decimal literal to Canonical representation see http://www.w3.org/TR/xmlschema-2/#decimal |
Details
in EasyRdf_Literal at line 79
static public object
create(mixed $value, string $lang = null, string $datatype = null)
Create a new literal object
PHP values of type bool, int or float, will automatically be converted to the corresponding datatype and PHP sub-class.
If a registered datatype is given, then the registered subclass of EasyRdf_Literal will instantiated.
Note that literals are not required to have a language or datatype. Literals cannot have both a language and a datatype.
in EasyRdf_Literal at line 128
static public
setDatatypeMapping(string $datatype, string $class)
Register an RDF datatype with a PHP class name
When parsing registered class will be used whenever the datatype is seen.
When serialising a registered class, the mapping will be used to set the datatype in the RDF.
Example: EasyRdfLiteral::registerDatatype('xsd:dateTime', 'MyDateTime_Class');
in EasyRdf_Literal at line 151
static public
deleteDatatypeMapping(string $datatype)
Remove the mapping between an RDF datatype and a PHP class name
in EasyRdf_Literal at line 176
static public string
getDatatypeForValue($value)
Get datatype URI for a PHP value.
This static function is intended for internal use. Given a PHP value, it will return an XSD datatype URI for that value, for example: http://www.w3.org/2001/XMLSchema#integer
at line 62
public EasyRdf_Literal_Decimal
__construct(double|int|string $value, string $lang = null, string $datatype = null)
Constructor for creating a new decimal literal
at line 82
public string
getValue()
Return the value of the literal cast to a PHP string
in EasyRdf_Literal at line 248
public string
getDatatypeUri()
Returns the full datatype URI of the literal.
in EasyRdf_Literal at line 257
public string
getDatatype()
Returns the shortened datatype URI of the literal.
in EasyRdf_Literal at line 270
public string
getLang()
Returns the language of the literal.
in EasyRdf_Literal at line 282
public array
toRdfPhp()
Returns the properties of the literal as an associative array
For example: array('type' => 'literal', 'value' => 'string value')
in EasyRdf_Literal at line 304
public string
__toString()
Magic method to return the value of a literal as a string
in EasyRdf_Literal at line 315
public string
dumpValue(string $format = 'html', string $color = 'black')
Return pretty-print view of the literal
at line 92
static public
validate(string $value)
at line 107
static public string
canonicalise(string $value)
Converts valid xsd:decimal literal to Canonical representation see http://www.w3.org/TR/xmlschema-2/#decimal