Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ubccr/ralph
- Owner: ubccr
- License: lgpl-3.0
- Created: 2017-03-09T20:09:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T20:54:11.000Z (almost 7 years ago)
- Last Synced: 2024-11-14T14:08:31.070Z (3 months ago)
- Topics: guzzle, guzzlehttp, php, php-library, sparql, sparql-endpoints, sparql-query, sparql-query-builder
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
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);
```