Skip to content

Instantly share code, notes, and snippets.

@nhart
Created July 8, 2015 18:02
Show Gist options
  • Save nhart/623210d0b1e888fa396b to your computer and use it in GitHub Desktop.
Save nhart/623210d0b1e888fa396b to your computer and use it in GitHub Desktop.
delete objects
$query = <<<EOQ
SELECT ?pid
FROM <#ri>
WHERE {
?pid <fedora-rels-ext:isMemberOfCollection> <info:fedora/enter-collection-pid-here>;
}
EOQ;
$connection = islandora_get_tuque_connection();
$results = $connection->repository->ri->sparqlQuery($query);
foreach ($results as $result) {
$pid = $result['pid']['value'];
$connection->repository->purgeObject($pid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment