Aklakan commented on issue #1384:
URL: https://github.com/apache/jena/issues/1384#issuecomment-1156227019

   Hm again a twist: So with the connect timeout no longer present on the 
connection itself I have to set it on initialization.
   
   However for this part I was using my own assembler-like setup which sets up 
a factory for RDFConnection objects from an RDF document. Back then I didn't 
realize that Jena's assembler system is generic so it can create any java 
object from RDF.
   
   In my case, this allows for linking RDF benchmark results to the RDF 
document with the attributes for the connection setup and used thresholds.
   
   Rather then extending my own system I'd rather integrate with Jena 
assemblers.
   I think there is not yet an assembler for RDFConnection instances - is there?
   
   So a rought draft would look like
   ```ttl
   #conn.ttl
   <#httpClient> a ja:HttpClient ;
     ja:connectTimeout 10 . # seconds
   
   <#conn> rdf:type ja:HttpRDFConnection;
        ja:destination <http://dbpedia.org/sparql> ;
        ja:httpClient <#httpClient> .
   ```
   
   Followed by
   ```java
   Model model = ModelFactory.load("conn.ttl").getResource("#conn");
   RDFConnection conn = RDFConnectionFactory.assemble(model);
   ```
   
   However, instead of returning only a single connection it may be better to 
create a factory for connections:
   ```java
   /** A factory/supplier of RDFConnection instances. Similar to a JDBC 
DataSource. */
   public interface RDFDataSource
   {
       RDFConnection getConnection();
   }
   
   RDFDataSourceFactory.assemble(...);
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to