marklogic / marklogic-rdf4j

Support for MarkLogic exposed inthe rdf4j idiom.
Other
5 stars 3 forks source link

RDF4J currently does not use a database where one is specified on initialization and instead uses the App Server default. #8

Closed ableasdale closed 7 years ago

ableasdale commented 7 years ago

Hi,

I'm currently testing this as a replacement for marklogic-sesame and I've noticed a bug with the initialization of the MarkLogicRepository.

If I create a DatabaseClient using the Java API like this (configured with a specified database name):

client = DatabaseClientFactory.newClient(
                Configuration.HOST, Configuration.PORT, Configuration.DATABASE,
                new DatabaseClientFactory.DigestAuthContext(Configuration.USERNAME, Configuration.PASSWORD));

And use that to initialize the repository:

markLogicRepository = new MarkLogicRepository(client);

When I start using that to load data in:

MarkLogicRepositoryConnection conn = MarkLogicRDF4JRepositoryProvider.getMarkLogicRepositoryConnection();
        assertTimeoutPreemptively(ofSeconds(20), () -> {
            conn.add(Utils.getFileReader("nquads/sample.nq"), "", RDFFormat.NQUADS);
        });

The N-Quads in this case are being loaded, but they end up in the database that is set as default in the MarkLogic Application Server settings, rather than the one I specified.

Please let me know if you need any further information regarding this and I'll be happy to provide assistance - thanks very much in advance.

grechaw commented 7 years ago

You're right in that the library does not handle this situation -- it was created before the database could be set on a per-request basis. I'll set the various labels so that this can get into the backlog in jira -- we should address when the database can be set and when it can't, at the very least.

That said, it looks like this should be supported, so I'll assume it's a bug of omission until further analysis reveals otherwise.