Skip to content

Commit

Permalink
removing the automatic insertion of service clause
Browse files Browse the repository at this point in the history
  • Loading branch information
MaillPierre committed Apr 10, 2024
1 parent 7c573f8 commit d86504d
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions indegx/src/RuleApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,25 +210,6 @@ function applyTest(endpointObject: EndpointObject, testObject: RuleTree.Test, en
let testsPool = [];
testQueries.forEach(testQuery => {
testQuery = replacePlaceholders(testQuery, { endpointUrlString: endpointObject.endpoint })
if (!postMode) {
// We check if there is a service clause in the query
if (!SPARQLUtils.queryContainsService(testQuery)) {
let endpointUrl = endpointObject.endpoint;

// ASK queries are given a CORESE SPARQL service extension parameter for a limit of 1, other wise Corese will send a SELECT LIMIT 1000 or something too high
if(SPARQLUtils.isSparqlAsk(testQuery)) {
let endpointUrlObject = new URL(endpointUrl);
let params = new URLSearchParams(endpointUrlObject.search);

//Add a limit of 1 to the ASK query
params.append("limit", "1");
endpointUrl = endpointUrlObject.toString() + "?" + params.toString();
}

// If not, we add the service clause
testQuery = SPARQLUtils.addServiceClause(testQuery, endpointUrl)
}
}
if (endpointObject.graphs !== undefined) {
const parsedQuery = parser.parse(testQuery);
parsedQuery.where = addGraphToInnerQueries(endpointObject, parsedQuery.where);
Expand Down

0 comments on commit d86504d

Please sign in to comment.