Flysystem plugin to transform RDF data between various serialization formats.
When using RDF, you will seen notice there are several different popular serialization formats. Instead of having to store data in multiple formats, it is easier to store the data in one format and convert it to others as needed.
This project contains a plugin to be used with Flysystem to do just that.
For the conversion EasyRDF is used. Any formats supported by EasyRDF are available from this plugin.
Currently supported formats are:
- Notation 3 / N3
This project is part of the PHP stack of projects by PDS Interop. It is used by both the Solid-Nextcloud app and the standalone PHP Solid server.
As the functionality seemed useful for other projects, it was implemented as a separate package.
The advised install method is through composer:
composer require pdsinterop/flysystem-rdf
PHP version 7.1 and higher is supported. The
mbstring extension needs to be enabled in order for this package to work.
To use this package, instantiate the plugin and add it to a Flysystem filesystem.
readRdf can then be called to get RDF files in a specific format:
<?php declare(strict_types=1); $adapter = new League\Flysystem\Adapter\Local('/path/to/files/'); $filesystem = new League\Flysystem\Filesystem($adapter); $graph = new \EasyRdf_Graph(); $plugin = new \Pdsinterop\Rdf\Flysystem\Plugin\ReadRdf($graph); $filesystem->addPlugin($plugin); $content = $filesystem->readRdf('/foaf.rdf', \Pdsinterop\Rdf\Enum\Format::TURTLE);
Questions or feedback can be given by opening an issue on GitHub.
All PDS Interop projects are open source and community-friendly. Any contribution is welcome! For more details read the contribution guidelines.
There is a list of all contributors on GitHub.
For a list of changes see the CHANGELOG or the GitHub releases page.
All code created by PDS Interop is licensed under the MIT License.