lot1-kickoff/airflow/dags/EOSC_indexes.py

933 lines
23 KiB
Python

mappings = {}
mappings['datasource'] = {
"properties": {
"data_source_classification": {
"type": "keyword"
},
"eoscId": {
"type": "keyword"
},
"identifiers": {
"type": "object",
"properties": {
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
},
"jurisdiction": {
"type": "keyword"
},
"local_identifier": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"organization": {
"type": "object",
"properties": {
"isni": {
"type": "keyword"
},
"local_identifier": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"rinGold": {
"type": "keyword"
},
"ror": {
"type": "keyword"
},
"wikidata": {
"type": "keyword"
}
}
},
"preservation_policy_url": {
"type": "text"
},
"research_product_access_policy": {
"type": "keyword"
},
"research_product_metadata_access_policy": {
"type": "keyword"
},
"research_product_type": {
"type": "keyword"
},
"thematic": {
"type": "boolean"
},
"version_control": {
"type": "boolean"
}
}
}
mappings['venues'] = {
"properties": {
"identifiers": {
"type": "object",
"properties": {
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
},
"local_identifier": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"publisher": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"type": {
"type": "keyword"
}
}
}
mappings['topics'] = {
"properties": {
"identifiers": {
"type": "object",
"properties": {
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
},
"local_identifier": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
}
}
}
mappings['persons'] = {
"properties": {
"family_name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"full_name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"given_name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"identifiers": {
"type": "object",
"properties": {
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
},
"local_identifier": {
"type": "keyword"
}
}
}
mappings['organizations'] = {
"properties": {
"country": {
"type": "keyword"
},
"identifiers": {
"type": "object",
"properties": {
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
},
"local_identifier": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"other_names": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"short_name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"type": {
"type": "keyword"
}
}
}
mappings['grants'] = {
"properties": {
"acronym": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"beneficiaries": {
"type": "object",
"properties": {
"isni": {
"type": "keyword"
},
"local_identifier": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"rinGold": {
"type": "keyword"
},
"ror": {
"type": "keyword"
},
"wikidata": {
"type": "keyword"
}
}
},
"currency": {
"type": "keyword"
},
"end_date": {
"type": "date",
"ignore_malformed": "true"
},
"funded_amount": {
"type": "double"
},
"funder": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"funding_stream": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"grantCode": {
"type": "keyword"
},
"identifiers": {
"type": "object",
"properties": {
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
},
"local_identifier": {
"type": "keyword"
},
"start_date": {
"type": "date",
"ignore_malformed": "true"
},
"summary": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"title": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"website": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
}
}
}
mappings['products'] = {
"properties": {
### Syntethic fields
### generated by transformation
"accessRights": {
"type": "keyword"
},
"domain": {
"type": "object",
"properties": {
"domain": {
"type": "keyword"
},
"subdomain": {
"type": "keyword"
}
}
},
"firstPublishDate": {
"type": "date"
},
"keyword": {
"type": "keyword"
},
### raw fields
"abstracts": {
"type": "object",
"properties": {
# TODO: other languages via index templates
"none": {
"type": "text"
}
}
},
"contributions": {
"type": "object",
"properties": {
"declared_affiliations": {
"type": "keyword"
},
"person": {
"type": "object",
"properties": {
"full_name": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"local_identifier": {
"type": "keyword"
},
"orcid": {
"type": "keyword"
}
}
},
"rank": {
"type": "long"
},
"roles": {
"type": "keyword"
}
}
},
"funding": {
"type": "object",
"properties": {
"code": {
"type": "keyword"
},
"funder": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
},
"local_identifier": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"identifiers": {
"type": "object",
"properties": {
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
},
"indicator": {
"type": "object",
"properties": {
"downloadsAndViews": {
"type": "object",
"properties": {
"downloads": {
"type": "long"
},
"views": {
"type": "long"
}
}
}
}
},
"local_identifier": {
"type": "keyword"
},
"manifestations": {
"type": "object",
"properties": {
"access_right": {
"type": "keyword"
},
"biblio": {
"type": "object",
"properties": {
"edition": {
"type": "text"
},
"end_page": {
"type": "text"
},
"hosting_data_source": {
"type": "text"
},
"issue": {
"type": "text"
},
"number": {
"type": "text"
},
"publisher": {
"type": "text"
},
"start_page": {
"type": "text"
},
"volume": {
"type": "text"
}
}
},
"dates": {
"type": "object",
"properties": {
"type": {
"type": "text"
},
"value": {
"type": "date"
}
}
},
"eoscId": {
"type": "keyword"
},
"hosting_datasource": {
"type": "object",
"properties": {
"local_identifier": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
}
}
},
"licence": {
"type": "text"
},
"metadata_curation": {
"type": "keyword"
},
"peer_review": {
"type": "keyword"
},
"pid": {
"type": "keyword"
},
"product_local_type": {
"type": "keyword"
},
"product_local_type_schema": {
"type": "keyword"
},
"url": {
"type": "text"
},
"venue": {
"type": "object",
"properties": {
"local_identifier": {
"type": "keyword"
},
"name": {
"type": "text"
}
}
}
}
},
"product_type": {
"type": "keyword"
},
"related_products": {
"type": "object",
"properties": {
"product_list": {
"type": "object",
"properties": {
"arxivid": {
"type": "keyword"
},
"doi": {
"type": "keyword"
},
"local_identifier": {
"type": "keyword"
},
"pmid": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"relation_type": {
"type": "keyword"
}
}
},
"relevant_organizations": {
"type": "object",
"properties": {
"isni": {
"type": "keyword"
},
"local_identifier": {
"type": "keyword"
},
"name": {
"type": "text"
},
"rinGold": {
"type": "keyword"
},
"ror": {
"type": "keyword"
},
"wikidata": {
"type": "keyword"
}
}
},
"titles": {
"type": "object",
#TODO: other languages ??
"properties": {
"none": {
"type": "text"
}
}
},
"topics": {
"type": "object",
"properties": {
"provenance": {
"type": "object",
"properties": {
"trust": {
"type": "keyword",
"index": "false"
},
"type": {
"type": "keyword",
"index": "false"
}
}
},
"topic": {
"type": "object",
"properties": {
"local_identifier": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
}
}
},
"type": {
"path": "product_type",
"type": "alias"
}
}
}
#
# EOSC CATALOG
#
mappings['services'] = {
"properties": {
"access_modes": {
"type": "keyword"
},
"category": {
"type": "object",
"properties": {
"category": {
"type": "keyword"
},
"subcategory": {
"type": "keyword"
}
}
},
"description": {
"type": "text"
},
"domain": {
"type": "object",
"properties": {
"domain": {
"type": "keyword"
},
"subdomain": {
"type": "keyword"
}
}
},
"horizontal": {
"type": "boolean"
},
"id": {
"type": "keyword"
},
"interoperabilityGuidelines": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"language": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"organization": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"providers": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"relatedPlatforms": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"relatedResources": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"tags": {
"type": "keyword"
},
"type": {
"type": "keyword"
},
"webpage": {
"type": "text"
},
"year": {
"type": "long"
}
}
}
mappings['interoperability'] = {
"properties": {
"description": {
"type": "text"
},
"domain": {
"type": "object",
"properties": {
"domain": {
"type": "keyword"
},
"subdomain": {
"type": "keyword"
}
}
},
"guidelineType": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"id": {
"type": "keyword"
},
"license": {
"type": "keyword"
},
"organization": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"publicationYear": {
"type": "long"
},
"services": {
"type": "object",
"properties": {
"name": {
"type": "keyword"
},
"organization": {
"type": "keyword"
}
}
},
"title": {
"type": "text"
},
"type": {
"type": "keyword"
}
}
}
mappings['training'] = {
"properties": {
"accessRights": {
"type": "keyword"
},
"authors": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"contentResourceType": {
"type": "keyword"
},
"description": {
"type": "text"
},
"domain": {
"type": "object",
"properties": {
"domain": {
"type": "keyword"
},
"subdomain": {
"type": "keyword"
}
}
},
"duration": {
"type": "keyword"
},
"expertiseLevel": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"keyword": {
"type": "keyword"
},
"language": {
"type": "keyword"
},
"learningResourceType": {
"type": "keyword"
},
"license": {
"type": "keyword"
},
"organization": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"qualifications": {
"type": "keyword"
},
"targetGroup": {
"type": "keyword"
},
"title": {
"type": "text"
},
"type": {
"type": "keyword"
},
"url": {
"type": "text"
},
"year": {
"type": "long"
}
}
}