コード例 #1
0
 /**
  * @return array
  */
 public function namespaces()
 {
     return RdfNamespace::namespaces();
 }
コード例 #2
0
ファイル: Client.php プロジェクト: johnulist/easyrdf
 /**
  * Adds missing prefix-definitions to the query
  *
  * Overriding classes may execute arbitrary query-alteration here
  *
  * @param string $query
  * @return string
  */
 protected function preprocessQuery($query)
 {
     // Check for undefined prefixes
     $prefixes = '';
     foreach (RdfNamespace::namespaces() as $prefix => $uri) {
         if (strpos($query, "{$prefix}:") !== false and strpos($query, "PREFIX {$prefix}:") === false) {
             $prefixes .= "PREFIX {$prefix}: <{$uri}>\n";
         }
     }
     return $prefixes . $query;
 }