benten metadata_keys

目的

  • メタデータのキーリストの情報を参照します。

Warning

事前にログイン認証を行う必要があります。

利用例

  • Help
$ benten.py metadata_keys -h
usage: benten metadata_keys [-h]

optional arguments:
  -h, --help  show this help message and exit
  • メタデータのキーリストの情報取得
$ benten.py metadata_keys
### benten metadata_keys ###
[Repository::authorize] access_token = 78fb9b529fcc4fbdb6ae2884664f2ba8
==> response
{
    "index_name":"spring8-bl14b2-2020.05.06",
    "list":[
        "@data_info@access_rights",
        "@data_info@additional_metadata",
        "@data_info@class_name",
        "@data_info@contact_name@affiliation@organization",
        "@data_info@contact_name@affiliation@sub_organization",
        "@data_info@contact_name@identifier@ORCID",
        "@data_info@contact_name@identifier@name",
        "@data_info@contact_name@name",
        "@data_info@contact_name@role",
        "@data_info@data_depositor@affiliation@organization",
        "@data_info@data_depositor@affiliation@sub_organization",
        "@data_info@data_depositor@identifier@ORCID",
        "@data_info@data_depositor@identifier@name",
        "@data_info@data_depositor@name",
        "@data_info@data_origin",
        "@data_info@date@create_time",
        "@data_info@date@update_time",
        "@data_info@disk_name",
        "@data_info@facility",
        "@data_info@identifier@doi",
        "@data_info@identifier@others",
        "@data_info@identifier@others.project_id",
        "@data_info@identifier@pid",
        "@data_info@identifier@previous",
        "@data_info@identifier@previous.pid",
        "@data_info@identifier@proposal_number",
        "@data_info@identifier@register_name",
        "@data_info@identifier@related",
        "@data_info@identifier@related.pid",
        "@data_info@license@name",
        "@data_info@title",
        "@data_info@title_ja",
        "@data_info@version@data_format",
        "@dataset@directory_list",
        "@dataset@directory_list.caption",
        "@dataset@directory_list.file_list",
        "@dataset@directory_list.file_list.caption",
        "@dataset@directory_list.file_list.format",
        "@dataset@directory_list.file_list.hash",
        "@dataset@directory_list.file_list.name",
        "@dataset@directory_list.file_list.size",
        "@dataset@directory_list.file_list.time",
        "@dataset@directory_list.file_list.uuid_name",
        "@dataset@directory_list.name",
        "@dataset@directory_list.time",
        "@dataset@directory_list.uuid_name",
        "@dataset@file_caption_list",
        "@dataset@file_format_list",
        "@facility@ring@end_current",
        "@facility@ring@end_current_unit",
        "@facility@ring@energy",
        "@facility@ring@energy_unit",
        "@facility@ring@filling_pattern",
        "@facility@ring@filling_pattern_mode",
        "@facility@ring@start_current",
        "@facility@ring@start_current_unit",
        "@instrument@analyzer@dwell_time",
        "@instrument@analyzer@dwell_time_unit",
        "@instrument@analyzer@pass_energy",
        "@instrument@analyzer@pass_energy_unit",
        "@instrument@counter",
        "@instrument@counter@integral_time",
        "@instrument@counter@integral_time_unit",
        "@instrument@counter@model",
        "@instrument@monochrometer@distance",
        "@instrument@monochrometer@distance_unit",
        "@instrument@monochrometer@net_plane",
        "@instrument@monochrometer@section",
        "@instrument@monochrometer@section.dwell_time",
        "@instrument@monochrometer@section.dwell_time_unit",
        "@instrument@monochrometer@section.end_energy",
        "@instrument@monochrometer@section.end_energy_unit",
        "@instrument@monochrometer@section.start_energy",
        "@instrument@monochrometer@section.start_energy_unit",
        "@instrument@monochrometer@section.step_energy",
        "@instrument@monochrometer@section.step_energy_unit",
        "@instrument@slit",
        "@instrument@slit.horizontal_size",
        "@instrument@slit.horizontal_size_unit",
        "@instrument@slit.name",
        "@instrument@slit.vertical_size",
        "@instrument@slit.vertical_size_unit",
        "@instrument@xafs@I0@element",
        "@instrument@xafs@I0@element.HV",
        "@instrument@xafs@I0@element.HV_unit",
        "@instrument@xafs@I0@element.additional_metadata",
        "@instrument@xafs@I0@element.amp_gain",
        "@instrument@xafs@I0@element.amp_gain_unit",
        "@instrument@xafs@I0@element.gas",
        "@instrument@xafs@I0@element.type",
        "@instrument@xafs@I0@element_number",
        "@instrument@xafs@I1@element",
        "@instrument@xafs@I1@element.HV",
        "@instrument@xafs@I1@element.HV_unit",
        "@instrument@xafs@I1@element.additional_metadata",
        "@instrument@xafs@I1@element.amp_gain",
        "@instrument@xafs@I1@element.amp_gain_unit",
        "@instrument@xafs@I1@element.gas",
        "@instrument@xafs@I1@element.type",
        "@instrument@xafs@I1@element_number",
        "@instrument@xafs@I2@element",
        "@instrument@xafs@I2@element.HV",
        "@instrument@xafs@I2@element.HV_unit",
        "@instrument@xafs@I2@element.additional_metadata",
        "@instrument@xafs@I2@element.amp_gain",
        "@instrument@xafs@I2@element.amp_gain_unit",
        "@instrument@xafs@I2@element.gas",
        "@instrument@xafs@I2@element.type",
        "@instrument@xafs@I2@element_number",
        "@measurement@atmosphare@sample@end_temperature_unit",
        "@measurement@atmosphere@sample@end_temperature",
        "@measurement@atmosphere@sample@gas",
        "@measurement@atmosphere@sample@start_temperature",
        "@measurement@atmosphere@sample@start_temperature_unit",
        "@measurement@date@end_time",
        "@measurement@date@start_time",
        "@measurement@holder_number",
        "@measurement@incident_photon@angle",
        "@measurement@incident_photon@angle_unit",
        "@measurement@incident_photon@energy",
        "@measurement@incident_photon@energy_unit",
        "@measurement@method@absorption_edge",
        "@measurement@method@category",
        "@measurement@method@detection",
        "@measurement@method@sub_category",
        "@measurement@number",
        "@measurement@photoelectron@energy_scale",
        "@measurement@photoelectron@spectral_line",
        "@measurement@photoelectron@spectral_line.element",
        "@measurement@photoelectron@spectral_line.name",
        "@measurement@photoelectron@take_off_angle",
        "@measurement@photoelectron@take_off_angle_unit",
        "@measurement@run_number",
        "@measurement@scan_mode",
        "@sample",
        "@sample.additional_metadata",
        "@sample.chemical_formula",
        "@sample.element",
        "@sample.element.name",
        "@sample.element.suffix",
        "@sample.lot_number",
        "@sample.model_number",
        "@sample.name",
        "@sample.supplier",
        "@sample.tag",
        "@system@parent_directory",
        "@system@uuid_register_directory",
        "@system@version@agent",
        "@system@version@data_register",
        "@system@version@metadata"
    ]
}

Pythonモジュールとの対応

  • 利用例 (example/benten_metadata_keys.pyから)
#!/usr/bin/env python
'''
  example: metadata_keys

  usage: python benten_metadata_keys.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_keys")

args = parser.parse_args()

repo = benten_client.Repository() 

logger.debug("# set access token")

repo.authorize(benten_client.access_token())

logger.debug("# benten metadata_keys")

ret_dict = repo.metadata.keys.post()

benten_client.log("==> response")
benten_client.out_json(ret_dict)