Download the PHP package effectiveactivism/sparql-client without Composer

On this page you can find all versions of the php package effectiveactivism/sparql-client. 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 sparql-client

SparQl client

An OOP SparQl 1.1 client for Symfony with support for SELECT, CONSTRUCT, DELETE, INSERT and DELETE+INSERT operations. Includes term, namespace and (basic) statement validation.

Table of content

Installation

To install, run

Configuration

This bundle requires a SparQl endpoint string. You can optionally define namespaces that should be included in every request. You can also optionally define a SHACL endpoint.

Usage

Select statement

Retrieve any subjects that have a schema:headline of "Lorem"@la.

Limit, offset and order

Select statements can use result modifiers:

Ask statement

Query whether a set of clauses has a solution:

Construct statement

Construct a set of triples:

Insert statement

Insert the following triple:

Delete statement

Delete all triples where the subject has the headline "lorem"@la but only if the subject has type schema:Article.

Replace statement

Also known as DELETE+INSERT statements.

Replace all triples where a subject has a schema:headline of "lorem"@la with a schema:headline of "ipsum"@la.

Property paths and sets

To use path operators such as inverse path (^), use the EffectiveActivism\SparQlClient\Syntax\Term\Path classes.

Inverse path example

Sequence path example

Negated set example

Assignment

Two assignment options are available: BIND and VALUES.

BIND example

VALUES example

To use UNDEF in a VALUES expression, use null. Value arrays must have the same dimension as the variables array.

The above example will produce the following statement

Validation

This bundle supports validation of terms. For example, the below assignment will throw an InvalidArgumentException because the prefix contains illegal characters.

Namespaces are validated, both when defined in configuration (via sparql_client.yml) or added dynamically in code.

Rudimentary validation of statements is also supported. For example, the below statement will throw an InvalidArgumentException because the 'where' clause does not contain any of the requested variables.

Optional clauses

To add an optional clause, use the EffectiveActivism\SparQlClient\Syntax\Optionally\Optionally class.

Service

To use a service, use the EffectiveActivism\SparQlClient\Syntax\Pattern\Service\Service class.

The first parameter is the service IRI, while the second parameter is an array of patterns to use with the service.

Constraints

To apply a constraint, such as a filter, use the EffectiveActivism\SparQlClient\Syntax\Constraint classes.

To use an operator with the Filter() class, use the EffectiveActivism\SparQlClient\Syntax\Constraint\Operator classes.

Filter examples

The example below showcase how to select all subjects that has a schema:headline value of lorem except any subjects with a schema:identifier value of 13a5b1da-9060-11eb-a695-2bfde2d1d6bd.

This example showcases how to use filter operators. Type enforcement ensures some argument validation.

Upload files

To upload a file containing a vocabulary, use the upload method.

You must specify the content type of the file as the second parameter. A default content type of application/x-turtle is assumed.

SHACL validator

To use the validator service, define the SHACL validator endpoint. You can retrieve the SHACL client as a service. Insert, delete, replace and construct statements can be validated.

Example docker-compose setup

The docker services below showcase a working setup. This client has not been tested with other triplestores or validators.

The Blazegraph docker image requires no setup. To setup the isaitb SHACL validator, go here

Planned features


All versions of sparql-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
doctrine/annotations Version ^1.12
psr/log Version ^3.0
ramsey/uuid Version ^4.1
symfony/config Version ^6.4|^7.0
symfony/dependency-injection Version ^6.4|^7.0
symfony/http-client Version ^6.4|^7.0
symfony/property-access Version ^6.4|^7.0
symfony/serializer Version ^6.4|^7.0
symfony/yaml Version ^6.4|^7.0
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 effectiveactivism/sparql-client contains the following files

Loading the files please wait ....