model
[ class tree: model ] [ index: model ] [ all elements ]

Class: RDF_Literal

Source Location: /RDF-0.2.0/RDF/Literal.php

Class Overview

RDF_Object
   |
   --RDF_Node
      |
      --RDF_Literal

An abstract RDF node.


Author(s):

Version:

  • V0.7

Variables

Methods


Inherited Variables

Inherited Methods

Class: RDF_Object

RDF_Object::factory()
RDF_Object::toString()
Serializes a object into a string

Class Details

[line 19]
An abstract RDF node.

Can either be resource, literal or blank node. Node is used in some comparisons like is_a($obj, 'RDF_Node'), meaning is $obj a resource, blank node or literal.



[ Top ]


Class Variables

$dtype =

[line 42]

Datatype of the literal
  • Access: protected

Type:   string


[ Top ]

$label =

[line 27]

Label of the literal
  • Access: protected

Type:   string


[ Top ]

$lang =

[line 34]

Language of the literal
  • Access: protected

Type:   string


[ Top ]



Method Detail

equals   [line 132]

boolean equals( object literal $that)

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

Parameters:

object literal   $that   — 

[ Top ]

factory   [line 48]

void factory( string $str, [string $language = null])


Overrides RDF_Object::factory() (parent method not documented)

Parameters:

string   $str   —  label of the literal
string   $language   —  optional language identifier

[ Top ]

getDatatype   [line 102]

string getDatatype( )

Returns the datatype of the literal.
  • Return: datatype of the literal
  • Access: public

[ Top ]

getLabel   [line 69]

string getLabel( )

Returns the string value of the literal.
  • Return: value of the literal
  • Access: public

[ Top ]

getLanguage   [line 80]

string getLanguage( )

Returns the language of the literal.
  • Return: language of the literal
  • Access: public

[ Top ]

setDatatype   [line 115]

void setDatatype( string $datatype)

Sets the datatype of the literal.

Instead of datatype URI, you can also use an datatype shortcuts like STRING or INTEGER. The array $GLOBALS['_RDF_default_datatype'] with the possible shortcuts is definded in ../constants.php

  • Access: public

Parameters:

string   $datatype   —  URI of XML datatype or datatype shortcut

[ Top ]

setLanguage   [line 91]

void setLanguage( string $lang)

Sets the language of the literal.
  • Access: public

Parameters:

string   $lang   — 

[ Top ]

toString   [line 162]

string toString( )

Dumps literal.
  • Access: public

Overrides RDF_Object::toString() (Serializes a object into a string)
[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:39:28 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.