RemoteEndpointDriver extends JenaDriver { @Override protected JenaConnection connect(Properties props, int compatibilityLevel) throws SQLException { String queryEndpoint = props.getProperty(PARAM_QUERY_ENDPOINT); String updateEndpoint = props.getProperty(PARAM_UPDATE_ENDPOINT); if (queryEndpoint == null && updateEndpoint == null) throw new SQLException("At least one of the " + PARAM_QUERY_ENDPOINT + " or " + PARAM_UPDATE_ENDPOINT + " connection parameters must be specified to make a remote connection"); List<String> defaultGraphs = this.getValues(props, PARAM_DEFAULT_GRAPH_URI); List<String> namedGraphs = this.getValues(props, PARAM_NAMED_GRAPH_URI); List<String> usingGraphs = this.getValues(props, PARAM_USING_GRAPH_URI); List<String> usingNamedGraphs = this.getValues(props, PARAM_USING_NAMED_GRAPH_URI); HttpClient client = this.configureClient(props); String selectResultsType = props.getProperty(PARAM_SELECT_RESULTS_TYPE, null); String modelResultsType = props.getProperty(PARAM_MODEL_RESULTS_TYPE, null); return openConnection(queryEndpoint, updateEndpoint, defaultGraphs, namedGraphs, usingGraphs, usingNamedGraphs, client, JenaConnection.DEFAULT_HOLDABILITY, compatibilityLevel, selectResultsType, modelResultsType); } RemoteEndpointDriver(); protected  RemoteEndpointDriver(int majorVersion, int minorVersion, String driverPrefix); static synchronized void register(); static final String REMOTE_DRIVER_PREFIX; static final String PARAM_QUERY_ENDPOINT; static final String PARAM_UPDATE_ENDPOINT; static final String PARAM_DEFAULT_GRAPH_URI; static final String PARAM_NAMED_GRAPH_URI; static final String PARAM_USING_GRAPH_URI; static final String PARAM_USING_NAMED_GRAPH_URI; static final String PARAM_SELECT_RESULTS_TYPE; static final String PARAM_MODEL_RESULTS_TYPE; static final String PARAM_CLIENT; }
@Test public void remote_driver_graph_uris_01() throws SQLException { String url = JenaDriver.DRIVER_PREFIX + RemoteEndpointDriver.REMOTE_DRIVER_PREFIX + RemoteEndpointDriver.PARAM_QUERY_ENDPOINT + "=http: RemoteEndpointDriver driver = (RemoteEndpointDriver)this.getDriver(); try(RemoteEndpointConnection conn = (RemoteEndpointConnection) driver.connect(url, new Properties())) { Assert.assertEquals(2, conn.getDefaultGraphURIs().size()); } }
@Test public void remote_driver_graph_uris_02() throws SQLException { String url = JenaDriver.DRIVER_PREFIX + RemoteEndpointDriver.REMOTE_DRIVER_PREFIX + RemoteEndpointDriver.PARAM_QUERY_ENDPOINT + "=http: RemoteEndpointDriver driver = (RemoteEndpointDriver)this.getDriver(); try(RemoteEndpointConnection conn = (RemoteEndpointConnection) driver.connect(url, new Properties())){ Assert.assertEquals(2, conn.getDefaultGraphURIs().size()); } }
@Test public void remote_driver_graph_uris_03() throws SQLException { String url = JenaDriver.DRIVER_PREFIX + RemoteEndpointDriver.REMOTE_DRIVER_PREFIX + RemoteEndpointDriver.PARAM_QUERY_ENDPOINT + "=http: RemoteEndpointDriver driver = (RemoteEndpointDriver)this.getDriver(); try(RemoteEndpointConnection conn = (RemoteEndpointConnection) driver.connect(url, new Properties())) { Assert.assertEquals(3, conn.getDefaultGraphURIs().size()); } }