Semantic MediaWiki and related extensions
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SMW\Exporter\Serializer\RDFXMLSerializer Class Reference
Inheritance diagram for SMW\Exporter\Serializer\RDFXMLSerializer:
Inheritance graph
[legend]
Collaboration diagram for SMW\Exporter\Serializer\RDFXMLSerializer:
Collaboration graph
[legend]

Public Member Functions

 clear ()
 
 serializeDeclaration ( $uri, $typename)
 
 serializeExpData (ExpData $expData)
 
 flushContent ()
 
- Public Member Functions inherited from SMW\Exporter\Serializer\Serializer
 __construct ()
 
 clear ()
 
 startSerialization ()
 
 finishSerialization ()
 
 serializeDeclarations ()
 
 serializeDeclaration ( $uri, $typename)
 
 serializeExpData (ExpData $data)
 
 flushContent ()
 

Protected Member Functions

 serializeHeader ()
 
 serializeFooter ()
 
 serializeNamespace ( $shortname, $uri)
 
 serializeNestedExpData (ExpData $expData, $indent)
 
 serializeExpLiteral (ExpNsResource $expResourceProperty, ExpLiteral $expLiteral, $indent)
 
 serializeExpResource (ExpNsResource $expResourceProperty, ExpResource $expResource, $indent, $isClassTypeProp)
 
 serializeExpCollection (ExpNsResource $expResourceProperty, array $collection, $indent, $isClassTypeProp)
 
 makeValueEntityString ( $string)
 
 makeAttributeValueString ( $string)
 
- Protected Member Functions inherited from SMW\Exporter\Serializer\Serializer
 serializeHeader ()
 
 serializeFooter ()
 
 serializeNamespaces ()
 
 serializeNamespace ( $shortname, $uri)
 
 requireNamespace ( $nsshort, $nsuri)
 
 requireDeclaration (ExpResource $resource, $decltype)
 
 recordDeclarationTypes (ExpData $expData)
 
 declarationDone (ExpResource $element, int $typeflag)
 
 isOWLClassTypeProperty (ExpNsResource $property)
 

Protected Attributes

 $namespace_block_started
 
 $namespaces_are_global
 
- Protected Attributes inherited from SMW\Exporter\Serializer\Serializer
 $pre_ns_buffer
 
 $post_ns_buffer
 
 $decl_todo
 
 $decl_done
 
 $extra_namespaces
 
 $global_namespaces
 

Detailed Description

Class for serializing exported data (encoded as ExpData object) in RDF/XML.

GNU GPL v2+

Since
1.5.5
Author
Markus Krötzsch

Member Function Documentation

◆ clear()

SMW\Exporter\Serializer\RDFXMLSerializer::clear ( )

◆ flushContent()

SMW\Exporter\Serializer\RDFXMLSerializer::flushContent ( )

◆ makeAttributeValueString()

SMW\Exporter\Serializer\RDFXMLSerializer::makeAttributeValueString (   $string)
protected

Escape a string as required for using it in XML attribute values.

Parameters
$stringstring to be escaped
Returns
string

◆ makeValueEntityString()

SMW\Exporter\Serializer\RDFXMLSerializer::makeValueEntityString (   $string)
protected

Escape a string in the special form that is required for values in DTD entity declarations in XML. Namely, this require the percent sign to be replaced.

Parameters
$stringstring to be escaped
Returns
string

◆ serializeDeclaration()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeDeclaration (   $uri,
  $typename 
)

◆ serializeExpCollection()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeExpCollection ( ExpNsResource  $expResourceProperty,
array  $collection,
  $indent,
  $isClassTypeProp 
)
protected

Add a serialization of the given ExpResource to the output, assuming that an opening property tag is alerady there.

Parameters
$expResourcePropertyExpNsResource the property to use
$expResourcearray of (ExpResource or ExpData)
$indentstring specifying a prefix for indentation (usually a sequence of tabs)
$isClassTypePropboolean whether the resource must be declared as a class
Bug:

The $isClassTypeProp parameter is not properly taken into account.

Individual resources are not serialised properly.

◆ serializeExpData()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeExpData ( ExpData  $expData)

◆ serializeExpLiteral()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeExpLiteral ( ExpNsResource  $expResourceProperty,
ExpLiteral  $expLiteral,
  $indent 
)
protected

Add to the output a serialization of a property assignment where an ExpLiteral is the object. It is assumed that a suitable subject block has already been openend.

Parameters
$expResourcePropertyExpNsResource the property to use
$expLiteralExpLiteral the data value to use
$indentstring specifying a prefix for indentation (usually a sequence of tabs)

◆ serializeExpResource()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeExpResource ( ExpNsResource  $expResourceProperty,
ExpResource  $expResource,
  $indent,
  $isClassTypeProp 
)
protected

Add to the output a serialization of a property assignment where an ExpResource is the object. It is assumed that a suitable subject block has already been openend.

Parameters
$expResourcePropertyExpNsResource the property to use
$expResourceExpResource the data value to use
$indentstring specifying a prefix for indentation (usually a sequence of tabs)
$isClassTypePropboolean whether the resource must be declared as a class

◆ serializeFooter()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeFooter ( )
protected

◆ serializeHeader()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeHeader ( )
protected

◆ serializeNamespace()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeNamespace (   $shortname,
  $uri 
)
protected

◆ serializeNestedExpData()

SMW\Exporter\Serializer\RDFXMLSerializer::serializeNestedExpData ( ExpData  $expData,
  $indent 
)
protected

Serialize the given ExpData object, possibly recursively with increased indentation.

Parameters
$expDataExpData containing the data to be serialised.
$indentstring specifying a prefix for indentation (usually a sequence of tabs)

Member Data Documentation

◆ $namespace_block_started

SMW\Exporter\Serializer\RDFXMLSerializer::$namespace_block_started
protected

True if the $pre_ns_buffer contains the beginning of a namespace declaration block to which further declarations for the current context can be appended.

◆ $namespaces_are_global

SMW\Exporter\Serializer\RDFXMLSerializer::$namespaces_are_global
protected

True if the namespaces that are added at the current serialization stage become global, i.e. remain available for all later contexts. This is the case in RDF/XML only as long as the header has not been streamed to the client (reflected herein by calling flushContent()). Later, namespaces can only be added locally to individual elements, thus requiring them to be re-added multiple times if used in many elements.


The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy