/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.neptune.csv2rdf;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;
import java.util.concurrent.Callable;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.IVersionProvider;
import picocli.CommandLine.Option;
/**
*
* Main class for running the CSV to RDF conversion. If an expected problem
* occurs during the process, a message helping the user to fix it is printed to
* the console and logged. Other exceptions are logged and a general message is
* printed to the console.
* The CSV to RDF conversion is started by calling {@link Csv2Rdf#main}.
*
*/
@Slf4j
@Command(name = "java -jar amazon-neptune-csv2rdf.jar", header = { "*** Amazon Neptune CSV to RDF Converter ***",
"A tool for Amazon Neptune that converts property graphs stored as comma separated values into RDF graphs." }, footer = {
"Fork me on GitHub: https://github.com/aws/amazon-neptune-csv-to-rdf-converter",
"Licensed under Apache License, Version 2.0: https://aws.amazon.com/apache2.0",
"Copyright Amazon.com Inc. or its affiliates. All Rights Reserved." }, usageHelpAutoWidth = true, mixinStandardHelpOptions = true, versionProvider = Csv2Rdf.MavenVersionProvider.class)
public class Csv2Rdf implements Callable {
// Name of the log file must match the configuration in log4j2.xml.
private static final String LOG_FILE = "amazon-neptune-csv2rdf.log";
private static final String VERSION_RESOURCE = "/amazon-neptune-csv2rdf-version.txt";
private static final String PARAM_LABEL_CONFIGURATION_FILE = "";
private static final String PARAM_LABEL_INPUT_DIRECTORY = "";
private static final String PARAM_LABEL_OUTPUT_DIRECTORY = "