Skip to content

Commit

Permalink
fix: fixes queries for related entities
Browse files Browse the repository at this point in the history
this is only a preliminary fix, queries are slow as pagination is only implemented for second level entities. Might need a more thorough rewrite.
  • Loading branch information
sennierer committed Aug 18, 2023
1 parent 9ea92be commit 603c2d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions intavia_backend/sparql/query_entities_v2_1.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@
{%- endif -%}
{%- if related_entities_id -%}
?entity_proxy bioc:bearer_of ?role . ?role ^bioc:had_participant_in_role|^bioc:occured_in_the_presence_of_in_role ?event .
{SELECT ?event
WHERE {
{%- for entity in related_entities_id -%}
{?event (crm:P7_took_place_at|((bioc:had_participant_in_role|bioc:occured_in_the_presence_of_in_role)/^bioc:bearer_of))/idmcore:proxy_for <{{entity}}>}
{% if not loop.last %}UNION{% endif %}
{%- endfor -%}
}
}
{%- endif -%}
{%- if event_role -%}
?entity_proxy bioc:bearer_of ?role .
Expand Down

0 comments on commit 603c2d8

Please sign in to comment.