Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ubccr/ralph

A simple SPARQL client built on top of Guzzle.
https://github.com/ubccr/ralph

guzzle guzzlehttp php php-library sparql sparql-endpoints sparql-query sparql-query-builder

Last synced: 18 days ago
JSON representation

A simple SPARQL client built on top of Guzzle.

Awesome Lists containing this project

README

        

# Ralph

**R**DF **A**bstraction **L**ayer for **PH**P: A simple SPARQL client built on top of Guzzle.

Take a look at the `list` target in the Makefile for how to use `make` to manage the project.

### An example of a query against the British Museum SPARQL endpoint:

```php
$result = (new CCR\Sparql\SparqlClient(new GuzzleHttp\Client()));
->withEndpoint('http://collection.britishmuseum.org/sparql')
->withPrefix('crm', 'http://erlangen-crm.org/current/')
->withPrefix('fts', 'http://www.ontotext.com/owlim/fts#');
->query('
SELECT DISTINCT ?obj
{
?obj crm:P102_has_title ?title .
?title rdfs:label ?label .
FILTER(STR(?label) = "Hoa Hakananai\'a")
}
');
print_r($result);
```