/** * Create a connection builder which is initialized from an existing {@code RDFConnectionFuseki}. * @param other The RDFConnectionFuseki to clone. * @return RDFConnectionRemoteBuilder */ public static RDFConnectionRemoteBuilder create(RDFConnectionFuseki other) { return setupCreator(RDFConnectionRemote.create(other)); }
protected RDFConnectionRemote buildConnection() { return new RDFConnectionRemote(txnLifecycle, httpClient, httpContext, destination, queryURL, updateURL, gspURL, outputQuads, outputTriples, acceptDataset, acceptGraph, acceptSparqlResults, acceptSelectResult, acceptAskResult, parseCheckQueries, parseCheckUpdates); } }
private QueryExecution queryExec(Query query, String queryString) { checkQuery(); if ( query == null && queryString == null ) throw new InternalErrorException("Both query and query string are null"); if ( query == null ) { if ( parseCheckQueries ) QueryFactory.create(queryString); } // Use the query string as provided if possible, otherwise serialize the query. String queryStringToSend = ( queryString != null ) ? queryString : query.toString(); return exec(()-> createQueryExecution(query, queryStringToSend)); }
protected void checkUpdate() { checkOpen(); if ( svcUpdate == null ) throw new ARQException("No update service defined for this RDFConnection"); }
private void updateExec(UpdateRequest update, String updateString ) { checkUpdate(); if ( update == null && updateString == null ) throw new InternalErrorException("Both update request and update string are null"); if ( update == null ) { if ( parseCheckUpdates ) UpdateFactory.create(updateString); } // Use the update string as provided if possible, otherwise serialize the update. String updateStringToSend = ( updateString != null ) ? updateString : update.toString(); exec(()->HttpOp.execHttpPost(svcUpdate, WebContent.contentTypeSPARQLUpdate, updateStringToSend, this.httpClient, this.httpContext)); }
/** Do a PUT or POST to a dataset, sending the contents of a daatsets. * The Content-Type is {@code application/n-quads}. * <p> * "Replace" implies PUT, otherwise a POST is used. */ protected void doPutPostDataset(Dataset dataset, boolean replace) { exec(()->{ DatasetGraph dsg = dataset.asDatasetGraph(); if ( replace ) HttpOp.execHttpPut(destination, datasetToHttpEntity(dsg), httpClient, null); else HttpOp.execHttpPost(destination, datasetToHttpEntity(dsg), httpClient, null); }); }
@Override public void load(Model model) { doPutPost(model, null, false); }
/** Create an HttpEntity for the dataset */ protected HttpEntity datasetToHttpEntity(DatasetGraph dataset) { return datasetToHttpEntity(dataset, outputQuads); }
private QueryExecution queryExec(Query query, String queryString) { checkQuery(); if ( query == null && queryString == null ) throw new InternalErrorException("Both query and query string are null"); if ( query == null ) { if ( parseCheckQueries ) QueryFactory.create(queryString); } // Use the query string as provided if possible, otherwise serialize the query. String queryStringToSend = ( queryString != null ) ? queryString : query.toString(); return exec(()-> createQueryExecution(query, queryStringToSend)); }
protected void checkQuery() { checkOpen(); if ( svcQuery == null ) throw new ARQException("No query service defined for this RDFConnection"); }
private void updateExec(UpdateRequest update, String updateString ) { checkUpdate(); if ( update == null && updateString == null ) throw new InternalErrorException("Both update request and update string are null"); if ( update == null ) { if ( parseCheckUpdates ) UpdateFactory.create(updateString); } // Use the update string as provided if possible, otherwise serialize the update. String updateStringToSend = ( updateString != null ) ? updateString : update.toString(); exec(()->HttpOp.execHttpPost(svcUpdate, WebContent.contentTypeSPARQLUpdate, updateStringToSend, this.httpClient, this.httpContext)); }