-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Simplify to use python for the sorting, details from:
The SPARQL query replaced a complex set of nested ifs that was hard to follow (6 or so deep as per the ORDER BY clauses). Looking at it again I think we can do it without the nested conditionals:
SELECT the available profiles for a class (+ a hardcoded default profile perhaps)
Put the results from 1 in a set of tuples
Do a sort on it in Python, something like:
return sorted(
rows,
key=lambda r: (
r.req_profile,
-r.distance,
r.def_profile,
r.req_format,
r.def_format,
),
reverse=True
)Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
🆕 New