Search in sources :

Example 1 with SPARQL_QueryGeneral

use of org.apache.jena.fuseki.servlets.SPARQL_QueryGeneral in project jena by apache.

the class FusekiMain method buildServer.

private static FusekiServer buildServer(FusekiServer.Builder builder, ServerConfig serverConfig) {
    if (serverConfig.jettyConfigFile != null)
        builder.jettyServerConfig(serverConfig.jettyConfigFile);
    builder.port(serverConfig.port);
    builder.loopback(serverConfig.loopback);
    builder.verbose(serverConfig.verboseLogging);
    if (serverConfig.addGeneral != null)
        // Add SPARQL_QueryGeneral as a general servlet, not reached by the service router.
        builder.addServlet(serverConfig.addGeneral, new SPARQL_QueryGeneral());
    if (serverConfig.validators) {
        // Validators.
        builder.addServlet("/$/validate/query", new QueryValidator());
        builder.addServlet("/$/validate/update", new UpdateValidator());
        builder.addServlet("/$/validate/iri", new IRIValidator());
        builder.addServlet("/$/validate/data", new DataValidator());
    }
    if (!serverConfig.empty) {
        if (serverConfig.serverConfig != null)
            // Config file.
            builder.parseConfigFile(serverConfig.serverConfig);
        else
            // One dataset.
            builder.add(serverConfig.datasetPath, serverConfig.dsg, serverConfig.allowUpdate);
    }
    if (serverConfig.contentDirectory != null)
        builder.staticFileBase(serverConfig.contentDirectory);
    if (serverConfig.passwdFile != null)
        builder.passwordFile(serverConfig.passwdFile);
    if (serverConfig.realm != null)
        builder.realm(serverConfig.realm);
    if (serverConfig.httpsKeysDetails != null)
        builder.https(serverConfig.httpsPort, serverConfig.httpsKeysDetails);
    if (serverConfig.authScheme != null)
        builder.auth(serverConfig.authScheme);
    if (serverConfig.withCORS)
        builder.enableCors(true);
    if (serverConfig.withPing)
        builder.enablePing(true);
    if (serverConfig.withStats)
        builder.enableStats(true);
    if (serverConfig.withMetrics)
        builder.enableMetrics(true);
    if (serverConfig.withCompact)
        builder.enableCompact(true);
    return builder.build();
}
Also used : IRIValidator(org.apache.jena.fuseki.validation.IRIValidator) QueryValidator(org.apache.jena.fuseki.validation.QueryValidator) SPARQL_QueryGeneral(org.apache.jena.fuseki.servlets.SPARQL_QueryGeneral) DataValidator(org.apache.jena.fuseki.validation.DataValidator) UpdateValidator(org.apache.jena.fuseki.validation.UpdateValidator)

Aggregations

SPARQL_QueryGeneral (org.apache.jena.fuseki.servlets.SPARQL_QueryGeneral)1 DataValidator (org.apache.jena.fuseki.validation.DataValidator)1 IRIValidator (org.apache.jena.fuseki.validation.IRIValidator)1 QueryValidator (org.apache.jena.fuseki.validation.QueryValidator)1 UpdateValidator (org.apache.jena.fuseki.validation.UpdateValidator)1