Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
benchmark/node_modules/*
benchmark/out/*
benchmark/resources/*

# Hide .env from repo
.env

Expand Down
4 changes: 2 additions & 2 deletions src/Filesystem/FileReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions src/Filesystem/FileSystemProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers/JSONLDWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
Expand Down