server/src/app/Repositories/RdfDocumentRepository.php
changeset 506 8a5bb4b48b85
parent 502 74fba571487e
child 532 1190ea937f2d
equal deleted inserted replaced
505:9175ea22f1b1 506:8a5bb4b48b85
    94         return $this->sparqlClient;
    94         return $this->sparqlClient;
    95     }
    95     }
    96 
    96 
    97     private function getResGraph($doc) {
    97     private function getResGraph($doc) {
    98 
    98 
    99         if(empty((array)$doc)) {
    99         if(empty((array)$doc) || !array_key_exists('uri', (array)$doc)) {
   100             return null;
   100             return null;
   101         }
   101         }
   102 
   102 
   103         $newGraph = new Graph($doc->uri->getUri());
   103         $newGraph = new Graph($doc->uri->getUri());
   104         $newGraph->add($doc->uri, "rdf:type", $newGraph->resource("http://www.openarchives.org/ore/terms/Aggregation"));
   104         $newGraph->add($doc->uri, "rdf:type", $newGraph->resource("http://www.openarchives.org/ore/terms/Aggregation"));