lot1-kickoff/airflow/dags/EOSC_indexes.py

1096 lines
27 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"
}
}
},
"impact": {
"type": "object",
"properties": {
"citationCount": {
"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": {
"accessRestriction": {
"type": "keyword"
},
"accessTypes": {
"type": "keyword"
},
"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"
}
}
},
"grantProjectNames": {
"type": "text"
},
"helpdeskPage": {
"type": "text"
},
"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"
},
"orderType": {
"type": "keyword"
},
"organization": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"pricing": {
"type": "text"
},
"privacyPolicy": {
"type": "text"
},
"providers": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"relatedPlatforms": {
"type": "keyword"
},
"relatedResources": {
"type": "keyword"
},
"tags": {
"type": "keyword"
},
"keyword": {
"path": "tags",
"type": "alias"
},
"targetUsers": {
"type": "keyword"
},
"termsOfUse": {
"type": "text"
},
"thematic": {
"type": "boolean"
},
"trl": {
"type": "keyword"
},
"type": {
"type": "keyword"
},
"useCases": {
"type": "object",
"properties": {
"useCase": {
"type": "object",
"properties": {
"useCaseName": {
"type": "keyword"
},
"useCaseURL": {
"type": "text"
}
}
}
}
},
"userManual": {
"type": "text"
},
"webpage": {
"type": "text"
},
"year": {
"type": "long"
}
}
}
mappings['interoperability'] = {
"properties": {
"alternativeIdentifiers": {
"type": "object",
"properties": {
"alternativeIdentifier": {
"type": "object",
"properties": {
"type": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
}
}
}
},
"creators": {
"type": "object",
"properties": {
"affiliation": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"familyName": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"fullName": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"givenName": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"type": {
"type": "keyword"
}
}
},
"description": {
"type": "text"
},
"doi": {
"type": "keyword"
},
"domain": {
"type": "object",
"properties": {
"domain": {
"type": "keyword"
},
"subdomain": {
"type": "keyword"
}
}
},
"guidelineType": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"license": {
"type": "keyword"
},
"licenseDetails": {
"type": "object",
"properties": {
"identifier": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uri": {
"type": "text"
}
}
},
"organization": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"provider": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "keyword"
},
"providers": {
"path": "provider",
"type": "alias"
},
"publicationYear": {
"type": "long"
},
"services": {
"type": "object",
"properties": {
"name": {
"type": "keyword"
},
"organization": {
"type": "keyword"
}
}
},
"status": {
"type": "keyword"
},
"title": {
"type": "text"
},
"type": {
"type": "keyword"
}
}
}
mappings['training'] = {
"properties": {
"accessRights": {
"type": "keyword"
},
"alternativeIdentifiers": {
"type": "object",
"properties": {
"alternativeIdentifier": {
"type": "object",
"properties": {
"type": {
"type": "keyword"
},
"value": {
"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"
},
"learningOutcomes": {
"type": "object",
"properties": {
"learningOutcome": {
"type": "text"
}
}
},
"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"
}
}
}