PHP code example of ubccr / ralph

1. Go to this page and download the library: Download ubccr/ralph library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ubccr / ralph example snippets


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