Commit a6f269aa authored by Adrian Schlegel's avatar Adrian Schlegel Committed by Penny Leach
Browse files

Corrected the relationship value "is_supported_by" to "supported_by". Since...


Corrected the relationship value "is_supported_by" to "supported_by". Since this typo has already been introduced with the first LEAP2A implementation, the import had to be adapted to allow both versions for backwards compatibility.
Signed-off-by: default avatarAdrian Schlegel <adrian@liip.ch>
parent 4953892a
......@@ -319,7 +319,7 @@ class LeapExportElementResumeCompositeChildEducationhistory extends LeapExportEl
public function ensure_siblings() {
$this->siblings = array(
'is_supported_by' => new LeapExportElementResumeCompositeSibling($this->parentartefact, $this->exporter, $this, array(
'supported_by' => new LeapExportElementResumeCompositeSibling($this->parentartefact, $this->exporter, $this, array(
'title' => $this->originalrecord->institution,
'updated' => PluginExportLeap::format_rfc3339_date($this->originalrecord->mtime),
), 'organization', 'supports'),
......@@ -327,7 +327,7 @@ class LeapExportElementResumeCompositeChildEducationhistory extends LeapExportEl
'title' => $this->originalrecord->qualtype,
'content' => $this->originalrecord->qualname,
'updated' => PluginExportLeap::format_rfc3339_date($this->originalrecord->mtime),
), 'achievement', 'is_supported_by')
), 'achievement', 'supported_by')
);
}
......@@ -359,7 +359,7 @@ class LeapExportElementResumeCompositeChildEmploymenthistory extends LeapExportE
public function ensure_siblings() {
$this->siblings = array(
'is_supported_by' => new LeapExportElementResumeCompositeSibling($this->parentartefact, $this->exporter, $this, array(
'supported_by' => new LeapExportElementResumeCompositeSibling($this->parentartefact, $this->exporter, $this, array(
'title' => $this->originalrecord->employer,
'updated' => PluginExportLeap::format_rfc3339_date($this->originalrecord->mtime),
), 'organization', 'supports')
......
......@@ -503,7 +503,11 @@ class LeapImportResume extends LeapImportArtefactPlugin {
* @return string The ID of the organization if there is one, else an empty string
*/
private static function check_for_supporting_organization(PluginImportLeap $importer, $link) {
if ($importer->curie_equals($link['rel'], $importer->get_leap2a_namespace(), 'is_supported_by') && isset($link['href'])) {
if (($importer->curie_equals($link['rel'], $importer->get_leap2a_namespace(), 'supported_by') ||
// this is necessary for backwards compatibility. For LEAP2A 2009-03 exports the relationship
// value 'is_supported_by' was used instead of the correct 'supported_by'.
$importer->curie_equals($link['rel'], $importer->get_leap2a_namespace(), 'is_supported_by'))
&& isset($link['href'])) {
if ($potentialorganization = $importer->get_entry_by_id((string)$link['href'])) {
if (PluginImportLeap::is_rdf_type($potentialorganization, $importer, 'organization')) {
return (string)$link['href'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment