--- a/server/src/app/Repositories/RdfDocumentRepository.php Tue Sep 06 16:50:41 2016 +0200
+++ b/server/src/app/Repositories/RdfDocumentRepository.php Thu Sep 08 19:15:46 2016 +0200
@@ -89,6 +89,11 @@
}
private function getResGraph($doc) {
+
+ if(empty((array)$doc)) {
+ return null;
+ }
+
$newGraph = new Graph($doc->uri->getUri());
$newGraph->add($doc->uri, "rdf:type", $newGraph->resource("http://www.openarchives.org/ore/terms/Aggregation"));
$newGraph->add($doc->uri, "http://www.europeana.eu/schemas/edm/aggregatedCHO", $doc->doc);
@@ -136,6 +141,9 @@
$docs = $this->sparqlClient->query(self::BASE_DOC_QUERY.$limitsClausesStr);
foreach($docs as $doc) {
$graph = $this->getResGraph($doc);
+ if(is_null($graph)) {
+ continue;
+ }
$uri = $doc->uri->getUri();
$resDocs[$uri] = $graph;
}
@@ -150,6 +158,9 @@
$docs = $this->sparqlClient->query(sprintf($query, $filterUris));
foreach($docs as $doc) {
$graph = $this->getResGraph($doc);
+ if(is_null($graph)) {
+ continue;
+ }
$uri = $doc->uri->getUri();
if(array_key_exists($uri, $resDocs)) {