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

Public Member Functions

 clear ()
 
 serializeDeclaration ( $uri, $typename)
 
 serializeExpData (SMWExpData $expData)
 
 flushContent ()
 
- Public Member Functions inherited from SMWSerializer
 __construct ()
 
 clear ()
 
 startSerialization ()
 
 finishSerialization ()
 
 serializeDeclarations ()
 
 serializeDeclaration ( $uri, $typename)
 
 serializeExpData (SMWExpData $data)
 
 flushContent ()
 

Protected Member Functions

 serializeHeader ()
 
 serializeFooter ()
 
 serializeNamespace ( $shortname, $uri)
 
 serializeNestedExpData (SMWExpData $expData, $indent)
 
 serializeExpLiteral (SMWExpNsResource $expResourceProperty, SMWExpLiteral $expLiteral, $indent)
 
 serializeExpResource (SMWExpNsResource $expResourceProperty, SMWExpResource $expResource, $indent, $isClassTypeProp)
 
 serializeExpCollection (SMWExpNsResource $expResourceProperty, array $collection, $indent, $isClassTypeProp)
 
 makeValueEntityString ( $string)
 
 makeAttributeValueString ( $string)
 
- Protected Member Functions inherited from SMWSerializer
 serializeHeader ()
 
 serializeFooter ()
 
 serializeNamespaces ()
 
 serializeNamespace ( $shortname, $uri)
 
 requireNamespace ( $nsshort, $nsuri)
 
 requireDeclaration (SMWExpResource $resource, $decltype)
 
 recordDeclarationTypes (SMWExpData $expData)
 
 declarationDone (SMWExpResource $element, $typeflag)
 
 isOWLClassTypeProperty (SMWExpNsResource $property)
 

Protected Attributes

 $namespace_block_started
 
 $namespaces_are_global
 
- Protected Attributes inherited from SMWSerializer
 $pre_ns_buffer
 
 $post_ns_buffer
 
 $decl_todo
 
 $decl_done
 
 $extra_namespaces
 
 $global_namespaces
 

Detailed Description

File holding the SMWRDFXMLSerializer class that provides basic functions for serialising OWL data in RDF/XML syntax.

Author
Markus Krötzsch Class for serializing exported data (encoded as SMWExpData object) in RDF/XML.

Member Function Documentation

◆ makeAttributeValueString()

SMWRDFXMLSerializer::makeAttributeValueString (   $string)
protected

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

Parameters
$stringstring to be escaped
Returns
string

◆ makeValueEntityString()

SMWRDFXMLSerializer::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

◆ serializeExpCollection()

SMWRDFXMLSerializer::serializeExpCollection ( SMWExpNsResource  $expResourceProperty,
array  $collection,
  $indent,
  $isClassTypeProp 
)
protected

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

Parameters
$expResourcePropertySMWExpNsResource the property to use
$expResourcearray of (SMWExpResource or SMWExpData)
$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.

◆ serializeExpLiteral()

SMWRDFXMLSerializer::serializeExpLiteral ( SMWExpNsResource  $expResourceProperty,
SMWExpLiteral  $expLiteral,
  $indent 
)
protected

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

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

◆ serializeExpResource()

SMWRDFXMLSerializer::serializeExpResource ( SMWExpNsResource  $expResourceProperty,
SMWExpResource  $expResource,
  $indent,
  $isClassTypeProp 
)
protected

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

Parameters
$expResourcePropertySMWExpNsResource the property to use
$expResourceSMWExpResource 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

◆ serializeNestedExpData()

SMWRDFXMLSerializer::serializeNestedExpData ( SMWExpData  $expData,
  $indent 
)
protected

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

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

Member Data Documentation

◆ $namespace_block_started

SMWRDFXMLSerializer::$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

SMWRDFXMLSerializer::$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