Search in sources :

Example 1 with MungeOptions

use of org.wikidata.query.rdf.tool.options.MungeOptions in project wikidata-query-rdf by wikimedia.

the class Munge method main.

/**
 * Run a bulk munge configured from the command line.
 */
@SuppressWarnings("IllegalCatch")
public static void main(String[] args) {
    MungeOptions options = handleOptions(MungeOptions.class, args);
    UrisScheme uris = OptionsUtils.WikibaseOptions.wikibaseUris(options);
    Munger munger = mungerFromOptions(options);
    int chunksize = options.chunkSize();
    if (chunksize < 1) {
        chunksize = Integer.MAX_VALUE;
    }
    try {
        Munge munge = new Munge(uris, munger, CliUtils.reader(options.from()), chunksize, options.to());
        munge.run();
    } catch (Exception e) {
        log.error("Fatal error munging RDF", e);
        System.exit(1);
    }
}
Also used : UrisScheme(org.wikidata.query.rdf.common.uri.UrisScheme) Munger(org.wikidata.query.rdf.tool.rdf.Munger) MungeOptions(org.wikidata.query.rdf.tool.options.MungeOptions) RDFHandlerException(org.openrdf.rio.RDFHandlerException) IOException(java.io.IOException) RDFParseException(org.openrdf.rio.RDFParseException)

Aggregations

IOException (java.io.IOException)1 RDFHandlerException (org.openrdf.rio.RDFHandlerException)1 RDFParseException (org.openrdf.rio.RDFParseException)1 UrisScheme (org.wikidata.query.rdf.common.uri.UrisScheme)1 MungeOptions (org.wikidata.query.rdf.tool.options.MungeOptions)1 Munger (org.wikidata.query.rdf.tool.rdf.Munger)1