OR2YW工具

or2ywtool的Python项目详细描述


或2ywtool

Openrefine到Yesworkflow模型工具

openrefine to yesworkflow model(or2yw)工具包存储库包含or2yw examples文件夹,其中使用Ecologic_啮齿动物数据集和nypl(纽约公共图书馆)菜单数据集作为示例。

Yesworkflow

Openrefine

概述

该工具旨在提供从openrefine操作历史json文件到yesworklfow模型的自动解析方法。我们知道,openrefine操作历史json文件作为一个数据争用工作流工作但是,工作流的结构不够透明,无法了解列操作的依赖性和独立性。通过yw模型,将openrefine操作分为模式级和列级两个层次。

1.回购结构

1.1或2yw_示例

folderDescription
Ecology_rodentsPortal_rodents_19772002_scinameUUIDs.csv
NYPLWhat's on the Menu?

以nypl文件夹为例:

folderFunction
dataset"messy dataset"
facts"File for storing prolog facts about scripts"
gvSave the DOT output to a file
pdfRender gv file as PDF file using Graphviz's dot command
pngRender gv file as PNG file using Graphviz's dot command
resultsScreenshot the models
scriptAuto-parsing file: Linear/Serial-Parallell and the Openrefine json file
ywThe parsed yw comments
yw.propertiesyw settings for graph(yw) command
yw_generate.shcheatsheet command

1.2或2ywtool

该工具旨在将json格式的openrefine recipe与yesworkflow连接起来,生成并行和串行的概念模型。通过这种方式,可以清楚地显示每个数据清理步骤之间的依赖关系。

2.工具包的使用

  1. Python版本:3+

从pip install安装or2yw软件包:

   $ pip  install or2ywtool

(注意:仔细检查pip版本,如果pip是针对版本2的,则使用pip3安装…) 如果要升级or2ywtool的版本

   $ pip install upgrade or2ywtool
  1. 成功安装or2yw工具后,有两种方法可以使用该工具。

2.1生成yw文件,复制并粘贴到yesworkflow编辑器(无需安装其他依赖包)

   $ or2yw
     usage: __main__.py [-h] [-i INPUT] [-o OUTPUT] [-t TYPE] [-ot OUTPUTTYPE]
               [-j JAVA] [-dot DOT] [-title TITLE] [-desc DESCRIPTION]

      OR2YW v0.0.1

      optional arguments:
        -h, --help            show this help message and exit
        -i INPUT, --input INPUT
                              openrefine json file
        -o OUTPUT, --output OUTPUT
                              yesworkflow output file
        -t TYPE, --type TYPE  Workflow Type, Produce [serial,parallel] workflow,
                              Default: serial
        -ot OUTPUTTYPE, --outputtype OUTPUTTYPE
                              Output Type, Produce output [yw,gv,png,svg,pdf],
                              Default: yw (only yw for now other file type will
                              available in the next release)
        -j JAVA, --java JAVA  Java Path, if not initialized will use the java
                              installation environment path
        -dot DOT, --dot DOT   Dot Path, if not initialized will use the dot
                              installation environment path
        -title TITLE, --title TITLE
                              Title for the Workflow
        -desc DESCRIPTION, --description DESCRIPTION
                              Description for the Workflow

a.生成序列yw文件:

   $ or2yw -i or2ywtool/test.json -o test.yw

b.生成并行yw文件:

   $ or2yw -i or2ywtool/test.json -o test.yw -t parallel

c.测试Yesworkflow编辑器:Yesworkflow

2.2使用工具生成pdf/png(**需要Graphviz安装)

a.检查Graphviz版本:

 $ dot -V 
 dot - graphviz version 2.39.20160823.1445 (20160823.1445)
libdir = "/usr/local/lib/graphviz"
Activated plugin library: libgvplugin_dot_layout.6.dylib
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.6.dylib
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
  /usr/local/lib/graphviz/config6
    was successfully loaded.
    render	:  dot dot_json fig json json0 map mp pic pov ps quartz svg tk vml xdot xdot_json
    layout	:  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout	:  textlayout
    device	:  bmp canon cgimage cmap cmapx cmapx_np dot dot_json eps exr fig gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg json json0 mp pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz xdot xdot1.2 xdot1.4 xdot_json
    loadimage	:  (lib) bmp eps gif jpe jpeg jpg pdf png ps svg

**请检查您的点信息,可能会出现以下问题:“格式:pdf/png无法识别…”,然后确保设备可以支持此处的格式

b.安装最新版本Download Graphviz

1)。对于Mac用户(例如使用自制):

$ brew install graphviz

(第二章)。对于windows用户,请从download网站中选择一种方法

(第三章)对于Linux用户,请从download网站中选择一种方法

c.如果无法识别格式:

d.使用命令生成yesworkflow pdf/png文件(将json文件插入正确的路径,并输入文件名):

例1。生成**并行Yesworkflow模型pdf文件:

$ or2yw -i or2ywtool/test.json -o testa.pdf -ot pdf -t parallel

例2生成**并行Yesworkflow模型PNG文件:

$ or2yw -i or2ywtool/test.json -o testa.png -ot png -t parallel

例3生成**线性Yesworkflow模型PDF文件:

$ or2yw -i or2ywtool/test.json -o testa.pdf -ot pdf

例4。生成**线性Yesworkflow模型PNG文件:

$ or2yw -i or2ywtool/test.json -o testa.png -ot png

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用jaxrpc的Java eclipse WebService客户端   java编程方式在对象上写入名称   java Spring批处理:重试后跳过   java Android错误:错误:任务执行失败:应用程序:transformClassesWithDexForDebug'   带有清单文件nullPointerException的java Android元数据   spring Java Quartz调度作业停止运行   JavaMockito:如何在不调用实际方法的情况下,模拟带有参数和无效返回类型的静态方法?   java Tomcat连接池问题无法在关闭的连接上调用方法   java如何交换列表中的项目?   java如何停止线程并通过Toast在线程中正确显示文本?   java为什么连续写入OutputStream时偏移量0不会导致重复字节?   java我无法生成头文件   不兼容的返回类型错误java   修改值后键值对的java Jolt转换规范   java有自动更新Javadoc的工具吗?   java线程如何在ints自身实例类中共享变量   java继承一个非gwt模块   java Hibernate xml配置   使用netty4异步调用的java链接HTTP请求响应