Skip to content

Instantly share code, notes, and snippets.

@daniel-dgi
Created October 16, 2015 16:58
Show Gist options
  • Save daniel-dgi/f6dae6135b27087d74de to your computer and use it in GitHub Desktop.
Save daniel-dgi/f6dae6135b27087d74de to your computer and use it in GitHub Desktop.
Autoload for chullo
<?php
require '../vendor/autoload.php';
use Islandora\Chullo\TriplestoreClient;
$triplestore = TriplestoreClient::create('http://127.0.0.1:8080/bigdata/namespace/kb/sparql/');
$sparql = <<<EOD
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX pcdm: <http://pcdm.org/models#>
PREFIX fedora: <http://fedora.info/definitions/v4/repository#>
SELECT ?s
WHERE {
?s fedora:hasParent <http://localhost:8080/fcrepo/rest/> .
}
LIMIT 1
EOD;
$results = $triplestore->query($sparql);
foreach ($results as $triple) {
echo $triple->s . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment