Skip to content

Commit

Permalink
fix: ctd jq pair function
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Oct 3, 2023
1 parent 1e3844d commit 7df862e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion data/jq/pair/ctd.jq
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
reduce (.response | .[]) as $item ({}; .[generateCurie($edge.association.input_id; $item.Input | ascii_upcase)] = [] + .[generateCurie($edge.association.input_id; $item.Input | ascii_upcase)] + [$item]) | map_values([.])
reduce (.response | .[]) as $item (
{}; .[generateCurie($edge.association.input_id; (
if ($edge.input | type) == "object" then
($edge.input.queryInputs | toArray)[] | select(($item.Input | ascii_upcase) | contains(. | ascii_upcase))
else
($edge.input | toArray) | select(($item.Input | ascii_upcase) | contains(. | ascii_upcase))
end
))] = []
+ .[generateCurie($edge.association.input_id; (
if ($edge.input | type) == "object" then
($edge.input.queryInputs | toArray)[] | select(($item.Input | ascii_upcase) | contains(. | ascii_upcase))
else
($edge.input | toArray) | select(($item.Input | ascii_upcase) | contains(. | ascii_upcase))
end
))]
+ [$item]
) | map_values([.])
# TODO: current setup doesn't error, but only grabs one item.

0 comments on commit 7df862e

Please sign in to comment.