Skip to content

Commit

Permalink
Adjust for broader Literal value typing
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Jan 16, 2021
1 parent 5be7700 commit 377007f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NtriplesUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static function serialiseIri(NamedNode | BlankNode $res): string
if ($res instanceof DefaultGraph) {
return '';
}
$escaped = self::escapeIri($res->getValue());
$escaped = self::escapeIri((string) $res->getValue());
if (substr($res, 0, 2) == '_:') {
return $escaped;
} else {
Expand All @@ -133,7 +133,7 @@ public static function serialiseLiteral(Literal $literal): string
$langtype = $literal->getDatatype();
$langtype = $langtype == RDF::XSD_STRING ?: '^^<' . self::escapeIri($literal->getDatatype()) . '>';
}
return self::escapeLiteral($literal->getValue()) . $langtype;
return self::escapeLiteral((string) $literal->getValue()) . $langtype;
}

public static function serialise(NamedNode | BlankNode | Literal $term): string
Expand Down

0 comments on commit 377007f

Please sign in to comment.