Class RDFUtil

Description

Useful utility methods.

Static class.

  • author: Chris Bizer <chris@bizer.de>, Daniel Westphal <dawe@gmx.de>
  • author: Anton Köstlbacher <anton1@koestlbacher.de>
  • version: $Id: RDFUtil.html 443 2007-06-01 16:25:38Z cax $
  • access: public

Located in /util/RdfUtil.php (line 17)

Object
   |
   --RDFUtil
Method Summary
object Resource createOrd (Integer $num)
String escapeValue (String $textValue)
string getLocalName (Object $resource)
string getNamespace (Object $resource)
Integer getOrd (object Resource $resource)
void getPrefix (String $uri)
string guessName (String $uri)
string guessNamespace (String $uri)
string, guessPrefix (string $uri,  &$model, object $model)
boolean isRDF (Object $resource)
string, visualizeGraph (object Model &$model, [string $format = "input_dot"], [boolean $short_prefix = TRUE])
void writeHTMLTable (object MemModel &$model)
Methods
createOrd (line 162)

Creates ordinal RDF resource out of an integer.

  • access: public
object Resource createOrd (Integer $num)
  • Integer $num
escapeValue (line 127)

Escapes < > and &

  • access: public
String escapeValue (String $textValue)
  • String $textValue
getLocalName (line 60)

Delivers the Localname (without the namespace prefix) out of the URI of a Resource.

  • access: public
string getLocalName (Object $resource)
  • Object $resource: Resource $resource
getNamespace (line 49)

Extracts the namespace prefix out of the URI of a Resource.

  • access: public
string getNamespace (Object $resource)
  • Object $resource: Resource $resource
getOrd (line 144)

Converts an ordinal RDF resource to an integer.

e.g. Resource(RDF:_1) => 1

  • access: public
Integer getOrd (object Resource $resource)
  • object Resource $resource
getPrefix (line 87)

Short Prefix for known Namespaces by given URI

  • access: public
void getPrefix (String $uri)
  • String $uri
guessName (line 38)

Delivers the name out of the URI (without the namespace prefix).

  • access: public
string guessName (String $uri)
  • String $uri
guessNamespace (line 26)

Extracts the namespace prefix out of a URI.

  • access: public
string guessNamespace (String $uri)
  • String $uri
guessPrefix (line 337)

Short Prefix for known and/or parsed Namespaces by given URI and Model Uses $default_prefixes defined in constants.php and getParsedNamespaces() Returns FALSE if no matching prefix is found

string, guessPrefix (string $uri,  &$model, object $model)
  • string $uri
  • object $model
  • &$model
isRDF (line 116)

Tests if the URI of a resource belongs to the RDF syntax/model namespace.

  • access: public
boolean isRDF (Object $resource)
  • Object $resource: Resource $resource
visualizeGraph (line 382)

Generates a dot-file for drawing graphical output with the

graphviz-application which can be downloaded at http://www.graphviz.org If the graphviz-application is installed and its path is set to the correct value in constants.php we can directly generate any file format graphviz supports, e.g. SVG, PNG Parameters: model to visualize, output format, use prefixes

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING: Graphviz can be slow with large models. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

string, visualizeGraph (object Model &$model, [string $format = "input_dot"], [boolean $short_prefix = TRUE])
  • string $format
  • boolean $short_prefix
  • object Model &$model
writeHTMLTable (line 173)

Prints a MemModel as HTML table.

You can change the colors in the configuration file.

  • access: public
void writeHTMLTable (object MemModel &$model)
  • object MemModel &$model

Inherited Methods

Inherited From Object

Object::toString()

Documentation generated on Fri, 1 Jun 2007 16:50:57 +0200 by phpDocumentor 1.3.2