Class Literal

Description

An RDF literal.

The literal supports the xml:lang and rdf:datatype property. For XML datatypes see: http://www.w3.org/TR/xmlschema-2/



History:

Located in /model/Literal.php (line 26)

Object
   |
   --Node
      |
      --Literal
Direct descendents
Class Description
ResLiteral An RDF literal.
Method Summary
Literal Literal (string $str, [string $language = NULL])
boolean equals (object literal $that)
string getDatatype ()
string getLabel ()
string getLanguage ()
void setDatatype (string $datatype)
void setLanguage (string $lang)
string toString ()
Methods
Constructor Literal (line 56)

Constructor

Literal Literal (string $str, [string $language = NULL])
  • string $str: label of the literal
  • string $language: optional language identifier
equals (line 139)

Checks if ihe literal equals another literal.

Two literals are equal, if they have the same label and they have the same language/datatype or both have no language/datatype property set.

  • access: public
boolean equals (object literal $that)
  • object literal $that
getDatatype (line 108)

Returns the datatype of the literal.

  • return: datatype of the literal
  • access: public
string getDatatype ()
getLabel (line 75)

Returns the string value of the literal.

  • return: value of the literal
  • access: public
string getLabel ()
getLanguage (line 86)

Returns the language of the literal.

  • return: language of the literal
  • access: public
string getLanguage ()
setDatatype (line 122)

Sets the datatype of the literal.

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

  • access: public
void setDatatype (string $datatype)
  • string $datatype: URI of XML datatype or datatype shortcut
setLanguage (line 97)

Sets the language of the literal.

  • access: public
void setLanguage (string $lang)
  • string $lang
toString (line 164)

Dumps literal.

  • access: public
string toString ()

Redefinition of:
Object::toString()
Serializes a object into a string

Inherited Methods

Inherited From Object

Object::toString()

Documentation generated on Fri, 17 Dec 2004 16:15:32 +0100 by phpDocumentor 1.3.0RC3