Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anitacaron committed Sep 12, 2023
1 parent 4576c1d commit a50660f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/database/sparql_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a50660f

Please sign in to comment.