Source for file Util.php
Documentation is available at Util.php
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
* Useful utility methods.
* @author Chris Bizer <chris@bizer.de>, Daniel Westphal <dawe@gmx.de>
* Extracts the namespace prefix out of a URI.
return $l > 1 ? substr($uri , 0 , $l) : "";
* Delivers the name out of the URI (without the namespace prefix).
* Extracts the namespace prefix out of the URI of a Resource.
* @param Object Resource $resource
* Delivers the Localname (without the namespace prefix) out of the URI of a Resource.
* @param Object Resource $resource
* Position of the namespace end
* Method looks for # : and /
if ($c == '#' || $c == ':' || $c == '/') {
* Tests if the URI of a resource belongs to the RDF syntax/model namespace.
* @param Object Resource $resource
function isRDF($resource)
* @param String $textValue
* Converts an ordinal RDF resource to an integer.
* e.g. Resource(RDF:_1) => 1
* @param object Resource $resource
if ($resource == null || !is_a($resource, 'RDF_Resource')
// noch rein : checken ob $n Nummer ist !!!!!!!!!!!!!!!!!!!!!!if ($n)
* Creates ordinal RDF resource out of an integer.
* @return object Resource
* Prints a Model_Memory as HTML table.
* You can change the colors in the configuration file.
* @param object Model_Memory &$model
echo '<table border="1" cellpadding="3" cellspacing="0" width="100%">' . RDF_LINEFEED;
echo '<p><b>Base URI:</b> ' . $model->getBaseURI () . '</p></td>' . RDF_LINEFEED;
foreach($model->triples as $statement) {
if (is_a($statement->getObject (), 'RDF_Literal')) {
if ($statement->obj ->getLanguage () != null ) {
$lang = ' <b>(xml:lang="' . $statement->obj ->getLanguage () . '") </b> ';
if ($statement->obj ->getDatatype () != null ) {
$dtype = ' <b>(rdf:datatype="' . $statement->obj ->getDatatype () . '") </b> ';
* Used by RDF_Util::writeHTMLTable()
* @param object Node $node
* @return object Resource
if (is_a($node, 'RDF_BlankNode')) {
} elseif (is_a($node, 'RDF_Literal')) {
* Used by RDF_Util::writeHTMLTable()
* @param object Node $node
* @return object Resource
if (is_a($node, 'RDF_BlankNode')) {
} elseif (is_a($node, 'RDF_Literal')) {
Documentation generated on Mon, 11 Mar 2019 15:39:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|