@Test public void modelGetter_givenSparqlQuery_ShouldReturnAllCorrespondingStatements() { String sparqlQuery = "" + "CONSTRUCT {" + " ?s <http: + " ?s <http: + "} " + "FROM NAMED <http: + "WHERE { " + " GRAPH ?g { " + " ?s <http: + " ?s <http: + " } " + "}"; Model model = QueryUtils.getModelFromRepo(repo, sparqlQuery); assertThat( "All statements corresponding to sparql query should be loaded", model, hasSize(2) ); }
public static Model getModelFromRepo(Repository repository, String sparqlQuery) { Objects.requireNonNull(repository, REPOSITORY_MSG); Objects.requireNonNull(repository, SPARQL_QUERY_MSG); return Repositories.graphQuery( repository, sparqlQuery, QueryResults::asModel ); }
QueryUtils { public static Model getModelFromRepo(Repository repository, String sparqlQuery) { Objects.requireNonNull(repository, REPOSITORY_MSG); Objects.requireNonNull(repository, SPARQL_QUERY_MSG); return Repositories.graphQuery( repository, sparqlQuery, QueryResults::asModel ); } }
QueryUtils { public static Model getModelFromRepo(Repository repository, String sparqlQuery) { Objects.requireNonNull(repository, REPOSITORY_MSG); Objects.requireNonNull(repository, SPARQL_QUERY_MSG); return Repositories.graphQuery( repository, sparqlQuery, QueryResults::asModel ); } private  QueryUtils(); }
QueryUtils { public static Model getModelFromRepo(Repository repository, String sparqlQuery) { Objects.requireNonNull(repository, REPOSITORY_MSG); Objects.requireNonNull(repository, SPARQL_QUERY_MSG); return Repositories.graphQuery( repository, sparqlQuery, QueryResults::asModel ); } private  QueryUtils(); static Model getModelFromRepo(Repository repository, String sparqlQuery); static Model getModelFromRepo(Repository repository, Resource... contexts); }
QueryUtils { public static Model getModelFromRepo(Repository repository, String sparqlQuery) { Objects.requireNonNull(repository, REPOSITORY_MSG); Objects.requireNonNull(repository, SPARQL_QUERY_MSG); return Repositories.graphQuery( repository, sparqlQuery, QueryResults::asModel ); } private  QueryUtils(); static Model getModelFromRepo(Repository repository, String sparqlQuery); static Model getModelFromRepo(Repository repository, Resource... contexts);  }