Ejemplo n.º 1
0
 public function __construct($role = parent::DOCUMENT_ROLE, BNodeLabeler $labeler = null, N3Quoter $quoter = null)
 {
     parent::__construct($role, $labeler, $quoter);
     //NOTE: The RDF 1.1 spec of N-Triples allows full UTF-8, so escaping would not be required.
     //      However, as of 2015, many consumers of N-Triples still expect non-ASCII characters
     //      to be escaped.
     //NOTE: if this is changed, getMimeType must be changed accordingly.
     $this->quoter->setEscapeUnicode(true);
     $this->transitionTable[self::STATE_OBJECT] = array(self::STATE_DOCUMENT => " .\n", self::STATE_SUBJECT => " .\n", self::STATE_PREDICATE => " .\n", self::STATE_OBJECT => " .\n");
 }
Ejemplo n.º 2
0
 public function __construct($role = parent::DOCUMENT_ROLE, BNodeLabeler $labeler = null, N3Quoter $quoter = null)
 {
     parent::__construct($role, $labeler, $quoter);
     $this->transitionTable[self::STATE_OBJECT] = array(self::STATE_DOCUMENT => " .\n", self::STATE_SUBJECT => " .\n\n", self::STATE_PREDICATE => " ;\n\t", self::STATE_OBJECT => ",\n\t\t");
     $this->transitionTable[self::STATE_DOCUMENT][self::STATE_SUBJECT] = "\n";
     $this->transitionTable[self::STATE_SUBJECT][self::STATE_PREDICATE] = ' ';
     $this->transitionTable[self::STATE_PREDICATE][self::STATE_OBJECT] = ' ';
     $this->transitionTable[self::STATE_START][self::STATE_DOCUMENT] = function () {
         $this->beginDocument();
     };
 }