Csv2shex项目

托马斯贝克 Tom墓园.org
Tue Jul14 17:46:58BST2020


全美,我一直在写代码支持表单应用剖面格式[1] -- -- 命令行实用性,配有各种子命令以新格式阅读解析文件(见安装指令[2])。sv2shex命令行获取使用量:csv2shex命令Generate ShEx schemas from tabular (CSV) application profiles      Options:       --version  Show version and exit       --help     Show help and exit      Commands:       csvcheck   Check CSV file structure for anomalies       csvparse   Show CSV file contents       fields     Show built-in CSV column headings       prefixes   Show prefixes, from prefixes.yml if available       yaml2csv   Show YAML file as CSV (for round-tripping?)       yamlparse  Show CSV file contents as YAML  Pointing csv2shex at the most minimal possible profile [3], as with:      csv2shex csvparse absolute_minimal_profile.csv  prints the following:      Shape  start: True  shape_id: @default  Statement      prop_id: dct:title  Statement      prop_id: dct:subject  Statement      prop_id: dct:date  The column labels are a combination of personal preferences ('shape_id'!) and labels that have been trending in our discussion:      [Shape]  start  shape_id  shape_label   [Statement]      prop_id      prop_label      mand      repeat      value_type      value_datatype      constraint_value      constraint_type      shape_ref      annot  If we do decide to go with other labels, it will be easy enough to change them in [4] and the changes will more or less automatically propagate to the rest of the program.程序不要求列按特定顺序排列不论其顺序如何,均应正确剖析程序也不关心单行或句子前二列或一列中是否指定shape_id和shape_labelstart字段实事求是,如果形状为CSV首次发现形状最微值可能的剖面图分配标识符“@default”(尽管很容易修改)。Tom[1]https://github.com/tombaker/csv2shex[2]https://github.com/tombaker/csv2shex/blob/master/README.rst3https://github.com/tombaker/csv2shex/blob/master/example_profiles/absolute_minimal_profile.csv[4]https://github.com/tombaker/csv2shex/blob/master/csv2shex/constants.pyTom Baker <Tom墓园.org>


更多信息应用剖面图邮件列表