feat: add variablemeasured facet type for schema:variableMeasured/PropertyValue search - #290
feat: add variablemeasured facet type for schema:variableMeasured/PropertyValue search#290valentinedwv with Copilot wants to merge 4 commits into
Conversation
…pertyValue - Add buildVariableMeasuredFilter: CONTAINS-based SPARQL filter on PropertyValue names (resolves #280 issue SPARQL pattern) - Add buildVariableMeasuredPropertyPattern: triple pattern for facet option lists (used in getFacetOptions) - Handle 'variablemeasured' type in buildFilterFragments - Update SearchService.buildFacetOptionsQuery to call the new method when facet type is 'variablemeasured' - Enable variableMeasured facet in config_qlever.yaml (was commented out) - Add variableMeasured facet to config_ecoforcast.yaml (tool scenario)
valentinedwv
left a comment
There was a problem hiding this comment.
@copilot
Can we make buildVariableMeasuredFilter a generic buildPropertyValueNameFilter? we may want to different @Propertyvalue
…rtyValueNameFilter - Rename buildVariableMeasuredFilter → buildPropertyValueNameFilter - Rename buildVariableMeasuredPropertyPattern → buildPropertyValueNamePattern - Both methods read sparql_property from facetConfig (default: schema:variableMeasured) so any property→PropertyValue relationship can be configured without code changes - Add 'propertyvalue' as the canonical facet type; keep 'variablemeasured' as a backward-compatible alias in buildFilterFragments - Update config_qlever.yaml and config_ecoforcast.yaml to use type: propertyvalue - Update SearchService.buildFacetOptionsQuery to call the renamed method and handle both type names
Done in the latest commit. To use a different PropertyValue relationship, just add a facet entry in config with the desired property path, e.g.: - field: measurementTechnique
title: Measurement Technique
type: propertyvalue
sparql_property: "schema:measurementTechnique|sschema:measurementTechnique"The canonical type is now |
Description
Adds a
variablemeasuredfacet type that lets users filter datasets byschema:variableMeasured→schema:PropertyValue→schema:name, using CONTAINS-based matching rather than exact IN lookups. The qlever and ecoforecast configs now expose this facet in the sidebar.Changes
SparqlQueryBuilder.jsbuildVariableMeasuredFilter— generates the three-triple PropertyValue traversal withFILTER(CONTAINS(LCASE(STR(?name)), LCASE("value"))). Multiple selected values combine with||. Input sanitized via existingescapeValue.buildVariableMeasuredPropertyPattern— binds?valueto distinct PropertyValue names; used by the facet options sidebar query.buildFilterFragments— dispatchesvariablemeasuredtype to the new filter builder.SearchService.jsbuildFacetOptionsQuery— branches onfacetConfig.type === 'variablemeasured'to callbuildVariableMeasuredPropertyPatterninstead of the generic path, so the sidebar lists actual property names.Config YAML
config_qlever.yaml— uncomments and activates thevariableMeasuredfacet (type changed from commentedtexttovariablemeasured).config_ecoforcast.yaml— addsvariableMeasuredfacet for the tool scenario.Generated SPARQL (filter active)
Review Time Estimate
Type of changes
Checklist: