From 721f9b4d8542b008631af9bf33cceee37e09d65e Mon Sep 17 00:00:00 2001 From: Abram Booth Date: Fri, 24 May 2024 15:45:59 -0400 Subject: [PATCH] fix: next page link with cardSearchText --- share/search/search_params.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/share/search/search_params.py b/share/search/search_params.py index 42d372762..7961eb439 100644 --- a/share/search/search_params.py +++ b/share/search/search_params.py @@ -234,7 +234,7 @@ def queryparams_from_textsegments(self, queryparam_family: str, textsegments): for _propertypath_set, _combinable_segments in _by_propertypath_set.items(): _qp_name = QueryparamName( queryparam_family, - propertypath_set_key(_propertypath_set), + (propertypath_set_key(_propertypath_set),), ) _qp_value = ' '.join( _textsegment.as_searchtext() @@ -508,14 +508,21 @@ def valuesearch_type_iris(self): ### # local helpers -def propertypath_key(property_path: tuple[str, ...]): +def propertypathstep_key(pathstep: str) -> str: + if pathstep == GLOB_PATHSTEP: + return pathstep + # assume iri + return urllib.parse.quote(osfmap_shorthand().compact_iri(pathstep)) + + +def propertypath_key(property_path: tuple[str, ...]) -> str: return PROPERTYPATH_DELIMITER.join( - urllib.parse.quote(osfmap_shorthand().compact_iri(_property_iri)) - for _property_iri in property_path + propertypathstep_key(_pathstep) + for _pathstep in property_path ) -def propertypath_set_key(propertypath_set: frozenset[tuple[str, ...]]): +def propertypath_set_key(propertypath_set: frozenset[tuple[str, ...]]) -> str: return join_queryparam_value( propertypath_key(_propertypath) for _propertypath in propertypath_set