PHPackages                             effectiveactivism/schema-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. effectiveactivism/schema-api

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

effectiveactivism/schema-api
============================

Provides a SparQl client.

14.3.0(3w ago)027811GPL-3.0-or-laterPHPPHP ^8.1

Since Mar 15Pushed 1w ago1 watchersCompare

[ Source](https://github.com/EffectiveActivism/sparql-client)[ Packagist](https://packagist.org/packages/effectiveactivism/schema-api)[ Docs](https://gitlab.com/effective-activism/sparql-client)[ RSS](/packages/effectiveactivism-schema-api/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (24)Versions (71)Used By (1)

SparQl client
=============

[](#sparql-client)

An OOP SPARQL 1.1 client for Symfony with support for SELECT, ASK, CONSTRUCT, DESCRIBE, INSERT, DELETE, DELETE+INSERT, CLEAR, DROP, CREATE, LOAD, COPY, MOVE and ADD operations. Includes graph patterns, aggregates, scalar functions, extension function calls, dataset clauses, and term, namespace and statement validation.

Table of content
----------------

[](#table-of-content)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Select statement](#select-statement)
        - [Limit, offset and order](#limit-offset-and-order)
        - [Distinct and reduced](#distinct-and-reduced)
        - [Group by and having](#group-by-and-having)
        - [Expressions](#expressions)
        - [Dataset clauses](#dataset-clauses)
    - [Ask statement](#ask-statement)
    - [Construct statement](#construct-statement)
    - [Insert statement](#insert-statement)
    - [Delete statement](#delete-statement)
    - [Replace statement](#replace-statement)
    - [Describe statement](#describe-statement)
    - [Graph management](#graph-management)
        - [Create, clear and drop](#create-clear-and-drop)
        - [Load](#load)
        - [Copy, move and add](#copy-move-and-add)
    - [Graph patterns](#graph-patterns)
    - [Union](#union)
    - [Subquery](#subquery)
    - [Property paths and sets](#property-paths-and-sets)
        - [Inverse path example](#inverse-path-example)
        - [Sequence path example](#sequence-path-example)
        - [Negated set example](#negated-set-example)
    - [Assignment](#assignment)
        - [Bind example](#bind-example)
        - [Values example](#values-example)
    - [Validation](#validation)
    - [Optional clauses](#optional-clauses)
    - [Service](#service)
    - [Constraints](#constraints)
        - [Filter examples](#filter-examples)
    - [Aggregates](#aggregates)
    - [Extension functions](#extension-functions)
    - [Error handling](#error-handling)
- [SHACL validator](#shacl-validator)
- [Example docker-compose setup](#example-docker-compose-setup)

Installation
------------

[](#installation)

To install, run

```
composer require effectiveactivism/sparql-client
```

Configuration
-------------

[](#configuration)

This bundle requires two SPARQL endpoints: one for query operations (SELECT, ASK, CONSTRUCT, DESCRIBE) and one for update operations (INSERT, DELETE, DELETE+INSERT via `replace()`, CLEAR, DROP, CREATE, LOAD, COPY, MOVE, ADD). You can also optionally define a SHACL endpoint.

For Blazegraph, both endpoints are the same URL:

```
sparql_client:
  query_endpoint: http://blazegraph:9999/blazegraph/sparql
  update_endpoint: http://blazegraph:9999/blazegraph/sparql
  shacl_endpoint: http://test-validator-endpoint/shacl/myshapes/api/validate
```

For Oxigraph, use the separate `/query` and `/update` paths:

```
sparql_client:
  query_endpoint: http://oxigraph:7878/query
  update_endpoint: http://oxigraph:7878/update
  shacl_endpoint: http://test-validator-endpoint/shacl/myshapes/api/validate
```

Usage
-----

[](#usage)

### Select statement

[](#select-statement)

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

```
