Turtle
class Turtle extends Serialiser
Class to serialise an EasyRdf\Graph to Turtle with no external dependencies.
http://www.w3.org/TR/turtle/
Properties
protected | $prefixes | from Serialiser |
Methods
Check and cleanup parameters passed to serialise() method
Protected method to get the number of reverse properties for a resource If a resource only has a single property, the number of values for that property is returned instead.
Given a IRI string, escape and enclose in angle brackets.
Given a string, enclose in quotes and escape any quotes in the string.
Given a an EasyRdf\Resource or URI, convert it into a string, suitable to be written to a Turtle document. URIs will be shortened into CURIES where possible.
Given an EasyRdf\Literal object, convert it into a string, suitable to be written to a Turtle document. Supports multiline literals and literals with datatypes or languages.
Convert an EasyRdf object into a string suitable to be written to a Turtle document.
Protected method to serialise a RDF collection
Protected method to serialise the properties of a resource
No description
Details
in
Serialiser at line 54
protected
addPrefix($qname)
Keep track of the prefixes used while serialising
in
Serialiser at line 64
protected
checkSerialiseParams($format)
Check and cleanup parameters passed to serialise() method
in
Serialiser at line 85
protected
reversePropertyCount($resource)
Protected method to get the number of reverse properties for a resource If a resource only has a single property, the number of values for that property is returned instead.
at line 366
string
serialise(Graph $graph, Format|string $format, array $options = array())
Serialise an EasyRdf\Graph to Turtle.
at line 67
static string
escapeIri(string $resourceIri)
Given a IRI string, escape and enclose in angle brackets.
at line 82
static string
quotedString(string $value)
Given a string, enclose in quotes and escape any quotes in the string.
Strings containing tabs, linefeeds or carriage returns will be enclosed in three double quotes (""").
at line 113
string
serialiseResource(resource|string $resource, bool $createNamespace = false)
Given a an EasyRdf\Resource or URI, convert it into a string, suitable to be written to a Turtle document. URIs will be shortened into CURIES where possible.
at line 142
string
serialiseLiteral(Literal $literal)
Given an EasyRdf\Literal object, convert it into a string, suitable to be written to a Turtle document. Supports multiline literals and literals with datatypes or languages.
at line 176
string
serialiseObject(resource|Literal $object)
Convert an EasyRdf object into a string suitable to be written to a Turtle document.
at line 195
protected
serialiseCollection($node, $indent)
Protected method to serialise a RDF collection
at line 231
protected
serialiseProperties($res, $depth = 1)
Protected method to serialise the properties of a resource