All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.unibz.inf.ontop.cli.Ontop Maven / Gradle / Ivy

There is a newer version: 5.2.1.1
Show newest version
package it.unibz.inf.ontop.cli;

import com.github.rvesse.airline.Cli;
import com.github.rvesse.airline.builder.CliBuilder;
import com.github.rvesse.airline.parser.errors.*;


public class Ontop {

    public static void main(String... args) {

        Cli ontopCommandCLI = getOntopCommandCLI();

        OntopCommand command;

        try {
            command = ontopCommandCLI.parse(args);
            command.run();
        } catch (ParseCommandMissingException e) {
            main("help");
        } catch (ParseArgumentsUnexpectedException | ParseOptionMissingException e) {
            System.err.println("Error: " + e.getMessage());
            String commandName = args[0];
            System.err.format("Run `ontop help %s` to see the help for the command `%s`\n", commandName, commandName);
        } catch (ParseException e) {
            System.err.println("Error: " + e.getMessage());
            System.err.println("Run `ontop help` to see the help");
        } catch (Exception e) {
            e.printStackTrace();
            throw new AssertionError();
        }
    }

    static Cli getOntopCommandCLI() {
        //noinspection unchecked
        CliBuilder builder = Cli.builder("ontop")
                .withDescription("Ontop system for Ontology based Data Access")
                .withCommands(
                        /**
                         * visible commands
                         */
                        OntopVersion.class,
                        OntopHelp.class,
                        OntopQuery.class,
                        OntopMaterialize.class,
                        OntopBootstrap.class,
                        OntopValidate.class,
                        OntopEndpoint.class,
                        OntopExtractDBMetadata.class,
                        /**
                         * hidden commands
                         */
                        OntopCompile.class
                );


        builder.withGroup("mapping")
                .withDescription("Manipulate mapping files")
                .withCommand(OntopOBDAToR2RML.class)
                .withCommand(OntopR2RMLToOBDA.class)
                .withCommand(OntopR2RMLPrettify.class)
                .withCommand(OntopMappingV1ToV3.class);

        return builder.build();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy