Purtle
Fast streaming RDF serializer for PHP
Loading...
Searching...
No Matches
Wikimedia\Purtle\RdfWriterFactory Class Reference

Public Member Functions

 getSupportedFormats ()
 Returns a list of canonical format names.
 
 getMimeTypes ( $format)
 Returns a list of mime types that correspond to the format.
 
 getFileExtension ( $format)
 Returns a file extension that correspond to the format.
 
 getWriter ( $format, BNodeLabeler $labeler=null)
 Returns an RdfWriter for the given format name.
 
 getFormatName ( $format)
 Returns the canonical format name for $format.
 

Detailed Description

Since
0.5

@license GPL-2.0-or-later

Author
Daniel Kinzler

Member Function Documentation

◆ getFileExtension()

Wikimedia\Purtle\RdfWriterFactory::getFileExtension ( $format)

Returns a file extension that correspond to the format.

Parameters
string$formata format name, as returned by getSupportedFormats() or getFormatName().
Exceptions
InvalidArgumentExceptionif $format is not a cononical format name
Returns
string

◆ getFormatName()

Wikimedia\Purtle\RdfWriterFactory::getFormatName ( $format)

Returns the canonical format name for $format.

$format may be a file extension, a mime type, or a common or canonical name of the format.

If no format is found for $format, this method returns false.

Parameters
string$formatthe name (file extension, mime type) of the desired format.
Returns
string|false the canonical format name

◆ getMimeTypes()

Wikimedia\Purtle\RdfWriterFactory::getMimeTypes ( $format)

Returns a list of mime types that correspond to the format.

Parameters
string$formata format name, as returned by getSupportedFormats() or getFormatName().
Exceptions
InvalidArgumentExceptionif $format is not a cononical format name
Returns
string[]

◆ getSupportedFormats()

Wikimedia\Purtle\RdfWriterFactory::getSupportedFormats ( )

Returns a list of canonical format names.

These names for internal use with getMimeTypes() and getFileExtension(), they are not themselves MIME types or file extensions.

Returns
string[]

◆ getWriter()

Wikimedia\Purtle\RdfWriterFactory::getWriter ( $format,
BNodeLabeler $labeler = null )

Returns an RdfWriter for the given format name.

Parameters
string$formata format name, as returned by getSupportedFormats() or getFormatName().
BNodeLabeler | null$labelerOptional labeler
Exceptions
InvalidArgumentExceptionif $format is not a canonical format name
Returns
RdfWriter the format object, or null if not found.

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