Permalink
Browse files

describe queries are now translated into construct queries

  • Loading branch information...
tomatophantastico committed Mar 24, 2017
1 parent 4ef0f69 commit 716870597e8ffec3c9fb19073df96298d746f9d6
@@ -10,7 +10,7 @@ cache:
# - git clone https://github.com/tomatophantastico/metamodel.git && cd metamodel && git checkout 4ef1aa2f4dacc4e1c20d6560422d04a895ca3791 && mvn install -DskipTests
script:
gradle installDist
./gradlew installDist
deploy:
provider: releases
@@ -32,8 +32,13 @@
public static void normalize(TranslationContext context){
//rewrite describe queries as construct queries
DescribeRewriter.rewriteDescribe(context);
Query sparqlQuery = context.getQuery();
Op query = agen.compile(sparqlQuery);
LOGGER.debug("Qp before rewriting is: {}",query );
@@ -57,7 +62,7 @@ public static void normalize(TranslationContext context){
LOGGER.debug("Op after property path rewriting is {}", query);
LOGGER.debug("Op after property path rewriting is {}", query);
@@ -5,6 +5,7 @@
import org.aksw.sparqlmap.backend.metamodel.TranslationContextMetaModel;
import org.aksw.sparqlmap.core.errors.ImplementationException;
import org.apache.jena.graph.Graph;
import org.apache.jena.graph.Triple;
import org.apache.jena.query.Dataset;
import org.apache.jena.query.Query;
@@ -13,8 +14,13 @@
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.riot.system.StreamRDF;
import org.apache.jena.sparql.core.DatasetImpl;
import org.apache.jena.sparql.core.Quad;
import org.apache.jena.sparql.graph.GraphFactory;
import org.apache.jena.sparql.util.Context;
import org.apache.metamodel.DataContext;
@@ -104,21 +110,30 @@ public Dataset execConstructDataset(Dataset dataset) {
@Override
public Model execDescribe() {
return QueryExecutionFactory.create(query, dataset).execDescribe();
// as the query is rewritten to a construct query, we execture the construct here
return QueryExecutionFactory.create(query, dataset).execConstruct();
}
@Override
public Model execDescribe(Model model) {
return QueryExecutionFactory.create(query, dataset).execDescribe(model);
// as the query is rewritten to a construct query, we execture the construct here
return QueryExecutionFactory.create(query, dataset).execConstruct(model);
}
@Override
public Iterator<Triple> execDescribeTriples() {
return QueryExecutionFactory.create(query, dataset).execDescribeTriples();
// as the query is rewritten to a construct query, we execture the construct here
return QueryExecutionFactory.create(query, dataset).execConstructTriples();
}
@Override
public boolean execAsk() {

0 comments on commit 7168705

Please sign in to comment.