-
Notifications
You must be signed in to change notification settings - Fork 0
Validator API
okbp edited this page Mar 19, 2017
·
9 revisions
##共通
###エラーメッセージ仕様(JSONフォーマット)
[
{
"id":【ルールNo】,
"message":【エラーメッセージ(個別表示用)】,
"reference": 【参考URLの配列】,
"level":【エラーレベル(error|warning)】,
"method":【validatorの種類(biosample_validator)】,
"source":【入力データ(ファイルパス)】,
"annotation": [ //エラー詳細
{
"key":【項目名1】,
"value": "値"
},
{
"key":【項目名2】,
"value": "値"
},
{
"key":【項目名3】,
"value": "値"
},
{ //suggest or auto-annotation
"key":【項目名4】,
"is_suggest": true, //suggestの場合. "is_auto_correct"との併用はない
"is_auto_annotation": true, //auto-annotationの場合. "is_suggest"との併用はない
"value":【候補値のリスト】, //何個か候補がある場合もあるため配列
"target_key":【項目名】, //どの項目の値を修正するか
"location":【targetのlocation(XPath, lineNo + columnNo)】//複数箇所を同時に直すケースがあるため配列
}
]
},
{
}
]
(例)
[
{
"id": "5",
"message": "Invalid BioProject accession. Please provide a valid BioProject accession with format PRJ[D|E|N]xxxxxx or PSUBxxxxxx",
"reference": ["http://trace.ddbj.nig.ac.jp/biosample/attribute.html?all=all#bioproject_id"],
"level": "error",
"method": "biosample_validator",
"source": "/data/SSUB000019.xml",
"annotation": [
{
"key": "Sample name",
"value": "DRS012893"
},
{
"key": "Attribute",
"value": "bioproject_id"
},
{
"key": "Attribute value",
"value": "PSUB000001"
},
{
"key": "Suggested value",
"value": ["PRJD000001"],
"is_auto_annotation": true,
"target_key": "Attribute value",
"location": ["//BioSample[2]/Attributes/Attribute[@attribute_name=\"bioproject_id\"]"]
}
]
}
]
##BioSample Validator
biosample_validator.rb <xml_file_path> <format> <output_file_path> <mode>
xml_file_path: バリデーション対象ファイルのパス
format: 対象ファイルのフォーマット(xml,json,csv...)
output_file_path: バリデーション結果ファイルのパス
mode(private | public): publicの場合にはDDBJ databaseへアクセスするバリデーションを実行しない
bioprojectの場合
bioproject_validator.rb <xml_file_path> <format> <output_file_path> <mode>
DRAの場合
dra_validator.rb <xml_file_path> <format> <output_file_path> <mode>
(例)
biosample_validator.rb /data/SSUB000019.xml xml /data/SSUB000019_result.xml private
{
"status": "success",
"format": "xml"
}
{
"status": "fail",
"format": "xml",
"failed_list": [Validationエラーメッセージのリスト]
}
{
"status": "error",
"format": "xml",
"message": "エラー理由等のメッセージ"
}
##Annotated Sequence Validator