Skip to content

Instantly share code, notes, and snippets.

View nhart's full-sized avatar

Nelson Hart nhart

  • Atlantic Canada
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dwr="http://rs.tdwg.org/dwc/xsd/simpledarwincore/"
xmlns:java="http://xml.apache.org/xalan/java" xmlns:dwc="http://rs.tdwg.org/dwc/terms/"
exclude-result-prefixes="dwc foxml java dwr dcterms">
<!-- HashSet to track single-valued fields. -->
<xsl:variable name="dwc_single_valued_hashset" select="java:java.util.HashSet.new()"/>
<xsl:template match="foxml:datastream[@ID='DWC']/foxml:datastreamVersion[last()]"
@nhart
nhart / delete-objects
Created July 8, 2015 18:02
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);