Skip to content

Commit

Permalink
mappings: updated awards with subj and orgs
Browse files Browse the repository at this point in the history
  • Loading branch information
0einstein0 committed Oct 8, 2024
1 parent 9f17ecd commit d1f31e2
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 1 deletion.
19 changes: 18 additions & 1 deletion invenio_communities/communities/records/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
FilesField,
IndexField,
PIDListRelation,
PIDNestedListRelation,
PIDRelation,
)
from invenio_vocabularies.contrib.affiliations.api import Affiliation
from invenio_vocabularies.contrib.awards.api import Award
from invenio_vocabularies.contrib.funders.api import Funder
from invenio_vocabularies.contrib.subjects.api import Subject
from invenio_vocabularies.records.api import Vocabulary
from invenio_vocabularies.records.systemfields.relations import CustomFieldsRelation

Expand Down Expand Up @@ -87,10 +89,25 @@ class Community(Record):
funding_award=PIDListRelation(
"metadata.funding",
relation_field="award",
keys=["title", "number", "identifiers", "acronym", "program"],
keys=[
"title",
"number",
"identifiers",
"acronym",
"program",
"subjects",
"organizations",
],
pid_field=Award.pid,
cache_key="awards",
),
funding_award_subjects=PIDNestedListRelation(
"metadata.funding",
relation_field="award.subjects",
keys=["subject", "scheme", "props"],
pid_field=Subject.pid,
cache_key="subjects",
),
funding_funder=PIDListRelation(
"metadata.funding",
relation_field="funder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,39 @@
}
}
},
"subjects": {
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"subject": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"props": {
"type": "object",
"dynamic": "true"
}
}
},
"organizations": {
"properties": {
"scheme": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"organization": {
"type": "keyword"
}
}
},
"identifiers": {
"properties": {
"identifier": {
Expand Down Expand Up @@ -420,6 +453,39 @@
}
}
},
"subjects": {
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"subject": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"props": {
"type": "object",
"dynamic": "true"
}
}
},
"organizations": {
"properties": {
"scheme": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"organization": {
"type": "keyword"
}
}
},
"identifiers": {
"properties": {
"identifier": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,39 @@
}
}
},
"subjects": {
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"subject": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"props": {
"type": "object",
"dynamic": "true"
}
}
},
"organizations": {
"properties": {
"scheme": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"organization": {
"type": "keyword"
}
}
},
"identifiers": {
"properties": {
"identifier": {
Expand Down Expand Up @@ -420,6 +453,39 @@
}
}
},
"subjects": {
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"subject": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"props": {
"type": "object",
"dynamic": "true"
}
}
},
"organizations": {
"properties": {
"scheme": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"organization": {
"type": "keyword"
}
}
},
"identifiers": {
"properties": {
"identifier": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,39 @@
}
}
},
"subjects": {
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"subject": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"props": {
"type": "object",
"dynamic": "true"
}
}
},
"organizations": {
"properties": {
"scheme": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"organization": {
"type": "keyword"
}
}
},
"identifiers": {
"properties": {
"identifier": {
Expand Down Expand Up @@ -378,6 +411,39 @@
}
}
},
"subjects": {
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"subject": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"props": {
"type": "object",
"dynamic": "true"
}
}
},
"organizations": {
"properties": {
"scheme": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"organization": {
"type": "keyword"
}
}
},
"identifiers": {
"properties": {
"identifier": {
Expand Down

0 comments on commit d1f31e2

Please sign in to comment.