public function testFormatSPARQLStatement()
 {
     $instance = new DebugOutputFormatter();
     $sparql = '';
     $this->assertInternalType('string', $instance->doFormatSPARQLStatement($sparql));
 }
예제 #2
0
 private function getDebugQueryResult(Query $query, Condition $compoundCondition)
 {
     $entries = array();
     if ($this->isSingletonConditionWithElementMatch($compoundCondition)) {
         if ($compoundCondition->condition === '') {
             // all URIs exist, no querying
             $sparql = 'None (no conditions).';
         } else {
             $condition = $this->compoundConditionBuilder->convertConditionToString($compoundCondition);
             $namespaces = $compoundCondition->namespaces;
             $sparql = $this->connection->getSparqlForAsk($condition, $namespaces);
         }
     } elseif ($compoundCondition instanceof FalseCondition) {
         $sparql = 'None (conditions can not be satisfied by anything).';
     } else {
         $condition = $this->compoundConditionBuilder->convertConditionToString($compoundCondition);
         $namespaces = $compoundCondition->namespaces;
         $options = $this->getOptions($query, $compoundCondition);
         $options['DISTINCT'] = true;
         $sparql = $this->connection->getSparqlForSelect('?' . self::RESULT_VARIABLE, $condition, $options, $namespaces);
     }
     $entries['SPARQL Query'] = QueryDebugOutputFormatter::doFormatSPARQLStatement($sparql);
     return QueryDebugOutputFormatter::getStringFrom('SPARQLStore', $entries, $query);
 }