benten metadata_mappings
目的
- メタデータのマッピング情報を参照します。
Warning
事前にログイン認証を行う必要があります。
利用例
- Help
$ benten.py metadata_mappings -h usage: benten metadata_mappings [-h] [--index_name [INDEX_NAME]] [--facility [FACILITY]] [--division_name [DIVISION_NAME]] optional arguments: -h, --help show this help message and exit --index_name [INDEX_NAME], -i [INDEX_NAME] index_name --facility [FACILITY], -f [FACILITY] facility --division_name [DIVISION_NAME], -d [DIVISION_NAME] division_name
- メタデータのマッピング情報取得
$ benten.py ### benten metadata_mappings ### [Repository::authorize] access_token = 78fb9b529fcc4fbdb6ae2884664f2ba8 ==> response { "index_name":"spring8-bl14b2-2020.05.06", "properties":{ "@data_info@access_rights":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@additional_metadata":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@data_info@class_name":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@contact_name@affiliation@organization":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@contact_name@affiliation@sub_organization":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@contact_name@identifier@ORCID":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@contact_name@identifier@name":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@contact_name@name":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@contact_name@role":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@data_depositor@affiliation@organization":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@data_depositor@affiliation@sub_organization":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@data_depositor@identifier@ORCID":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@data_depositor@identifier@name":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@data_depositor@name":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@data_info@data_origin":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@date@create_time":{ "type":"date", "format":"yyyy-MM-dd HH:mm:ss||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd||yyyy/MM/dd||strict_date_optional_time||epoch_millis" }, "@data_info@date@update_time":{ "type":"date", "format":"yyyy-MM-dd HH:mm:ss||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd||yyyy/MM/dd||strict_date_optional_time||epoch_millis" }, "@data_info@disk_name":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@facility":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@identifier@doi":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@identifier@others":{ "type":"nested", "include_in_parent":true, "properties":{ "project_id":{ "type":"keyword", "copy_to":[ "sel" ] } } }, "@data_info@identifier@pid":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@identifier@previous":{ "type":"nested", "include_in_parent":true, "properties":{ "pid":{ "type":"keyword", "copy_to":[ "sel" ] } } }, "@data_info@identifier@proposal_number":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@identifier@register_name":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@identifier@related":{ "type":"nested", "include_in_parent":true, "properties":{ "pid":{ "type":"keyword", "copy_to":[ "sel" ] } } }, "@data_info@license@name":{ "type":"keyword", "copy_to":[ "sel" ] }, "@data_info@title":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@data_info@title_ja":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@data_info@version@data_format":{ "type":"keyword", "copy_to":[ "sel" ] }, "@dataset@directory_list":{ "type":"nested", "include_in_parent":true, "properties":{ "caption":{ "type":"text", "analyzer":"kuromoji_analyzer" }, "file_list":{ "type":"nested", "include_in_parent":true, "properties":{ "caption":{ "type":"text", "analyzer":"kuromoji_analyzer" }, "format":{ "type":"keyword" }, "hash":{ "type":"keyword" }, "name":{ "type":"keyword" }, "size":{ "type":"long" }, "time":{ "type":"date", "format":"yyyy-MM-dd HH:mm:ss||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd||yyyy/MM/dd||strict_date_optional_time||epoch_millis" }, "uuid_name":{ "type":"keyword" } } }, "name":{ "type":"keyword" }, "time":{ "type":"date", "format":"yyyy-MM-dd HH:mm:ss||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd||yyyy/MM/dd||strict_date_optional_time||epoch_millis" }, "uuid_name":{ "type":"keyword" } } }, "@dataset@file_caption_list":{ "type":"text" }, "@dataset@file_format_list":{ "type":"text" }, "@facility@ring@end_current":{ "type":"double" }, "@facility@ring@end_current_unit":{ "type":"keyword" }, "@facility@ring@energy":{ "type":"double" }, "@facility@ring@energy_unit":{ "type":"keyword" }, "@facility@ring@filling_pattern":{ "type":"keyword", "copy_to":[ "sel" ] }, "@facility@ring@filling_pattern_mode":{ "type":"keyword", "copy_to":[ "sel" ] }, "@facility@ring@start_current":{ "type":"double" }, "@facility@ring@start_current_unit":{ "type":"keyword" }, "@instrument@analyzer@dwell_time":{ "type":"double" }, "@instrument@analyzer@dwell_time_unit":{ "type":"keyword" }, "@instrument@analyzer@pass_energy":{ "type":"double" }, "@instrument@analyzer@pass_energy_unit":{ "type":"keyword" }, "@instrument@counter":{ "type":"text" }, "@instrument@counter@integral_time":{ "type":"double" }, "@instrument@counter@integral_time_unit":{ "type":"keyword" }, "@instrument@counter@model":{ "type":"keyword", "copy_to":[ "sel" ] }, "@instrument@monochrometer@distance":{ "type":"double" }, "@instrument@monochrometer@distance_unit":{ "type":"keyword" }, "@instrument@monochrometer@net_plane":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@instrument@monochrometer@section":{ "type":"nested", "include_in_parent":true, "properties":{ "dwell_time":{ "type":"double" }, "dwell_time_unit":{ "type":"keyword" }, "end_energy":{ "type":"double" }, "end_energy_unit":{ "type":"keyword" }, "start_energy":{ "type":"double" }, "start_energy_unit":{ "type":"keyword" }, "step_energy":{ "type":"double" }, "step_energy_unit":{ "type":"keyword" } } }, "@instrument@slit":{ "type":"nested", "include_in_parent":true, "properties":{ "horizontal_size":{ "type":"double" }, "horizontal_size_unit":{ "type":"keyword" }, "name":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "vertical_size":{ "type":"double" }, "vertical_size_unit":{ "type":"keyword" } } }, "@instrument@xafs@I0@element":{ "type":"nested", "include_in_parent":true, "properties":{ "HV":{ "type":"double" }, "HV_unit":{ "type":"keyword" }, "additional_metadata":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "amp_gain":{ "type":"double" }, "amp_gain_unit":{ "type":"keyword" }, "gas":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "type":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" } } }, "@instrument@xafs@I0@element_number":{ "type":"integer" }, "@instrument@xafs@I1@element":{ "type":"nested", "include_in_parent":true, "properties":{ "HV":{ "type":"double" }, "HV_unit":{ "type":"keyword" }, "additional_metadata":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "amp_gain":{ "type":"double" }, "amp_gain_unit":{ "type":"keyword" }, "gas":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "type":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" } } }, "@instrument@xafs@I1@element_number":{ "type":"integer" }, "@instrument@xafs@I2@element":{ "type":"nested", "include_in_parent":true, "properties":{ "HV":{ "type":"double" }, "HV_unit":{ "type":"keyword" }, "additional_metadata":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "amp_gain":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "amp_gain_unit":{ "type":"keyword" }, "gas":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "type":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" } } }, "@instrument@xafs@I2@element_number":{ "type":"integer" }, "@measurement@atmosphare@sample@end_temperature_unit":{ "type":"keyword" }, "@measurement@atmosphere@sample@end_temperature":{ "type":"double" }, "@measurement@atmosphere@sample@gas":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@measurement@atmosphere@sample@start_temperature":{ "type":"double" }, "@measurement@atmosphere@sample@start_temperature_unit":{ "type":"keyword" }, "@measurement@date@end_time":{ "type":"date", "format":"yyyy-MM-dd HH:mm:ss||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd||yyyy/MM/dd||strict_date_optional_time||epoch_millis" }, "@measurement@date@start_time":{ "type":"date", "format":"yyyy-MM-dd HH:mm:ss||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd||yyyy/MM/dd||strict_date_optional_time||epoch_millis" }, "@measurement@holder_number":{ "type":"integer" }, "@measurement@incident_photon@angle":{ "type":"double" }, "@measurement@incident_photon@angle_unit":{ "type":"keyword" }, "@measurement@incident_photon@energy":{ "type":"double" }, "@measurement@incident_photon@energy_unit":{ "type":"keyword" }, "@measurement@method@absorption_edge":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@measurement@method@category":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@measurement@method@detection":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@measurement@method@sub_category":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@measurement@number":{ "type":"integer" }, "@measurement@photoelectron@energy_scale":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@measurement@photoelectron@spectral_line":{ "type":"nested", "include_in_parent":true, "properties":{ "element":{ "type":"keyword", "copy_to":[ "sel" ] }, "name":{ "type":"keyword", "copy_to":[ "sel" ] } } }, "@measurement@photoelectron@take_off_angle":{ "type":"double" }, "@measurement@photoelectron@take_off_angle_unit":{ "type":"keyword" }, "@measurement@run_number":{ "type":"integer" }, "@measurement@scan_mode":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "@sample":{ "type":"nested", "include_in_parent":true, "properties":{ "additional_metadata":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "chemical_formula":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "element":{ "type":"nested", "include_in_parent":true, "properties":{ "name":{ "type":"keyword", "copy_to":[ "sel" ] }, "suffix":{ "type":"keyword", "copy_to":[ "sel" ] } } }, "lot_number":{ "type":"keyword", "copy_to":[ "sel" ] }, "model_number":{ "type":"keyword", "copy_to":[ "sel" ] }, "name":{ "type":"text", "copy_to":[ "sel" ], "analyzer":"kuromoji_analyzer" }, "supplier":{ "type":"keyword", "copy_to":[ "sel" ] }, "tag":{ "type":"keyword", "copy_to":[ "sel" ] } } }, "@system@parent_directory":{ "type":"keyword" }, "@system@uuid_register_directory":{ "type":"keyword" }, "@system@version@agent":{ "type":"keyword" }, "@system@version@data_register":{ "type":"keyword" }, "@system@version@metadata":{ "type":"keyword" }, "sel":{ "type":"text", "analyzer":"kuromoji_analyzer" } } }
Pythonモジュールとの対応
- 利用例 (example/benten_metadata_mappings.pyから)
#!/usr/bin/env python ''' example: metadata_mappings usage: python benten_metadata_mappings.py ... ''' import benten_client import argparse from logging import getLogger, StreamHandler, DEBUG logger = getLogger(__name__) handler = StreamHandler() handler.setLevel(DEBUG) logger.setLevel(DEBUG) logger.addHandler(handler) logger.propagate = False # ... parameters parser = argparse.ArgumentParser(description="example: metadata_mappings") parser.add_argument("--index_name", "-i", nargs="?", help="index_name") parser.add_argument("--facility", "-f", nargs="?", help="facility") parser.add_argument("--division_name", "-d", nargs="?", help="division_name") args = parser.parse_args() index_name = args.index_name facility = args.facility division_name = args.division_name v = {} if index_name is not None: v["index_name"] = index_name if facility is not None: v["facility"] = facility if division_name is not None: v["division_name"] = division_name repo = benten_client.Repository() logger.debug("# set access token") repo.authorize(benten_client.access_token()) logger.debug("# benten metadata_mappings") ret_dict = repo.metadata.mappings.post(**v) benten_client.log("==> response") benten_client.out_json(ret_dict)