Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend-Config-Key-Typo: "PostgreSQL", (Expected: "PostgreSQL", got: "Postgresql") #70

Open
j0nxn opened this issue May 29, 2017 · 1 comment

Comments

@j0nxn
Copy link

j0nxn commented May 29, 2017

Die Backendkonfiguration für PostgreSQL wird in der SqlBackendRegistry in der Konfigurations-Map in Zeile 34 mit dem Key "Postgresql" hinterlegt:

/* Sparqlify/sparqlify-core/src/main/java/org/aksw/sparqlify/util/SqlBackendRegistry.java: Zeilen 29ff. */
public static final String HIVE = "Apache Hive";
    public static final String POSTGRES = "Postgresql";
    
    public static void init(Map<String, SqlBackendConfig> map) {
        map.put(HIVE, new SqlBackendConfig(new DatatypeToStringCast(), new SqlEscaperBacktick()));
        map.put(POSTGRES, new SqlBackendConfig(new DatatypeToStringPostgres(), new SqlEscaperDoubleQuote()));        
    }
/* ... */

Der erwartete Key lautet aber "PostgreSQL", der so vom JDBC über die Datenbankmetadaten übergeben wird:

/* Sparqlify/sparqlify-cli/src/main/java/org/aksw/sparqlify/web/Main.java: Zeilen 199ff. */
        Connection conn = dataSource.getConnection();

        DatabaseMetaData dbMeta = conn.getMetaData();
        String dbProductName = dbMeta.getDatabaseProductName();
        logger.info("Database product: " + dbProductName);

        SqlBackendRegistry backendRegistry = SqlBackendRegistry.get();
        Map<String, SqlBackendConfig> map = backendRegistry.getMap();

        SqlBackendConfig backendConfig = map.get(dbProductName);
        if(backendConfig == null) {
            throw new RuntimeException("Could not find backend for " + dbProductName);
        }
/* ... */

Die Entsprechende Exception beim Starten von Sparqlify sieht so aus:

2017-05-29 22:39:48,798 INFO  org.aksw.sparqlify.web.Main: Database product: PostgreSQL
sparqlify  | Exception in thread "main" java.lang.RuntimeException: Could not find backend for PostgreSQL
sparqlify  |  at org.aksw.sparqlify.web.Main.main(Main.java:210)

Bitte Prüfen.

@j0nxn
Copy link
Author

j0nxn commented Jun 1, 2017

Pull-RQ: #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant