Skip to content
/ ralph Public

A simple SPARQL client built on top of Guzzle.

License

Notifications You must be signed in to change notification settings

ubccr/ralph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ralph

RDF Abstraction Layer for PHP: 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:

$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);