Skip to content

Commit

Permalink
mappings: add "parent" community and normalize funding
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Feb 8, 2024
1 parent b17fd95 commit 69f21f2
Show file tree
Hide file tree
Showing 6 changed files with 555 additions and 10 deletions.
2 changes: 1 addition & 1 deletion invenio_communities/communities/records/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Community(Record):
funding_award=PIDListRelation(
"metadata.funding",
relation_field="award",
keys=["number", "title"],
keys=["title", "number", "identifiers", "acronym", "program"],
pid_field=Award.pid,
cache_key="awards",
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,33 @@
"dynamic": true
},
"number": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"program": {
"type": "keyword"
},
"acronym": {
"type": "keyword",
"fields": {
"text": {
"type": "text"
}
}
},
"identifiers": {
"properties": {
"identifier": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"scheme": {
"type": "keyword"
Expand Down Expand Up @@ -215,6 +236,21 @@
}
}
},
"theme": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"brand": {
"type": "keyword"
},
"config": {
"type": "object",
"enabled": false
}
}
},
"version_id": {
"type": "long"
},
Expand All @@ -225,6 +261,147 @@
"type": "boolean"
}
}
},
"parent": {
"type": "object",
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"slug": {
"type": "keyword"
},
"metadata": {
"type": "object",
"properties": {
"title": {
"type": "text"
},
"type": {
"type": "object",
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"title": {
"type": "object",
"dynamic": true,
"properties": {
"en": {
"type": "text"
}
}
}
}
},
"website": {
"type": "keyword"
},
"organizations": {
"type": "object",
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"name": {
"type": "text"
}
}
},
"funding": {
"properties": {
"award": {
"type": "object",
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"title": {
"type": "object",
"dynamic": true
},
"number": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"program": {
"type": "keyword"
},
"acronym": {
"type": "keyword",
"fields": {
"text": {
"type": "text"
}
}
},
"identifiers": {
"properties": {
"identifier": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"scheme": {
"type": "keyword"
}
}
}
}
},
"funder": {
"type": "object",
"properties": {
"@v": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"name": {
"type": "text"
}
}
}
}
}
}
},
"theme": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"brand": {
"type": "keyword"
},
"config": {
"type": "object",
"enabled": false
}
}
}
}
}
}
}
Expand Down
Loading

0 comments on commit 69f21f2

Please sign in to comment.