From 6182348a4f81d456098aa5af32cbbd50f1c7a42e Mon Sep 17 00:00:00 2001 From: Arne Gevaert Date: Tue, 7 Nov 2017 16:46:12 +0100 Subject: [PATCH 1/4] updated gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) 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 From 532d3a748c44e7307dbcd1f282b429359496e814 Mon Sep 17 00:00:00 2001 From: Arne Gevaert Date: Tue, 7 Nov 2017 17:07:14 +0100 Subject: [PATCH 2/4] search by hour --- src/Filesystem/FileSystemProcessor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Filesystem/FileSystemProcessor.php b/src/Filesystem/FileSystemProcessor.php index 88b3a22..a9903ea 100644 --- a/src/Filesystem/FileSystemProcessor.php +++ b/src/Filesystem/FileSystemProcessor.php @@ -98,7 +98,7 @@ public function getPreviousTimestampFromTimestamp($timestamp) { if ($this->out_fs->has($filename)) { return $timestamp; } - $timestamp -= $this->second_interval; + $timestamp -= 60*60; } } return false; @@ -108,7 +108,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; From b691f638d092ab7c27ca2882608c9fcdbd5d8071 Mon Sep 17 00:00:00 2001 From: Arne Gevaert Date: Thu, 9 Nov 2017 11:08:26 +0100 Subject: [PATCH 3/4] round timestamp to 1 hour --- src/Filesystem/FileSystemProcessor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Filesystem/FileSystemProcessor.php b/src/Filesystem/FileSystemProcessor.php index a9903ea..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; } From 216fd79aa4917320752594d44196217bf1266603 Mon Sep 17 00:00:00 2001 From: Arne Gevaert Date: Thu, 9 Nov 2017 12:04:32 +0100 Subject: [PATCH 4/4] fixed some bgus --- src/Filesystem/FileReader.php | 4 ++-- src/Helpers/JSONLDWriter.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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/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]); } }