SMWTurtleSerializer Class Reference
[Semantic MediaWiki]

Class for serializing exported data (encoded as SMWExpData object) in Turtle syntax. More...

Inherits SMWSerializer.

List of all members.

Public Member Functions

 __construct ($sparqlMode=false)
 clear ()
 Clear internal states to start a new serialization.
 flushSparqlPrefixes ()
 Get an array of namespace prefixes used in SPARQL mode.
 serializeDeclaration ($uri, $typename)
 Serialize a single declaration for the given $uri (expanded) and type (given as a QName).
 serializeExpData (SMWExpData $data)
 Serialise the given SMWExpData object.

Static Public Member Functions

static getTurtleNameForExpElement (SMWExpElement $expElement)
 Get the Turtle serialization string for the given SMWExpElement.

Protected Member Functions

 serializeHeader ()
 Serialize the header (i.e.
 serializeFooter ()
 Serialise the footer (i.e.
 serializeNamespace ($shortname, $uri)
 Serialize a single namespace.
 serializeNestedExpData (SMWExpData $data, $indent)
 Serialize the given SMWExpData object, possibly recursively with increased indentation.
 serializeExpLiteral (SMWExpLiteral $element)
 serializeExpResource (SMWExpResource $element)

Protected Attributes

 $subexpdata
 $sparqlmode
 $sparql_namespaces


Detailed Description

Class for serializing exported data (encoded as SMWExpData object) in Turtle syntax.

Definition at line 19 of file SMW_Serializer_Turtle.php.


Constructor & Destructor Documentation

SMWTurtleSerializer::__construct ( sparqlMode = false  ) 

Definition at line 44 of file SMW_Serializer_Turtle.php.


Member Function Documentation

SMWTurtleSerializer::clear (  ) 

Clear internal states to start a new serialization.

Reimplemented from SMWSerializer.

Definition at line 49 of file SMW_Serializer_Turtle.php.

SMWTurtleSerializer::flushSparqlPrefixes (  ) 

Get an array of namespace prefixes used in SPARQL mode.

Namespaces are not serialized among triples in SPARQL mode but are collected separately. This method returns the prefixes and empties the collected list afterwards.

Returns:
array shortName => namespace URI

Definition at line 62 of file SMW_Serializer_Turtle.php.

SMWTurtleSerializer::serializeHeader (  )  [protected]

Serialize the header (i.e.

write it to the internal buffer). May include standard syntax to start output but also declare some common namespaces globally.

Reimplemented from SMWSerializer.

Definition at line 68 of file SMW_Serializer_Turtle.php.

References SMWExporter::expandURI().

SMWTurtleSerializer::serializeFooter (  )  [protected]

Serialise the footer (i.e.

write it to the internal buffer).

Reimplemented from SMWSerializer.

Definition at line 98 of file SMW_Serializer_Turtle.php.

SMWTurtleSerializer::serializeDeclaration ( uri,
typename 
)

Serialize a single declaration for the given $uri (expanded) and type (given as a QName).

Parameters:
$uri string URI of the thing to declare
$typename string one of owl:Class, owl:ObjectProperty, and owl:datatypeProperty

Reimplemented from SMWSerializer.

Definition at line 104 of file SMW_Serializer_Turtle.php.

References SMWExporter::expandURI().

SMWTurtleSerializer::serializeExpData ( SMWExpData data  ) 

Serialise the given SMWExpData object.

The method must not assume that the exported data refers to wiki pages or other SMW data, and it must ensure that all required auxiliary declarations for obtaining proper OWL are included in any case (this can be done using requireDeclaration()).

Parameters:
$data SMWExpData containing the data to be serialised.

Reimplemented from SMWSerializer.

Definition at line 108 of file SMW_Serializer_Turtle.php.

References SMWSerializer::serializeNamespaces(), and serializeNestedExpData().

SMWTurtleSerializer::serializeNamespace ( shortname,
uri 
) [protected]

Serialize a single namespace.

Namespaces that were serialized in such a way that they remain available for all following output should be added to $global_namespaces.

Parameters:
$shortname string abbreviation/prefix to declare
$uri string URI prefix that the namespace encodes

Reimplemented from SMWSerializer.

Definition at line 116 of file SMW_Serializer_Turtle.php.

SMWTurtleSerializer::serializeNestedExpData ( SMWExpData data,
indent 
) [protected]

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

Parameters:
$data SMWExpData containing the data to be serialised.
$indent string specifying a prefix for indentation (usually a sequence of tabs)

Definition at line 132 of file SMW_Serializer_Turtle.php.

References SMWSerializer::isOWLClassTypeProperty(), SMWSerializer::recordDeclarationTypes(), SMWSerializer::requireDeclaration(), serializeExpLiteral(), and serializeExpResource().

Referenced by serializeExpData().

SMWTurtleSerializer::serializeExpLiteral ( SMWExpLiteral element  )  [protected]

Definition at line 205 of file SMW_Serializer_Turtle.php.

Referenced by serializeNestedExpData().

SMWTurtleSerializer::serializeExpResource ( SMWExpResource element  )  [protected]

Definition at line 209 of file SMW_Serializer_Turtle.php.

References SMWSerializer::requireNamespace().

Referenced by serializeNestedExpData().

static SMWTurtleSerializer::getTurtleNameForExpElement ( SMWExpElement expElement  )  [static]


Member Data Documentation

SMWTurtleSerializer::$subexpdata [protected]

Definition at line 29 of file SMW_Serializer_Turtle.php.

SMWTurtleSerializer::$sparqlmode [protected]

Definition at line 36 of file SMW_Serializer_Turtle.php.

SMWTurtleSerializer::$sparql_namespaces [protected]

Definition at line 42 of file SMW_Serializer_Turtle.php.


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

Generated on Sun Mar 18 07:15:45 2012 for Semantic MediaWiki by  doxygen 1.5.6