Skip to content

Commit

Permalink
TriGParser: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Jan 25, 2024
1 parent a425372 commit 6c271ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/quickRdfIo/TriGParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ public function next(): void {
if ($quad) {
$df = $this->dataFactory;
$sbj = Util::isBlank($quad['subject']) ?
$df::BlankNode($quad['subject']) : $df::NamedNode($quad['subject']);
$prop = $df::NamedNode($quad['predicate']);
$df::blankNode($quad['subject']) : $df::namedNode($quad['subject']);
$prop = $df::namedNode($quad['predicate']);
if (substr($quad['object'], 0, 1) !== '"') {
$obj = Util::isBlank($quad['object']) ?
$df::BlankNode($quad['object']) : $df::NamedNode($quad['object']);
$df::blankNode($quad['object']) : $df::namedNode($quad['object']);
} else {
// as Util::getLiteralValue() doesn't work for multiline values
$value = substr($quad['object'], 1, strrpos($quad['object'], '"') - 1);
Expand All @@ -159,6 +159,7 @@ public function next(): void {
}

public function rewind(): void {
$this->n = 0;
if ($this->input->tell() !== 0) {
$this->input->rewind();
}
Expand Down

0 comments on commit 6c271ae

Please sign in to comment.