/** * Check if hash variants should be used by the sparql query builder * */ private function checkHashVariants() { SparqlQueryBuilder::setHashVariant(\Request::query('hash_variants', false)); }
public function testDepthCountQueryWithHashAndWithNamedGraph() { QueryBuilder::setHashVariant(true); $query_builder = new QueryBuilder(array('?s', '?p', '?o')); $count_query = $query_builder->createCountQuery('http://foo.test', 'http://foo.test', 'http://foo.test/namedgraph#version1', 3); $expected_query = 'select (count(*) as ?count) FROM <http://foo.test/namedgraph#version1> { ?s ?p ?o.}'; $this->assertEquals($expected_query, $count_query); }