diff --git a/src/database/sparql_implementation.py b/src/database/sparql_implementation.py index 5ece152..b1f89d7 100644 --- a/src/database/sparql_implementation.py +++ b/src/database/sparql_implementation.py @@ -67,10 +67,12 @@ def default_query( if inverse: query.where.append(f"OPTIONAL {{ ?{field} {filter} {subject} }}") continue - + if field == "confidence": filter = self.value_to_sparql(self.get_slot_uri(field)) - query.add_filter(f'STR(?{field}) >= "{values["min"]}" && STR(?{field}) <= "{values["max"]}"') + query.add_filter( + f'STR(?{field}) >= "{values["min"]}" && STR(?{field}) <= "{values["max"]}"' + ) continue if values is not None: @@ -190,10 +192,10 @@ def get_sssom_mappings_by_curie(self, search_filter: SearchEntity) -> Iterable[M def get_ui_mappings_by_curie(self, search_filter: SearchEntity) -> Iterable[dict]: filters = search_filter.dict() - if filters["mapping_justification"] != None: + if filters["mapping_justification"] is not None: justifs = filters["mapping_justification"] filters["mapping_justification"] = [expand_uri(justif) for justif in justifs] - + curies = filters.pop("curies") filters["subject_id"] = [expand_uri(curie) for curie in curies] bindings = self.get_mappings_by_field(filters) @@ -263,7 +265,11 @@ def get_sssom_mapping_sets_query( bindings_list = self.transform_result_list(self._query(default_query_list)) r[f"{field}"] = bindings_list - r["mappings"] = {"href": request.url_for(name="mappings_by_mapping_set", id=r["uuid"])} # type: ignore + r["mappings"] = { + "href": request.url_for(name="mappings_by_mapping_set", # type: ignore + id=r["uuid"], + ) + } r.pop("_x") yield r