islandora/chullo
Chullo is a PHP 7.4+ client for the Fedora repository, built on Guzzle and EasyRdf. Create resources, fetch and modify RDF graphs, and save updates back to Fedora. Install via Composer and use in Islandora/Fedora integrations.
Http::post())./fcr:tx), useful for atomic operations in Laravel’s database transactions.Graph class to Laravel’s container.RDF or GraphQL packages (if used).$this->app->bind('easyrdf.graph', function () {
return new \EasyRdf\Graph();
});
try-catch or use custom exceptions?/fcr:tx?composer require islandora/chullo
createResource(), saveGraph()) in a Laravel Tinker or Artisan command.namespace App\Services;
use Islandora\Chullo\Chullo;
class FedoraService {
protected $chullo;
public function __construct() {
$this->chullo = Chullo::create(config('fedora.url'));
}
public function createDigitalObject() {
$uri = $this->chullo->createResource();
// ... further logic
return $uri;
}
}
AppServiceProvider:
$this->app->singleton(FedoraService::class, function ($app) {
return new FedoraService();
});
Route::post('/digital-objects', [DigitalObjectController::class, 'store']);
public function store(StoreDigitalObjectRequest $request, FedoraService $fedora) {
$uri = $fedora->createDigitalObject($request->validated());
return response()->json(['uri' => $uri]);
}
$graph = $this->chullo->getGraph($uri);
$data = $graph->serialise('json-ld');
DigitalObject::create(json_decode($data, true));
^6.5.8).docker-compose up from Islandora’s playbook)..env:
FEDORA_URL=http://localhost:8080/fcrepo/rest
404 Not Found, 409 Conflict)./fcr:tx for atomic operations.sparql() for complex queries.Log facade:
\Log::debug('Fedora response', ['data' => $response->getBody()]);
^1.0) simplifies upgrades, but API changes in Fedora 4 may require adjustments.$client = new \GuzzleHttp\Client([
'handler' => \GuzzleHttp\HandlerStack::create([
new \GuzzleHttp\Middleware::tap(function ($request, $
How can I help you explore Laravel packages today?