@Override public void delete(String graph) { checkGSP(); String url = LibRDFConn.urlForGraph(svcGraphStore, graph); exec(()->HttpOp.execHttpDelete(url)); }
private Graph fetch$(String url) { HttpCaptureResponse<Graph> graph = HttpResponseLib.graphHandler(); exec(()->HttpOp.execHttpGet(url, acceptGraph, graph, this.httpClient, this.httpContext)); return graph.get(); }
private Graph fetch$(String url) { HttpCaptureResponse<Graph> graph = HttpResponseLib.graphHandler(); exec(()->HttpOp.execHttpGet(url, acceptGraph, graph, this.httpClient, this.httpContext)); return graph.get(); }
@Override public void delete(String graph) { checkGSP(); String url = LibRDFConn.urlForGraph(svcGraphStore, graph); exec(()->HttpOp.execHttpDelete(url)); }
/** Do a PUT or POST to a dataset, sending the contents of the file. * <p> * The Content-Type is inferred from the file extension. * <p> * "Replace" implies PUT, otherwise a POST is used. */ protected void doPutPostDataset(String file, boolean replace) { Lang lang = RDFLanguages.filenameToLang(file); File f = new File(file); long length = f.length(); exec(()->{ HttpEntity entity = fileToHttpEntity(file, lang); if ( replace ) HttpOp.execHttpPut(destination, entity, httpClient, httpContext); else HttpOp.execHttpPost(destination, entity, httpClient, httpContext); }); }
/** Do a PUT or POST to a dataset, sending the contents of the file. * <p> * The Content-Type is inferred from the file extension. * <p> * "Replace" implies PUT, otherwise a POST is used. */ protected void doPutPostDataset(String file, boolean replace) { Lang lang = RDFLanguages.filenameToLang(file); File f = new File(file); long length = f.length(); exec(()->{ HttpEntity entity = fileToHttpEntity(file, lang); if ( replace ) HttpOp.execHttpPut(destination, entity, httpClient, httpContext); else HttpOp.execHttpPost(destination, entity, httpClient, httpContext); }); }
exec(()->{ HttpEntity entity = fileToHttpEntity(file, lang); if ( replace )
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)); }
exec(()->{ HttpEntity entity = fileToHttpEntity(file, lang); if ( replace )
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)); }
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)); }
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); }); }
/** 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 Dataset fetchDataset() { if ( destination == null ) throw new ARQException("Dataset operations not available - no dataset URL provided"); Dataset ds = DatasetFactory.createTxnMem(); Txn.executeWrite(ds, ()->{ TypedInputStream s = exec(()->HttpOp.execHttpGet(destination, acceptDataset, this.httpClient, this.httpContext)); Lang lang = RDFLanguages.contentTypeToLang(s.getContentType()); RDFDataMgr.read(ds, s, lang); }); return ds; }
/** Send a model to named graph (or "default" or null for the defaultl graph). * <p> * The Content-Type is taken from the given {@code Lang}. * <p> * "Replace" means overwrite existing data, othewise the date is added to the target. */ protected void doPutPost(Model model, String name, boolean replace) { String url = LibRDFConn.urlForGraph(svcGraphStore, name); exec(()->{ Graph graph = model.getGraph(); if ( replace ) HttpOp.execHttpPut(url, graphToHttpEntity(graph), httpClient, httpContext); else HttpOp.execHttpPost(url, graphToHttpEntity(graph), null, null, httpClient, httpContext); }); }
@Override public Dataset fetchDataset() { if ( destination == null ) throw new ARQException("Dataset operations not available - no dataset URL provided"); Dataset ds = DatasetFactory.createTxnMem(); Txn.executeWrite(ds, ()->{ TypedInputStream s = exec(()->HttpOp.execHttpGet(destination, acceptDataset, this.httpClient, this.httpContext)); Lang lang = RDFLanguages.contentTypeToLang(s.getContentType()); RDFDataMgr.read(ds, s, lang); }); return ds; }
/** Send a model to named graph (or "default" or null for the defaultl graph). * <p> * The Content-Type is taken from the given {@code Lang}. * <p> * "Replace" means overwrite existing data, othewise the date is added to the target. */ protected void doPutPost(Model model, String name, boolean replace) { String url = LibRDFConn.urlForGraph(svcGraphStore, name); exec(()->{ Graph graph = model.getGraph(); if ( replace ) HttpOp.execHttpPut(url, graphToHttpEntity(graph), httpClient, httpContext); else HttpOp.execHttpPost(url, graphToHttpEntity(graph), null, null, httpClient, httpContext); }); }