Skip to content

Commit

Permalink
fix: fixes an error in the bulk retrieve entities endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sennierer committed Jul 7, 2023
1 parent 84ab974 commit cc89648
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion intavia_backend/sparql/bulk_retrieve_entities_v2_1.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SELECT ?entity ?entityType ?entityTypeLabel ?entityLabel ?gender ?genderLabel ?n
{% include 'add_datasets_v2_1.sparql' %}

WITH {
SELECT DISTINCT ?entity ?entityTypeLabel
SELECT DISTINCT ?entity ?entityTypeLabel ?entity_proxy

{% for dataset in datasets -%}
FROM <{{dataset.value}}>
Expand Down
21 changes: 5 additions & 16 deletions intavia_backend/sparql/entity_type_bindings_v2_1.sparql
Original file line number Diff line number Diff line change
@@ -1,41 +1,30 @@
?entity_proxy idmcore:proxy_for ?entity .
{%- if kind -%}
{%- for k1 in kind -%}
{?entity_proxy a {{k1.get_rdf_uri()}}
BIND("{{k1}}" AS ?entityTypeLabel)}
{%- if k1 == 'person' -%}
GRAPH <http://www.intavia.eu/graphs/provided_persons>
{?entity_proxy idmcore:proxy_for ?entity .}
?entity_proxy a idmcore:Person_Proxy
{%- elif k1 == 'group' -%}
GRAPH <http://www.intavia.eu/graphs/provided_groups>
{?entity_proxy idmcore:proxy_for ?entity .}
?entity_proxy a crm:E74_Group
{%- elif k1 == 'place' -%}
GRAPH <http://www.intavia.eu/graphs/provided_places>
{?entity_proxy idmcore:proxy_for ?entity .}
?entity_proxy a crm:E53_Place
{%- elif k1 == 'cultural-heritage-object' -%}
GRAPH <http://www.intavia.eu/graphs/provided_cho>
{?entity_proxy idmcore:proxy_for ?entity .}
?entity_proxy a idm:CHO_Proxy
{%- endif -%}
{% if not loop.last %}UNION{% endif %}
{%- endfor -%}
{%- else -%}
{?entity_proxy a idmcore:Person_Proxy
BIND("person" AS ?entityTypeLabel)
GRAPH <http://www.intavia.eu/graphs/provided_persons>
{?entity_proxy idmcore:proxy_for ?entity .}
} UNION {
?entity_proxy a crm:E74_Group
BIND("group" AS ?entityTypeLabel)
GRAPH <http://www.intavia.eu/graphs/provided_groups>
{?entity_proxy idmcore:proxy_for ?entity .}
} UNION {
?entity_proxy a crm:E53_Place
BIND("place" AS ?entityTypeLabel)
GRAPH <http://www.intavia.eu/graphs/provided_places>
{?entity_proxy idmcore:proxy_for ?entity .}
} UNION {
?entity_proxy a idm:CHO_Proxy
BIND("cultural-heritage-object" AS ?entityTypeLabel)
GRAPH <http://www.intavia.eu/graphs/provided_cho>
{?entity_proxy idmcore:proxy_for ?entity .}
}
{%- endif -%}

0 comments on commit cc89648

Please sign in to comment.