NAME
PMLTQ::Commands - PMLTQ command line interface
VERSION
version 1.1.0
SYNOPSIS
Usage: pmltq COMMAND [OPTIONS]
pmltq version
pmltq init schema1.xml schema2.xml
pmltq convert
pmltq load
Options (for all commands):
-c, --config Config file, by default commands will look
for config file called C<pmltq.yml> in the
current directory.
COMMANDS
These commands are available by default.
convert
$ pmltq convert
Uses PMLTQ::Command::covert to convert data in the data_dir
based on layers configuration
delete
$ pmltq delete
Uses PMLTQ::Command::delete to delete the database for current treebank
init
$ pmltq init resources/schema1.xml resources/schema2.xml
Uses PMLTQ::Command::init to generate initial configuration file skeleton based on given schemas. This command can help you quickly bootstrap the layers configuration
initdb
$ pmltq initdb
Uses PMLTQ::Command::initdb to create and initialize new database for given treebank
load
$ pmltq load
Uses PMLTQ::Command::load to load the data generated by convert
command
query
Uses PMLTQ::Command::query to run a query on given treebank. Currently doesn't work
verify
Uses PMLTQ::Command::verify to check if database exists and contains some data. For now the checking is very simple
version
Uses PMLTQ::Command::version to display current PMLTQ version
CONFIG FILE
Options
treebank_id
-
ID of the treebank. Can contain only [a-zA-Z0-9_]. It will be default for the database name.
data_dir
-
Directory where the data are (this is also base directory for data layers)
Defaults: data
resources
-
Base directory for PML schemas
Defaults: resources
output_dir
-
Directory for all sql dump files. The files generated by
convert
and used byload
commandDefaults: sql_dump
db
sys_db
-
Name of the 'system database' used for administration commands such as
CREATE
andDROP
. layers
-
The configuration of treebank's layers and references for each layer.
name
-
Schema root name
data
-
A
glob
path name matching pattern relative todata_dir
-
List of related schemas that contain node types required in this layer's reference configuration
references
-
This is key-value hash where key is path to the member of the node structure and value is node type or '-' (dash) if you intend to ignore that particular reference. If the node type is not in the current layer schema you have to prefix node type with the schema name and the appropriate schema have to be listed in
related-schema
list.Examples:
references: path/attr1: '-' #--> ignore this reference path/attr2: ref-node #--> reference node type 'ref-node' path/attr3: schema:other-node #--> reference node type 'other-node' in schema 'schema'
Change values using CLI
You can use command line parameters to modify any configuration options.
For example you can use
pmltq load --output_dir='/some/path' --data_dir='some/other/path' --db-name='abc'
Dash -
in the parameter's name means dive into the hash, so --db-name='abc'
is going to change db: name: 'abc'
while --db_name='abc'
would just set configuration option db_name: 'abc'
.
Example:
data_dir: /pmltq/data/dir/ # directory where the data are (this is also base directory for data layers)
resources: /pmltq/resources/ # main directory with PML schemas
db: # typical DB auth stuff
name: treebank_db_name
host: localhost
port: 5432
user: pmltq
password: pwd
layers: # description of all data layers
- name: adata
data: ./relative/to/data_dir/**/*.a.gz
related-schema:
- adata_schema.xml
references:
t-node/val_frame.rf: '-'
t-a/aux.rf: 'adata:a-node'
t-node/coref_gram.rf: t-node
- name: tdata
data: **/*.t.gz
AUTHORS
Petr Pajas <pajas@ufal.mff.cuni.cz>
Jan Štěpánek <stepanek@ufal.mff.cuni.cz>
Michal Sedlák <sedlak@ufal.mff.cuni.cz>
Matyáš Kopp <matyas.kopp@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Institute of Formal and Applied Linguistics (http://ufal.mff.cuni.cz).
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.