Hi Russell,
Thank you for reporting the problem with passing on the HttpClient from
RDFConnectionRemote. Logged as JENA-1330
<https://issues.apache.org/jira/browse/JENA-1330> Hopefully, that can be
fixed for the 3.3.0 release - it looks like an omission.
<https://issues.apache.org/jira/browse/JENA-1330>
About “?database=MyDb”:
could you please try with the query string added to the URL for the
RDFConnection? That seems to be the nearest thing to the correct URL
for a SPARQL protocol request.
Yopu may need the three argument form of RDFConnectionFactory.connect.
(This is based on reading the MarkLogic documentation and working out
their interpretation of the SPARQL protocol.)
Query and update appear to work (reasonable URLs get generated) in the
Jena test framework. However, in some testing I tried that will not work
for the Graph Store Protocol (GSP) operations, only query and update.
I'll look at improving the handling here if possible. GSP uses the query
string itself. JENA-1331 <https://issues.apache.org/jira/browse/JENA-1331>.
Thanks,
Andy
On 26/04/17 16:26, Morrisey, Russell wrote:
Hi,
We have written a Jena client application that uses
RDFConnectionFactory, as specified in the Jena docs.
Recently, we switched to a new remote triple store (MarkLogic) that
uses digest auth.
We would like to be able to handle the auth properly, and we would
also like to send additional query string params with each request,
like “?database=MyDb”.
How can we specify these things through the
RDFConnectionFactory/RDFConnection interface?
Can I set it up so that the digest auth only happens once, when the
RDFConnection is created?
I looked at the RDFConnectionRemote class, and noticed that an
HttpClient can be set. This setting is not part of the factory interface.
It seems like the HttpClient is not always used; the *query* method,
for example, calls:
QueryExecutionFactory./createServiceRequest/(svcQuery, query)
…which does not pass the httpClient param. This seems like it could be
a bug – maybe someone can confirm this?
I also noticed that the method of supplying params to a request via
HttpClient (HttpClient.getParams()) seems to be deprecated. It says to
use RequestConfig, but I don’t know how to specify a RequestConfig
through the RDFConnection.
What should I do?
Our usage in the client app follows the “traditional” transactional
pattern outlined in the Jena RDF API docs:
http://jena.apache.org/documentation/rdfconnection/
try ( RDFConnection conn = RDFConnectionFactory.connect(...) ) {
conn.begin(ReadWrite.WRITE) ;
try {
conn.load("data1.ttl") ;
conn.load("data2.ttl") ;
conn.querySelect("SELECT DISTINCT ?s { ?s ?p ?o }", (qs)->
Resource subject = qs.getResource("s") ;
System.out.println("Subject: "+subject) ;
}) ;
conn.commit() ;
} finally { conn.end() ; }
}
Thanks!
*Russell Morrisey*
*Sr. Java Developer | Shared Services Team*
/[email protected]_///
/cscglobal.com/ <http://www.cscglobal.com/>
cid:[email protected]
*/Ask us about our new brand reveal – coming this May./*
------------------------------------------------------------------------
NOTICE: This e-mail and any attachments is intended only for use by
the addressee(s) named herein and may contain legally privileged,
proprietary or confidential information. If you are not the intended
recipient of this e-mail, you are hereby notified that any
dissemination, distribution or copying of this email, and any
attachments thereto, is strictly prohibited. If you receive this email
in error please immediately notify me via reply email or at (800)
927-9800 and permanently delete the original copy and any copy of any
e-mail, and any printout.