#!/usr/bin/php $format]); $errored = false; $finished = false; $tripleCount = 0; $line = true; while (!$finished && $line) { try { $line = fgets(STDIN); if ($line) { $tripleCount += count($parser->parseChunk($line)); } else { $tripleCount += count($parser->end()); $finished = true; } } catch (\Exception $e) { echo $e->getMessage()."\n"; $errored = true; } } if (!$errored) { echo 'Parsed '.$tripleCount." triples successfully.\n"; }