Skip to content

Commit

Permalink
Merge pull request #1104 from assemblee-virtuelle/fix-sparqlendpoint-…
Browse files Browse the repository at this point in the history
…manage-encodeUri

adding string check  if sparqlwhere come from uri
  • Loading branch information
simonLouvet authored Jan 25, 2023
2 parents 923de06 + 7a83aac commit 9704f86
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ const fetchSparqlEndpoints = async (containers, resourceId, params, config) => {
getBlankNodesFromDataServers(containers[serverKey], dataServers);

const predicates = params.filter?._predicates || dataModel.list?.predicates;

//When the sparql request come from URI, it's a string who must must be decode.
if (params.filter.sparqlWhere && (typeof params.filter.sparqlWhere === 'string' || params.filter.sparqlWhere instanceof String)) {
params.filter.sparqlWhere = JSON.parse(decodeURIComponent(params.filter.sparqlWhere));
}
const sparqlQuery = buildSparqlQuery({
containers: containers[serverKey],
params: { ...params, filter: { ...dataModel.list?.filter, ...params.filter } },
Expand Down

0 comments on commit 9704f86

Please sign in to comment.