Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
faa925c8
Commit
faa925c8
authored
2 years ago
by
HeikkiR
Browse files
Options
Downloads
Patches
Plain Diff
New version of the hierarchical facet query
parent
b4d0c83e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/server/sparql/FacetValues.js
+1
-8
1 addition, 8 deletions
src/server/sparql/FacetValues.js
src/server/sparql/SparqlQueriesGeneral.js
+5
-1
5 additions, 1 deletion
src/server/sparql/SparqlQueriesGeneral.js
with
6 additions
and
9 deletions
src/server/sparql/FacetValues.js
+
1
−
8
View file @
faa925c8
...
@@ -169,7 +169,7 @@ export const getFacet = async ({
...
@@ -169,7 +169,7 @@ export const getFacet = async ({
q
=
q
.
replace
(
/<LANG>/g
,
langTag
)
q
=
q
.
replace
(
/<LANG>/g
,
langTag
)
}
}
//console.log(endpoint.prefixes + q)
//
console.log(endpoint.prefixes + q)
const
response
=
await
runSelectQuery
({
const
response
=
await
runSelectQuery
({
query
:
endpoint
.
prefixes
+
q
,
query
:
endpoint
.
prefixes
+
q
,
...
@@ -327,13 +327,6 @@ export const generateHierarchyBlock = ({
...
@@ -327,13 +327,6 @@ export const generateHierarchyBlock = ({
block
=
block
+
`
block
=
block
+
`
{
{
?instance <PREDICATE>
${
parentPath
}
?id .
?instance <PREDICATE>
${
parentPath
}
?id .
?id <PARENTPROPERTY> ?parent .
}
UNION
{
?instance <PREDICATE>
${
parentPath
}
?id .
FILTER NOT EXISTS { ?id <PARENTPROPERTY> ?noParent . }
BIND ('0' AS ?parent)
}
}
`
`
if
(
i
<
(
depth
-
1
)
)
{
if
(
i
<
(
depth
-
1
)
)
{
...
...
This diff is collapsed.
Click to expand it.
src/server/sparql/SparqlQueriesGeneral.js
+
5
−
1
View file @
faa925c8
...
@@ -131,11 +131,15 @@ export const hierarchicalFacetValuesQuery = `
...
@@ -131,11 +131,15 @@ export const hierarchicalFacetValuesQuery = `
SELECT DISTINCT (count(DISTINCT ?instance) as ?instanceCount) ?id ?parent ?selected {
SELECT DISTINCT (count(DISTINCT ?instance) as ?instanceCount) ?id ?parent ?selected {
# facet values that return results
# facet values that return results
{
{
<FILTER>
<HIERARCHY>
<HIERARCHY>
<FILTER>
VALUES ?facetClass { <FACET_CLASS> }
VALUES ?facetClass { <FACET_CLASS> }
?instance a ?facetClass .
?instance a ?facetClass .
OPTIONAL { ?id <PARENTPROPERTY> ?parent_ }
BIND(COALESCE(?parent_, '0') as ?parent)
<SELECTED_VALUES>
<SELECTED_VALUES>
}
}
<SELECTED_VALUES_NO_HITS>
<SELECTED_VALUES_NO_HITS>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment