generate backlinks from person to project #9

Merged
mih merged 3 commits from person-backlinks into main 2026-03-10 07:11:38 +00:00
2 changed files with 13 additions and 0 deletions

View file

@ -36,9 +36,14 @@ jobs:
# get_file_content: false # get_file_content: false
- name: Process metadata - name: Process metadata
env: QRI_RECORD_CACHE=/tmp/cache-person-project
run: | run: |
dtc get-records $DUMPTHINGS_APIURL public -C XYZProject \
| qri inline-records -c public -p associated_with::roles \
| qri cache > /dev/null
dtc get-records ${DUMPTHINGS_APIURL} public -C XYZPerson \ dtc get-records ${DUMPTHINGS_APIURL} public -C XYZPerson \
| qri filter-linked-pid public xyzrins:. associated_with \ | qri filter-linked-pid public xyzrins:. associated_with \
| qri inject-links-pid --only-from-cache -C XYZProject --link associated_with was_associated_with \
| qri inline-records -c public -p delegated_by -p delegated_by::roles -p identifiers::creator \ | qri inline-records -c public -p delegated_by -p delegated_by::roles -p identifiers::creator \
| qri render-record page_templates/person.md.j2 'content/{__pid_curie_reference}/_index.md' | qri render-record page_templates/person.md.j2 'content/{__pid_curie_reference}/_index.md'
- name: Deposit changes - name: Deposit changes

View file

@ -13,4 +13,12 @@ title: {{ given_name }} {{ family_name }}
{% elif identifier.creator.name == "ResearchGate" %}- [ResearchGate: {{ identifier.notation }}](https://www.researchgate.net/profile/{{ identifier.notation }}) {% elif identifier.creator.name == "ResearchGate" %}- [ResearchGate: {{ identifier.notation }}](https://www.researchgate.net/profile/{{ identifier.notation }})
{% else %}- {{ identifier.creator.name }}: {{ identifier.notation }} {% else %}- {{ identifier.creator.name }}: {{ identifier.notation }}
{% endif %} {% endif %}
{%- endfor %}
This Person was associated with the following projects:
{%- for project in was_associated_with %}
{% set associations = project.associated_with | selectattr("object", "eq", pid) | list %}
- [{{ project.title }}](/{{ project.pid | replace("xyzrins:", "") }}) as {% for ass in associations %} {% for role in ass.roles %} {{ role.display_label | default(role.name) | lower() }}{{ ", " if not loop.last }} {% endfor %} {% if ass.started is defined and ass.ended is defined %} ({{ ass.started.at_time }} -- {{ ass.ended.at_time }}) {% elif ass.started %} (since {{ ass.started.at_time }}) {% elif ass.ended %} (until {{ ass.ended.at_time }}) {% endif %} {%- if not loop.last %};{% endif %} {% endfor %}
{%- endfor -%} {%- endfor -%}