You are here

public static function EasyRdf_Serialiser_Turtle::escapeIri in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Turtle.php \EasyRdf_Serialiser_Turtle::escapeIri()

Given a IRI string, escape and enclose in angle brackets.

Parameters

string $resourceIri:

Return value

string

1 call to EasyRdf_Serialiser_Turtle::escapeIri()
EasyRdf_Serialiser_Turtle::serialiseResource in vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Turtle.php
Given a an EasyRdf_Resource or URI, convert it into a string, suitable to be written to a Turtle document. URIs will be shortened into CURIES where possible.

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Turtle.php, line 58

Class

EasyRdf_Serialiser_Turtle
Class to serialise an EasyRdf_Graph to Turtle with no external dependancies.

Code

public static function escapeIri($resourceIri) {
  $escapedIri = str_replace('>', '\\>', $resourceIri);
  return "<{$escapedIri}>";
}