Download the PHP package sweetrdf/quick-rdf-io without Composer

On this page you can find all versions of the php package sweetrdf/quick-rdf-io. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package quick-rdf-io

quickRdfIo

Latest Stable Version Build status Coverage Status License

Collection of RDF parsers and serializers implementing the https://github.com/sweetrdf/rdfInterface interface.

Originally developed for the quickRdf library.

Supported formats

format read/write class implementation streaming[1]
rdf-xml rw RdfXmlParser, RdfXmlSerializer own yes
n-triples rw NQuadsParser, NQuadsSerializer own yes
n-triples* rw NQuadsParser, NQuadsSerializer own yes
n-quads rw NQuadsParser, NQuadsSerializer own yes
n-quads* rw NQuadsParser, NQuadsSerializer own yes
turtle rw TriGParser, TrigSerializer pietercolpaert/hardf yes
trig rw TriGParser, TrigSerializer pietercolpaert/hardf yes
JsonLD rw JsonLdParser, JsonLdSerializer ml/json-ld no
JsonLD[2] w JsonLdStreamSerializer own[3] yes

[1] A streaming parser/serializer doesn't materialize the whole dataset in memory which assures constant (and low) memory footprint. (this feature applies only to the parser/serializer - see the section on memory usage below)
[2] Use the jsonld-stream value for the $format parameter of the \quickRdfIo\Util::serialize() to use this serializer.
[3] Outputs data only in the extremely flattened Json-LD but works in a streaming mode.

Installation

Automatically generated documentation

https://sweetrdf.github.io/quickRdfIo/namespaces/quickrdfio.html

It's very incomplete but better than nothing.\ RdfInterface and ml/json-ld documentation is included.

Usage

Remark - there are calls to two other libraries in examples sweetrdf/quick-rdf and sweetrdf/term-templates. You may install them with composer require sweetrdf/quick-rdf and composer require sweetrdf/term-templates.

Basic parsing

Just use \quickRdfIo\Util::parse($input, $dataFactory, $format, $baseUri), where:

Basic serialization

Just use \quickRdfIo\Util::serialize($data, $format, $output, $nmsp), where:

Basic conversion

Basic filtering without a Dataset

It's worth noting that basic triples/quads filtering can be done in a memory efficient way without usage of a Dataset implementation.

Let's say we want to copy all triples with the https://vocabs.acdh.oeaw.ac.at/schema#hasIdentifier predicate from the test/files/puzzle4d_100k.nt n-triples file into a ids.ttl turtle file.

A typical approach would be to load data into a Dataset, filter them there and finally serialize the Dataset:

but it can be also done by using a "filtering generator" instead of the Dataset. With this approach we avoid materializing the whole dataset in memory which should both reduce memory footprint and speed things up a little:

Results are better but the memory footprint is still surprisingly high. This is because of the DataFactory implementation we've used and performance optimizations it's applying (which admitedly in our scenario only slow things down). We can can optimize further by using as dumb as possible DataFactory implementation (for that we need another package - sweetrdf/simple-rdf):

As we can see the optimized implementation is 2.3 times faster and has 60 times lower memory footprint that a Dataset-based one.

Notes:

Manual parser/serializer instantiation

It's of course possible to instantiate particular parser/serializer explicitly.

This is the only option to fine-tune parser/serializer configuration, e.g.:

Be aware that parsing/serialization with the manually created parser/serializer instance requires a little more code.

Compare


All versions of quick-rdf-io with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-mbstring Version *
ext-pcre Version *
ext-xmlreader Version *
zozlak/rdf-constants Version ^1.1
sweetrdf/rdf-interface Version ^2
sweetrdf/rdf-helpers Version ^2
pietercolpaert/hardf Version >=0.3.1 <1
ml/json-ld Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sweetrdf/quick-rdf-io contains the following files

Loading the files please wait ....