|
|
@ -857,8 +857,26 @@ RDF; |
|
|
|
return $relationships; |
|
|
|
return $relationships; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function get_rdf_relationships() { |
|
|
|
/** |
|
|
|
|
|
|
|
* Retrieves RELS-EXT values from item |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param array $namespaces |
|
|
|
|
|
|
|
* @return array |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function get_rdf_relationships($namespaces = null) { |
|
|
|
|
|
|
|
if ($namespaces == NULL) { |
|
|
|
|
|
|
|
$namespaces = array( |
|
|
|
|
|
|
|
RELS_EXT_URI, |
|
|
|
|
|
|
|
FEDORA_MODEL_URI, |
|
|
|
|
|
|
|
ISLANDORA_PAGE_URI, |
|
|
|
|
|
|
|
ISLANDORA_RELS_EXT_URI, |
|
|
|
|
|
|
|
ISLANDORA_RELS_INT_URI, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!is_array($namespaces)) { |
|
|
|
|
|
|
|
$namespaces = array($namespaces); |
|
|
|
|
|
|
|
} |
|
|
|
$relationships = array(); |
|
|
|
$relationships = array(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
$relsext = $this->get_datastream_dissemination('RELS-EXT'); |
|
|
|
$relsext = $this->get_datastream_dissemination('RELS-EXT'); |
|
|
@ -872,13 +890,16 @@ RDF; |
|
|
|
$relsextxml->loadXML($relsext); |
|
|
|
$relsextxml->loadXML($relsext); |
|
|
|
$relsextxml->normalizeDocument(); |
|
|
|
$relsextxml->normalizeDocument(); |
|
|
|
$allTags = array(); |
|
|
|
$allTags = array(); |
|
|
|
$allTags[] = $relsextxml->getElementsByTagNameNS(RELS_EXT_URI, '*'); |
|
|
|
foreach ($namespaces as $namespace) { |
|
|
|
$allTags[] = $relsextxml->getElementsByTagNameNS(FEDORA_MODEL_URI, '*'); |
|
|
|
$allTags[] = $relsextxml->getElementsByTagNameNS($namespace, '*'); |
|
|
|
$allTags[] = $relsextxml->getElementsByTagNameNS(ISLANDORA_PAGE_URI, '*'); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
foreach ($allTags as $tags) { |
|
|
|
foreach ($allTags as $tags) { |
|
|
|
foreach ($tags as $child) { |
|
|
|
foreach ($tags as $child) { |
|
|
|
$value = preg_replace('/info:fedora\//', '', $child->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource')); |
|
|
|
$value = preg_replace('/info:fedora\//', '', $child->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource')); |
|
|
|
|
|
|
|
if (!$value) { |
|
|
|
|
|
|
|
$value = $child->textContent; |
|
|
|
|
|
|
|
} |
|
|
|
$relationships[$child->tagName][] = $value; |
|
|
|
$relationships[$child->tagName][] = $value; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|