diff -r f3474aeec884 -r 265992e5b379 server/src/app/Models/Document.php --- a/server/src/app/Models/Document.php Mon Feb 06 10:03:33 2017 +0100 +++ b/server/src/app/Models/Document.php Mon Feb 06 13:23:39 2017 +0100 @@ -30,6 +30,7 @@ private $contributors = null; private $subjects = null; private $types = null; + private $descriptions = null; private $geoInfo = false; protected function clearMemoizationCache() { @@ -39,6 +40,7 @@ $this->contributors = null; $this->subjects = null; $this->types = null; + $this->descriptions = null; $this->transcript = false; $this->geoInfo = false; } @@ -310,6 +312,19 @@ } + /** + * Get subjects list + */ + public function getDescriptions() { + if(is_null($this->descriptions)) { + $this->descriptions = []; + $this->descriptions = array_merge($this->descriptions, $this->getProvidedCHO()->all('')); + $this->descriptions = array_merge($this->descriptions, $this->getProvidedCHO()->all('')); + $this->descriptions = array_merge($this->descriptions, $this->getProvidedCHO()->all('')); + } + return $this->descriptions; + } + public function isIsomorphic($doc) { return Isomorphic::isomorphic($this->graph, $doc->graph); @@ -359,6 +374,10 @@ function($s) { return Utils::processLiteralResourceOrString($s); }, $this->getTypes() ); + $descriptions = array_map( + function($s) { return Utils::processLiteralResourceOrString($s); }, + $this->getDescriptions() + ); $res = array_merge($res, [ 'publishers' => $publishers, @@ -367,7 +386,8 @@ 'types' => $types, 'transcript' => $transcript, 'mediaArray'=> $mediaArray, - 'geoInfo' => $geoInfo + 'geoInfo' => $geoInfo, + 'descriptions' => $descriptions ]); }