[ Expand All ] [ Collapse All ] - [ Properties (19) ] [ Methods (28) ] - [ Legend ]

RdfSerializer Class v. V0.9.1

Object
RdfSerializer

Class: RdfSerializer ----------------------------------------------------------------------------------

An RDF seralizer. Seralizes models to RDF syntax. It supports the xml:base, xml:lang, rdf:datatype and rdf:nodeID directive. You can choose between different output syntaxes by using the configuration methods or changing the configuration default values in constants.php. This class is based on the java class edu.unika.aifb.rdf.api.syntax.RDFSerializer by Boris Motik.

<BR><BR>History:<UL> <LI>12-14-2004 : bug in function serialize() fixed by Sören Auer( auer@informatik.uni-leipzig.de ) </LI> <LI>12-06-2004 : improved namespace handling added ( tobias.gauss@web.de )</LI> <LI>01-06-2004 : Empty model bug fixed.</LI> <LI>03-25-2004 : Bug in saveAs() fixed by inkel( inkel-php@f14web.com.ar )</LI> <LI>03-21-2004 : Support for xml default namespace added Methods changed: serialize(), writeNamespaceDeclarations(), getElementText()</LI> <LI>11-17-2003 : Support for XMLLiterals added.</LI> <LI>07-27-2003 : Functions addapted to the new class tree (MemModel extends Model)</LI> <LI>07-24-2003 : Bug in writeAbsoluteResourceReference() fixed by Paul Cowles( paul@semaview.com ) </LI> <LI>02-21-2003 : saveAs method added.</LI> <LI>02-12-2003 : rdf:type and bNode reference bug fixed.</LI> <LI>01-15-2003 : pass-by-reference bug fixed.</LI> <LI>01-10-2003 : rdf:datatype and $useAttributes bug fixed.</LI> <LI>12-04-2002 : Added support for rdf:datatype (writeContentStatements())</LI> <LI>12-04-2002 : Added rdf:nodeID attribute for blank nodes (writeSubjectURI, writeResourceReference)</LI> <LI>10-03-2002 : Bug in collectNamespaces() fixed.</LI> <LI>09-15-2002 : First version of this class.</LI> </UL>

AuthorChris Bizer <chris@bizer.de>, Boris Motik <motik@fzi.de>, Daniel Westphal <dawe@gmx.de>, Leandro Mariano Lopez
Properties implemented by RdfSerializer
public method m_attributeStatements

public method m_baseURI

public method m_contentStatements

public method m_currentSubject

public method m_defaultNamespaces

properties

public method m_groupTypeStatement

public method m_namespaces

public method m_nextAutomaticPrefixIndex

public method m_out

public method m_rdfAboutElementText

public method m_rdfIDElementText

public method m_rdfResourceElementText

public method m_statements

public method rdf_qname_prefix

public method rdf_qnames

public method sort_model

public method use_attributes

public method use_entities

configuration

public method use_xml_declaration

Methods implemented by RdfSerializer
public method addNamespacePrefix

PHPaddNamespacePrefix(string $prefix, string $namespace)

Adds a new prefix/namespace combination.

Arguments

private method canAbbreviateValue

PHPcanAbbreviateValue(unknown $node)

Arguments

private method checkForDoubleAttributes

PHPcheckForDoubleAttributes(unknown $predicate)

Arguments

private method collectNamespace

PHPcollectNamespace(unknown $resource)

Arguments

private method collectNamespaces

PHPcollectNamespaces(unknown $model)

Arguments

public method configSortModel

PHPconfigSortModel(unknown $bool)

Serializer congiguration: Sort Model Flag if the serializer should sort the model by subject before serializing. TRUE makes the RDF code more compact. TRUE is default. Default can be changed in constants.php.

Arguments

public method configUseAttributes

PHPconfigUseAttributes(unknown $bool)

Serializer congiguration: Use Attributes Flag if the serializer should serialize triples as XML attributes where possible. TRUE makes the RDF code more compact. FALSE is default. Default can be changed in constants.php.

Arguments

public method configUseEntities

PHPconfigUseEntities(unknown $bool)

Serializer congiguration: Use Entities Flag if the serializer should use entities for URIs. TRUE makes the RDF code more compact. FALSE is default. Default can be changed in constants.php.

Arguments

public method configUseQnames

PHPconfigUseQnames(unknown $bool)

Serializer congiguration: Use Qnames Flag if the serializer should use qualified names for RDF reserved words. TRUE makes the RDF code more compact. TRUE is default. Default can be changed in constants.php.

Arguments

public method configUseXmlDeclaration

PHPconfigUseXmlDeclaration(unknown $bool)

Serializer congiguration: Use XML Declaration Flag if the serializer should start documents with the xml declaration <?xml version="1.0" encoding="UTF-8" ?>. TRUE is default. Default can be changed in constants.php.

Arguments

private method getElementText

PHPgetElementText(string $elementName)

Arguments

private method getNextNamespacePrefix

PHPgetNextNamespacePrefix()

private method getValueQuoteType

PHPgetValueQuoteType(string $textValue)

Arguments

constructor RdfSerializer

PHPRdfSerializer()

Constructor

private method relativizeURI

PHPrelativizeURI(string $uri)

Arguments

public method saveAs

PHPboolean saveAs(unknown $model, unknown $filename, string $encoding)

Serializes a model and saves it into a file. Returns FALSE if the model couldn't be saved to the file.

Arguments

public method serialize

PHPstring serialize(unknown $model, unknown $xml_default_namespace, string $encoding)

Serializes a model to RDF syntax. RDF syntax can be changed by config_use_attributes($boolean), config_use_entities($boolean), config_sort_model($boolean). NOTE: There is only one default namespace allowed within an XML document. Therefore if SER_RDF_QNAMES in constants.php is set to FALSE and you pass another $xml_default_namespace as parameter, the model will be serialized as if SER_RDF_QNAMES were set to TRUE.

Arguments

private method writeAbsoluteResourceReference

PHPwriteAbsoluteResourceReference(string $rebaseURI)

Arguments

private method writeAttributeStatements

PHPwriteAttributeStatements()

private method writeContentStatements

PHPwriteContentStatements()

private method writeDescriptions

PHPwriteDescriptions()

private method writeEntityDeclarations

PHPwriteEntityDeclarations()

private method writeEscapedCDATA

PHPwriteEscapedCDATA(string $textValue)

Arguments

private method writeGroup

PHPwriteGroup()

private method writeNamespaceDeclarations

PHPwriteNamespaceDeclarations()

private method writeResourceReference

PHPwriteResourceReference(object $object_node)

Arguments

private method writeSubjectURI

PHPwriteSubjectURI(unknown $subject_node)

Arguments

private method writeTextValue

PHPwriteTextValue(string $textValue)

Arguments

Generated by PHPEdit - Copyright © 1999-2004 - Sébastien Hordeaux - WaterProof SARL