diff --git a/.gitignore b/.gitignore index 3169366..0db60ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +benchmark/node_modules/* +benchmark/out/* +benchmark/resources/* + # Hide .env from repo .env diff --git a/src/Filesystem/FileReader.php b/src/Filesystem/FileReader.php index bd81a42..f8bde27 100644 --- a/src/Filesystem/FileReader.php +++ b/src/Filesystem/FileReader.php @@ -191,9 +191,9 @@ private function getNextFileFromTimestamp($timestamp) { // Get previous page for requested timestamp (this is the previous page to page_for_timestamp) private function getPreviousFileFromTimestamp($timestamp) { - $prev_ts = $this->getPreviousTimestampFromTimestamp($timestamp); + $prev_ts = $this->getPreviousTimestampFromTimestamp($timestamp); // file containing timestamp + $prev_ts = $this->getPreviousTimestampFromTimestamp($prev_ts - 1); // Previous file if ($prev_ts) { - $prev_ts -= $this->second_interval; if ($this->out_fs->has($prev_ts)) { return date("Y-m-d\TH:i:s", $prev_ts); } else { diff --git a/src/Filesystem/FileSystemProcessor.php b/src/Filesystem/FileSystemProcessor.php index 88b3a22..b883ea0 100644 --- a/src/Filesystem/FileSystemProcessor.php +++ b/src/Filesystem/FileSystemProcessor.php @@ -85,7 +85,8 @@ public function getOldestTimestamp() { // Round a timestamp to its respective file timestamp protected function roundTimestamp($timestamp) { - $timestamp -= $timestamp % $this->second_interval; + //$timestamp -= $timestamp % $this->second_interval; + $timestamp -= $timestamp % 3600; return $timestamp; } @@ -98,7 +99,7 @@ public function getPreviousTimestampFromTimestamp($timestamp) { if ($this->out_fs->has($filename)) { return $timestamp; } - $timestamp -= $this->second_interval; + $timestamp -= 60*60; } } return false; @@ -108,7 +109,7 @@ public function getNextTimestampForTimestamp($timestamp) { $timestamp = $this->roundTimestamp($timestamp); $now = time(); while($timestamp < $now) { - $timestamp += $this->second_interval; + $timestamp += 60*60; $filename = $this->roundTimestamp($timestamp); if ($this->out_fs->has($filename)) { return $timestamp; diff --git a/src/Helpers/JSONLDWriter.php b/src/Helpers/JSONLDWriter.php index 2d5dee4..60dd5d2 100644 --- a/src/Helpers/JSONLDWriter.php +++ b/src/Helpers/JSONLDWriter.php @@ -37,9 +37,9 @@ public function addTriples($triples) { } else { $obj = ["@id" => $triple["object"]]; } - if (substr($obj, 0, 1) === '"') { + /*if (substr($obj, 0, 1) === '"') { $obj = Util::getLiteralValue($obj); - } + }*/ array_push($this->graph[$triple["graph"]]["@graph"], ["@id" => $triple["subject"], $pred => $obj]); } }