Created
October 16, 2015 16:58
-
-
Save daniel-dgi/f6dae6135b27087d74de to your computer and use it in GitHub Desktop.
Autoload for chullo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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