Skip to content

Commit

Permalink
Serialize spelling made consistent with rdfInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Jan 28, 2021
1 parent 0673bbf commit 94c6562
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $instream = fopen('pathToTurtleFile', 'r');
$iterator = $parser->parseStream($stream);
$serializer = new quickRdfIo\NQuadsSerializer();
$outstream = fopen('pathToOutputTurtleFile', 'w');
$serializer->serialiseStream($stream, $iterator);
$serializer->serializeStream($stream, $iterator);
fclose($outstream);
fclose($instream);
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "library",
"description": "Collection of parser and serializers for zozlak/quick-rdf (compatible with zozlak/rdfInterface)",
"keywords": [],
"homepage": "https://github.com/zozlak/quickRdfIo",
"homepage": "https://github.com/sweetrdf/quickRdfIo",
"license": "MIT",
"authors": [
{
Expand Down
12 changes: 6 additions & 6 deletions src/quickRdfIo/NQuadsSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct()
{
}

public function serialise(
public function serialize(
\rdfInterface\QuadIterator $graph,
?\rdfInterface\RdfNamespace $nmsp = null
): string {
Expand All @@ -49,7 +49,7 @@ public function serialise(
if ($stream === false) {
throw new RdfIoException('Failed to convert input to stream');
}
$this->serialiseStream($stream, $graph, $nmsp);
$this->serializeStream($stream, $graph, $nmsp);
$len = ftell($stream);
if ($len === false) {
throw new RdfIoException('Failed to seek in output streem');
Expand All @@ -64,7 +64,7 @@ public function serialise(
return $output;
}

public function serialiseStream(
public function serializeStream(
$output,
\rdfInterface\QuadIterator $graph,
?\rdfInterface\RdfNamespace $nmsp = null
Expand All @@ -74,12 +74,12 @@ public function serialiseStream(
}
foreach ($graph as $i) {
/* @var $i \rdfInterface\Quad */
$subject = NtriplesUtil::serialiseIri($i->getSubject());
$subject = NtriplesUtil::serializeIri($i->getSubject());
$predicate = '<' . NtriplesUtil::escapeIri($i->getPredicate()->getValue()) . '>';
$object = NtriplesUtil::serialise($i->getObject());
$object = NtriplesUtil::serialize($i->getObject());
$graph = $i->getGraphIri();
if ($graph !== null) {
$graph = NtriplesUtil::serialiseIri($graph);
$graph = NtriplesUtil::serializeIri($graph);
}

fwrite($output, "$subject $predicate $object $graph .\n");
Expand Down
6 changes: 3 additions & 3 deletions src/quickRdfIo/TurtleSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct() {

}

public function serialise(
public function serialize(
\rdfInterface\QuadIterator $graph,
?\rdfInterface\RdfNamespace $nmsp = null
): string {
Expand All @@ -49,7 +49,7 @@ public function serialise(
if ($stream === false) {
throw new RdfIoException('Failed to convert input to stream');
}
$this->serialiseStream($stream, $graph, $nmsp);
$this->serializeStream($stream, $graph, $nmsp);
$len = ftell($stream);
if ($len === false) {
throw new RdfIoException('Failed to seek in output streem');
Expand All @@ -63,7 +63,7 @@ public function serialise(
return $output;
}

public function serialiseStream(
public function serializeStream(
$output, \rdfInterface\QuadIterator $graph,
?\rdfInterface\RdfNamespace $nmsp = null
): void {
Expand Down

0 comments on commit 94c6562

Please sign in to comment.