diff -r a6cf5a06f02d -r 59c68fc4848e server/src/app/Models/Document.php --- a/server/src/app/Models/Document.php Sat May 28 11:49:38 2016 +0200 +++ b/server/src/app/Models/Document.php Sun May 29 16:50:17 2016 +0200 @@ -239,6 +239,24 @@ return $res; } + public function getTranscript() { + $res = null; + foreach($this->graph->allOfType("") as $webResource) { + $format = $webResource->getLiteral("dc11:format")->getValue(); + + if((0 === strpos($format, 'application/xml')) || + (0 === strpos($format, 'application/pdf')) ) { + $conformsTo = $webResource->getResource(""); + $res = [ + 'url' => $webResource->getUri(), + 'format' => $format, + 'conforms-to' => $conformsTo?$conformsTo->getUri():null, + ]; + } + } + return $res; + } + public function getContributors() { if(is_null($this->contributors)) { $this->contributors = array_reduce( @@ -418,6 +436,7 @@ 'publishers' => $publishers, 'contributors' => $contributors, 'subjects' => $subjects, + 'transcript' => $this->getTranscript(), 'mediaArray'=> $mediaArray ];