Skip to content

feat: add variablemeasured facet type for schema:variableMeasured/PropertyValue search - #290

Open
valentinedwv with Copilot wants to merge 4 commits into
devfrom
copilot/qlever-variablesmeasured-facet
Open

feat: add variablemeasured facet type for schema:variableMeasured/PropertyValue search#290
valentinedwv with Copilot wants to merge 4 commits into
devfrom
copilot/qlever-variablesmeasured-facet

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a variablemeasured facet type that lets users filter datasets by schema:variableMeasuredschema:PropertyValueschema:name, using CONTAINS-based matching rather than exact IN lookups. The qlever and ecoforecast configs now expose this facet in the sidebar.

Changes

SparqlQueryBuilder.js

  • buildVariableMeasuredFilter — generates the three-triple PropertyValue traversal with FILTER(CONTAINS(LCASE(STR(?name)), LCASE("value"))). Multiple selected values combine with ||. Input sanitized via existing escapeValue.
  • buildVariableMeasuredPropertyPattern — binds ?value to distinct PropertyValue names; used by the facet options sidebar query.
  • buildFilterFragments — dispatches variablemeasured type to the new filter builder.

SearchService.js

  • buildFacetOptionsQuery — branches on facetConfig.type === 'variablemeasured' to call buildVariableMeasuredPropertyPattern instead of the generic path, so the sidebar lists actual property names.

Config YAML

  • config_qlever.yaml — uncomments and activates the variableMeasured facet (type changed from commented text to variablemeasured).
  • config_ecoforcast.yaml — adds variableMeasured facet for the tool scenario.

Generated SPARQL (filter active)

?subj schema:variableMeasured|sschema:variableMeasured ?variableMeasured_vm .
VALUES ?variableMeasured_pvType { schema:PropertyValue sschema:PropertyValue }
?variableMeasured_vm a ?variableMeasured_pvType .
?variableMeasured_vm schema:name|sschema:name ?variableMeasured_propName .
FILTER(CONTAINS(LCASE(STR(?variableMeasured_propName)), LCASE("datetime"))) .

Review Time Estimate

  • Immediately
  • Within a week
  • When possible

Type of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Other (any another change that does not fall in one of the above categories.)

Checklist:

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My change requires updating the documentation.
  • I have made necessary changes to the documentation.
  • I have added tests related to my changes.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Copilot AI linked an issue Jul 27, 2026 that may be closed by this pull request
Copilot AI added 2 commits July 27, 2026 22:22
…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)
Copilot AI changed the title [WIP] Add variablesMeasured facet UI with updated SPARQL query feat: add variablemeasured facet type for schema:variableMeasured/PropertyValue search Jul 27, 2026
Copilot AI requested a review from valentinedwv July 27, 2026 22:24
@valentinedwv
valentinedwv marked this pull request as ready for review July 28, 2026 18:26

@valentinedwv valentinedwv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

@copilot
Can we make buildVariableMeasuredFilter a generic buildPropertyValueNameFilter? we may want to different @Propertyvalue

Done in the latest commit. buildVariableMeasuredFilter is now buildPropertyValueNameFilter (and buildVariableMeasuredPropertyPatternbuildPropertyValueNamePattern). Both methods read sparql_property from the facet config, defaulting to schema:variableMeasured|sschema:variableMeasured when not set.

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 propertyvalue; variablemeasured remains a backward-compatible alias in the dispatch switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qlever variablesMeasured facet

2 participants