예제 #1
0
 public function toNTriples()
 {
     if (is_null($this->datatypeURI) && is_null($this->language)) {
         return "\"" . RDFliteral::escape($this->lexicalForm) . "\"";
     } else {
         if (is_null($this->datatypeURI)) {
             return "\"" . RDFliteral::escape($this->lexicalForm) . "\"@{$this->language}";
         } else {
             return "\"" . RDFliteral::escape($this->lexicalForm) . "\"^^<{$this->datatypeURI}>";
         }
     }
 }
예제 #2
0
 public function toSPARULPattern()
 {
     Timer::start('RDFliteral::toSPARULPattern');
     if (is_null($this->SPARULpattern)) {
         $storespecific = Options::getOption('Store.SPARULdialect');
         $quotes = $storespecific == VIRTUOSO ? '"""' : '"';
         if (is_null($this->datatypeURI) && is_null($this->language)) {
             $this->SPARULpattern = $quotes . RDFliteral::escape($this->lexicalForm) . $quotes;
         } else {
             if (is_null($this->datatypeURI)) {
                 $this->SPARULpattern = $quotes . RDFliteral::escape($this->lexicalForm) . $quotes . "@{$this->language}";
             } else {
                 $this->SPARULpattern = $quotes . RDFliteral::escape($this->lexicalForm) . $quotes . "^^<{$this->datatypeURI}>";
             }
         }
     }
     Timer::stop('RDFliteral::toSPARULPattern');
     return $this->SPARULpattern;
 }