Skip to content

Commit

Permalink
#23092,#23091
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Aug 21, 2024
1 parent 6f1e62d commit 7a846cc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Helper/ArcheCoreHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function extractExpertView(object $pdoStmt, int $resId, array $contextRel
$id = (string) $triple->id;
$this->resources[$id] ??= (object) ['id' => (int) $id];

if ($triple->id !== $resId && isset($contextRelatives[$triple->property])) {
if ($triple->id !== $resId && isset($contextRelatives[$triple->property])) {
$property = $contextRelatives[$triple->property];
$relvalues = \acdhOeaw\arche\lib\TripleValue::fromDbRow($triple);

Expand All @@ -334,19 +334,27 @@ public function extractExpertView(object $pdoStmt, int $resId, array $contextRel
$this->resources[$id]->repoid = $id;
} elseif ($triple->id === $resId) {
$property = $triple->property;


if ($triple->type === 'REL') {

$relArr[$triple->value]['id'] = $triple->value;
$tid = $triple->value;
$this->resources[$tid] ??= (object) ['id' => (int) $tid];
$this->resources[$id]->$property[$tid] = (object) $this->resources[$tid];

} elseif ($triple->type === 'ID') {
$this->resources[$id]->$property[$id][] = (object) $triple;
} elseif ($triple->type === 'http://www.w3.org/2001/XMLSchema#anyURI') {
$this->resources[$id]->$property[$id][] = (object) $triple;
} else {
if (!($triple->lang)) {
$triple->lang = $lang;
}
$this->resources[$id]->$property[$id] = (object) $triple;

if($triple->lang === $lang) {
$this->resources[$id]->$property[$id] = (object) $triple;
}
}
} elseif ($triple->property === 'ID') {
$this->resources[$id]->$property[$id][] = (object) $triple;
Expand All @@ -360,7 +368,7 @@ public function extractExpertView(object $pdoStmt, int $resId, array $contextRel
$this->changePropertyToShortcut((string) $resId);

$this->setDefaultTitle($lang, $resId);

return $this->resources[(string) $resId];
}

Expand Down

0 comments on commit 7a846cc

Please sign in to comment.