Skip to content

Commit

Permalink
fix: CTD pair function batch support
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Oct 12, 2023
1 parent 00f7c6e commit 8d7b437
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions data/jq/pair/ctd.jq
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
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
))]
reduce .response[] as $item (
{}; .[(
if ($edge.input | type) == "object" then
($edge.input.queryInputs | toArray)[]
else
($edge.input | toArray)[]
end
)
| select(($item.Input | ascii_upcase | split(":") | last) == (. | ascii_upcase))
| generateCurie($edge.association.input_id; .)
] = []
+ .[(
if ($edge.input | type) == "object" then
($edge.input.queryInputs | toArray)[]
else
($edge.input | toArray)[]
end
)
| select(($item.Input | ascii_upcase | split(":") | last) == (. | ascii_upcase))
| generateCurie($edge.association.input_id; .)
]
+ [$item]
) | map_values([.])
# TODO: current setup doesn't error, but only grabs one item.

0 comments on commit 8d7b437

Please sign in to comment.