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/

  • access: public
  • author: Chris Bizer <chris@bizer.de>
  • author: Daniel Westphal <dawe@gmx.de>
  • version: $Id: Literal.html,v 1.15 2006/06/26 12:34:20 tgauss Exp $

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

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

Datatype of the literal

  • access: private
string $label (line 27)

Label of the literal

  • access: private
string $lang (line 33)

Language of the literal

  • access: private
Methods
Constructor Literal (line 50)

Constructor

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

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

Returns the datatype of the literal.

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

Returns the string value of the literal.

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

Returns the language of the literal.

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

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 (mixed $datatype)
setLanguage (line 91)

Sets the language of the literal.

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

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 Mon, 26 Jun 2006 14:25:34 +0200 by phpDocumentor 1.3.0RC6