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/

  • author: Chris Bizer <chris@bizer.de>
  • author: Daniel Westphal <dawe@gmx.de>
  • version: $Id: Literal.html 443 2007-06-01 16:25:38Z cax $
  • access: public

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

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 51)

Constructor

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

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 103)

Returns the datatype of the literal.

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

Returns the string value of the literal.

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

Returns the language of the literal.

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

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 92)

Sets the language of the literal.

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

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, 1 Jun 2007 16:49:39 +0200 by phpDocumentor 1.3.2