{"id":36629041,"url":"https://github.com/pdsinterop/flysystem-rdf","last_synced_at":"2026-01-12T09:35:21.118Z","repository":{"id":40327264,"uuid":"280873903","full_name":"pdsinterop/flysystem-rdf","owner":"pdsinterop","description":"FlySystem plugin to transform RDF data between various serialization formats.","archived":false,"fork":false,"pushed_at":"2025-05-16T08:58:05.000Z","size":147,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-15T18:11:40.133Z","etag":null,"topics":["easyrdf","flysystem","flysystem-plugin","pdsinterop","php","php-library","php7","rdf"],"latest_commit_sha":null,"homepage":"https://pdsinterop.org/flysystem-rdf/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pdsinterop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-19T13:43:08.000Z","updated_at":"2025-05-16T08:57:16.000Z","dependencies_parsed_at":"2025-03-12T19:27:14.232Z","dependency_job_id":"05476cd0-c993-4138-b07d-2bf482a491ba","html_url":"https://github.com/pdsinterop/flysystem-rdf","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/pdsinterop/flysystem-rdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fflysystem-rdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fflysystem-rdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fflysystem-rdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fflysystem-rdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdsinterop","download_url":"https://codeload.github.com/pdsinterop/flysystem-rdf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fflysystem-rdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["easyrdf","flysystem","flysystem-plugin","pdsinterop","php","php-library","php7","rdf"],"created_at":"2026-01-12T09:35:21.058Z","updated_at":"2026-01-12T09:35:21.110Z","avatar_url":"https://github.com/pdsinterop.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flysystem RDF Converter Plugin\n\n[![Project stage: Development][project-stage-badge: Development]][project-stage-page]\n[![License][license-shield]][license-link]\n[![Latest Version][version-shield]][version-link]\n![Maintained][maintained-shield]\n\n[![PDS Interop][pdsinterop-shield]][pdsinterop-site]\n[![standard-readme compliant][standard-readme-shield]][standard-readme-link]\n[![keep-a-changelog compliant][keep-a-changelog-shield]][keep-a-changelog-link]\n\n_Flysystem plugin to transform RDF data between various serialization formats._\n\nWhen using RDF, you will notice there are several different popular \nserialization formats. Instead of having to store data in multiple formats, it\nis easier to store the data in one format and convert it to others as needed.\n\nThis project contains a plugin to be used with Flysystem to do just that.\n\nFor the conversion EasyRDF is used. Any formats supported by EasyRDF are \navailable from this plugin. \n\nCurrently supported formats are:\n\n- JSON-LD\n- N-triples\n- Notation 3 / N3\n- RDF/XML\n- Turtle\n\n## Table of Contents\n\n\u003c!-- toc --\u003e\n\n- [Background](#background)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Adapter](#adapter)\n    - [Plugin](#plugin)\n- [Contribute](#contribute)\n- [License](#license)\n\n\u003c!-- tocstop --\u003e\n\n## Background\n\nThis project is part of the PHP stack of projects by PDS Interop. It is used by\nboth the Solid-Nextcloud app and the standalone PHP Solid server.\n\nAs the functionality seemed useful for other projects, it was implemented as a\nseparate package.\n\n## Installation\n\nThe advised install method is through composer:\n\n```sh\ncomposer require pdsinterop/flysystem-rdf\n```\n\nPHP version 7.3 and higher is supported. The [`mbstring`](https://www.php.net/manual/en/book.mbstring.php)\nextension needs to be enabled in order for this package to work.\n\n## Usage\n\nThis package offers features to read files from a Filesystem that have been\nstored in one RDF format as another format.\n\nThese features are provided by a plugin and an adapter.\n\nThe plugin is best suited for light-weight scenarios where all you want to do is\nconvert a file to another format.\n\nThe adapter is best suited for full-featured usage of Flysystem, as it also \nhandles calls to `has` and `getMimeType` correctly (which the plugin does not) \n\n### Adapter\n\nTo use the adapter, instantiate it, add it to a Flysystem filesystem and add the\nhelper plugin.\n\n```php\n\u003c?php\n\n// Create Formats objects\n$formats = new \\Pdsinterop\\Rdf\\Formats();\n\n// Use an adapter of your choice\n$adapter = new League\\Flysystem\\Adapter\\Local('/path/to/files/');\n\n// Create the RDF Adapter\n$rdfAdapter = new \\Pdsinterop\\Rdf\\Flysystem\\Adapter\\Rdf(\n    $adapter,\n    new \\EasyRdf\\Graph(),\n    $formats,\n    'server'\n);\n\n// Create Flysystem as usual, adding the RDF Adapter\n$filesystem = new League\\Flysystem\\Filesystem($rdfAdapter);\n\n// Add the `AsMime` plugin to convert contents based on a provided MIME type, \n$filesystem-\u003eaddPlugin(new \\Pdsinterop\\Rdf\\Flysystem\\Plugin\\AsMime($formats));\n\n// Read the contents of a file in the format it was stored in\n$content = $filesystem-\u003eread('/foaf.rdf');\n\n// Read the contents of a file in another format from what was stored in\n$convertedContents = $filesystem\n    -\u003easMime('text/turtle')\n    -\u003eread('/foaf.rdf');\n\n// Get the MIME type of the format the requested mime-type would return\n// This is especially useful for RDF formats that can be requested with several\n// different MIME types.\n$convertedMimeType = $filesystem\n    -\u003easMime('text/turtle')\n    -\u003egetMimetype('/foaf.rdf');\n\n// This also works for `has`\n$hasConvertedContents = $filesystem\n    -\u003easMime('text/turtle')\n    -\u003ehas('/foaf.ttl');\n\n// Without using the plugin, this will be false\n$hasContents = $filesystem-\u003ehas('/foaf.ttl');\n\n```\n\nThe adapter adds any found `.meta` files that reference a file to that file's\nmetadata, which can be retrieved with `$filesystem-\u003egetMetadata($path)`.\n\n### Plugin\n\nTo use the plugin, instantiate it and add it to a Flysystem filesystem.\n\nThe function `readRdf` can then be called to get RDF files in a specific format:\n\n```php\n\u003c?php\n\n// Create Flysystem as usual, adding an adapter of your choice\n$adapter = new League\\Flysystem\\Adapter\\Local('/path/to/files/');\n$filesystem = new League\\Flysystem\\Filesystem($adapter);\n\n// create and add the RdF Plugin\n$plugin = new \\Pdsinterop\\Rdf\\Flysystem\\Plugin\\ReadRdf(new \\EasyRdf\\Graph());\n$filesystem-\u003eaddPlugin($plugin);\n\n// Read the contents of a RDF file in another format from what was stored in\n$content = $filesystem-\u003ereadRdf('/foaf.rdf', \\Pdsinterop\\Rdf\\Enum\\Format::TURTLE);\n\n```\n\n## Develop\n\n- Do not forget to install the required dependencies using `composer`.\n\n- Most of the logic here involves EasyRdf and/or FlySystem. You'll want to familiarise yourself with their workings.\n\n- Test are available in the `tests/` directory. They are run by GitHub actions for any pull request. To run them,call `./bin/phpunit`\n\n- The changelog can be automatically generated using [`github_changelog_generator`](https://github.com/github-changelog-generator/github-changelog-generator) with the [provided configuration file](.github_changelog_generator)\n\n## Contributing\n\nQuestions or feedback can be given by [opening an issue on GitHub][issues-link].\n\nAll PDS Interop projects are open source and community-friendly.\nAny contribution is welcome!\nFor more details read the [contribution guidelines][contributing-link].\n\nAll PDS Interop projects adhere to [the Code Manifesto](http://codemanifesto.com)\nas its [code-of-conduct][code-of-conduct]. Contributors are expected to abide by its terms.\n\nThere is [a list of all contributors on GitHub][contributors-page].\n\nFor a list of changes see the [CHANGELOG][changelog] or [the GitHub releases page][releases-page].\n\n## License\n\nAll code created by PDS Interop is licensed under the [MIT License][license-link].\n\n[changelog]: CHANGELOG.md\n[code-of-conduct]: CODE_OF_CONDUCT.md\n[contributing-link]: CONTRIBUTING.md\n[contributors-page]: https://github.com/pdsinterop/flysystem-rdf/contributors\n[issues-link]: https://github.com/pdsinterop/flysystem-rdf/issues\n[releases-page]: https://github.com/pdsinterop/flysystem-rdf/releases\n[keep-a-changelog-link]: https://keepachangelog.com/\n[keep-a-changelog-shield]: https://img.shields.io/badge/Keep%20a%20Changelog-f15d30.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9IiNmZmYiIHZpZXdCb3g9IjAgMCAxODcgMTg1Ij48cGF0aCBkPSJNNjIgN2MtMTUgMy0yOCAxMC0zNyAyMmExMjIgMTIyIDAgMDAtMTggOTEgNzQgNzQgMCAwMDE2IDM4YzYgOSAxNCAxNSAyNCAxOGE4OSA4OSAwIDAwMjQgNCA0NSA0NSAwIDAwNiAwbDMtMSAxMy0xYTE1OCAxNTggMCAwMDU1LTE3IDYzIDYzIDAgMDAzNS01MiAzNCAzNCAwIDAwLTEtNWMtMy0xOC05LTMzLTE5LTQ3LTEyLTE3LTI0LTI4LTM4LTM3QTg1IDg1IDAgMDA2MiA3em0zMCA4YzIwIDQgMzggMTQgNTMgMzE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3MtMiAzMS0xNiA0MGMtMTEgOC0yMSAxMS0zMiAxMXptMS0zNHYxNGgtOFY2OGg4djI4bDEwLTEwaDExbC0xNCAxNSAxNyAxOEg5NnoiLz48L3N2Zz4K\n[license-link]: ./LICENSE\n[license-shield]: https://img.shields.io/github/license/pdsinterop/flysystem-rdf.svg\n[maintained-shield]: https://img.shields.io/maintenance/yes/2022.svg\n[pdsinterop-shield]: https://img.shields.io/badge/-PDS%20Interop-7C4DFF.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii01IC01IDExMCAxMTAiIGZpbGw9IiNGRkYiIHN0cm9rZS13aWR0aD0iMCI+CiAgICA8cGF0aCBkPSJNLTEgNTJoMTdhMzcuNSAzNC41IDAgMDAyNS41IDMxLjE1di0xMy43NWEyMC43NSAyMSAwIDAxOC41LTQwLjI1IDIwLjc1IDIxIDAgMDE4LjUgNDAuMjV2MTMuNzVhMzcgMzQuNSAwIDAwMjUuNS0zMS4xNWgxN2EyMiAyMS4xNSAwIDAxLTEwMiAweiIvPgogICAgPHBhdGggZD0iTSAxMDEgNDhhMi43NyAyLjY3IDAgMDAtMTAyIDBoIDE3YTIuOTcgMi44IDAgMDE2OCAweiIvPgo8L3N2Zz4K\n[pdsinterop-site]: https://pdsinterop.org/\n[project-stage-badge: Development]: https://img.shields.io/badge/Project%20Stage-Development-yellowgreen.svg\n[project-stage-page]: https://blog.pother.ca/project-stages/\n[standard-readme-link]: https://github.com/RichardLitt/standard-readme\n[standard-readme-shield]: https://img.shields.io/badge/-Standard%20Readme-brightgreen.svg\n[version-link]: https://packagist.org/packages/pdsinterop/flysystem-rdf\n[version-shield]: https://img.shields.io/github/v/release/pdsinterop/flysystem-rdf?sort=semver\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdsinterop%2Fflysystem-rdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdsinterop%2Fflysystem-rdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdsinterop%2Fflysystem-rdf/lists"}