Skip to content
Snippets Groups Projects
Commit c9732343 authored by esikkala's avatar esikkala
Browse files

URI filter: change order

parent ee0fc263
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,7 @@ export const getResultCount = async ({
facetID: null
}))
}
// console.log(endpoint.prefixes + q)
const response = await runSelectQuery({
query: endpoint.prefixes + q,
endpoint: endpoint.url,
......
......@@ -253,17 +253,7 @@ const generateUriFilter = ({
const facetConfig = backendSearchConfig[facetClass].facets[facetID]
const includeChildren = facetConfig.type === 'hierarchical' && selectAlsoSubconcepts
const literal = facetConfig.literal
const valuesStr = literal ? `"${values.join('" "')}"` : `<${values.join('> <')}></$>`
if (includeChildren) {
s = `
VALUES ?${facetID}Filter { ${valuesStr} }
?${facetID}FilterWithChildren ${facetConfig.parentProperty}* ?${facetID}Filter .
`
} else {
s = `
VALUES ?${facetID}Filter { ${valuesStr} }
`
}
const valuesStr = literal ? `"${values.join('" "')}"` : `<${values.join('> <')}>`
if (inverse) {
s += `
FILTER NOT EXISTS {
......@@ -279,6 +269,16 @@ const generateUriFilter = ({
?${filterTarget} ${facetConfig.predicate} ${filterValue} .
`
}
if (includeChildren) {
s += `
VALUES ?${facetID}Filter { ${valuesStr} }
?${facetID}FilterWithChildren ${facetConfig.parentProperty}* ?${facetID}Filter .
`
} else {
s += `
VALUES ?${facetID}Filter { ${valuesStr} }
`
}
return s
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment