- Notifications
You must be signed in to change notification settings - Fork0
A Leiningen plugin for Grafter Pipelines
License
Swirrl/lein-grafter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
NOTE: This project is deprecated after grafter.pipelines was removed fromgrafter and grafter.tabular.
It should still be usable in grafter versions prior to 0.8.12.
Adds some convenient commandline tools for listing and runningpipelines in a grafter project.
Put the following into the:plugins
vector of your grafter projectsproject.clj
e.g.
:plugins [[lein-grafter"0.3.0"]]
Once this is done the following command line features will becomeavailable:
Then inside a grafter pipeline that defines some pipelines withdefpipe
and/ordefgraft
you can list pipelines like this:
$ lein grafter listtest-project.pipeline/convert-persons-data data-file ;; An example pipeline tabular pipelinetest-project.pipeline/convert-persons-data-to-graph data-file ;; A pipeline generating linked data
You can run the pipelines with the commandlein grafter run
. Pipe'sexposed withdefpipe
yield tabular output and can be used to convertthe file into csv, xls or xlsx (Excel formats) by for example running.Note how grafter infers the format from the output files fileextension.
$ lein grafter run test-project.pipeline/convert-persons-data ./data/example-data.csv example-output.csv$ lein grafter run test-project.pipeline/convert-persons-data ./data/example-data.csv example-output.xlsx$ lein grafter run test-project.pipeline/convert-persons-data ./data/example-data.csv example-output.xls
To output linked data (RDF) you must call a graft (a pipeline thatconvertstabular data -> linked data
). Like withdefpipe
graftsmust be exposed to the plugin withdefgraft
.
They can be run in the same way as pipes e.g to output linked data asturtle:
$ lein grafter run test-project.pipeline/convert-persons-data-to-graph ./data/example-data.csv example-output.ttl
... or as n-triples:
$ lein grafter run test-project.pipeline/convert-persons-data-to-graph ./data/example-data.csv example-output.nt
Supported formats for triples and their file extensions are:
- n-triples
.nt
- turtle
.ttl
- n3
.n3
- rdf xml
.rdf
Supported formats for quads and their file extensions are:
- n-quads
.nq
- trig
.trig
- trix
.trix
Copyright © 2014 Swirrl IT Ltd
Distributed under the Eclipse Public License either version 1.0 or (atyour option) any later version.
About
A Leiningen plugin for Grafter Pipelines