@Override protected Iterator<Entry<Resource, Model>> doPageRead() { long limit = (long)this.pageSize; long offset = this.page * this.pageSize; Map<Resource, Model> map = listService.fetchData(concept, limit, offset); Iterator<Entry<Resource, Model>> result = map.entrySet().iterator(); return result; } }
@Override protected Iterator<Entry<Node, DatasetGraph>> doPageRead() { long limit = (long)this.pageSize; long offset = this.page * this.pageSize; Map<Node, DatasetGraph> map = listService.fetchData(concept, limit, offset); Iterator<Entry<Node, DatasetGraph>> result = map.entrySet().iterator(); return result; } }
/** * The recommended map type to be used as the return value is LinkedHashMap. * * @param concept * @param limit * @param offset * @return */ default Map<K, V> fetchData(C concept, Long limit, Long offset) { Range<Long> range = QueryUtils.createRange(limit, offset); Map<K, V> result = fetchData(concept, range); return result; }
@Override public Iterator<Node> listGraphNodes() { QueryExecutionFactory qef = sparqlService.getQueryExecutionFactory(); MapService<Concept, Node, Node> ls = new ListServiceConcept(qef); Set<Node> nodes = ls.fetchData(ConceptUtils.listAllGraphs, null, null).keySet(); return nodes.iterator(); }
public static void main(String[] args) { QueryExecutionFactory qef = new QueryExecutionFactoryHttp("http://dbpedia.org/sparql"); MapService<Concept, Node, Node> ls = new ListServiceConcept(qef); Concept concept = ConceptUtils.listAllPredicates; Range<Long> countInfo; countInfo = ls.fetchCount(concept, 2l, null).blockingGet(); System.out.println(countInfo); countInfo = ls.fetchCount(concept, 3l, null).blockingGet(); System.out.println(countInfo); countInfo = ls.fetchCount(concept, 4l, null).blockingGet(); System.out.println(countInfo); countInfo = ls.fetchCount(concept, null, null).blockingGet(); System.out.println(countInfo); Map<Node, Node> data = ls.fetchData(concept, null, null); System.out.println(data); } }
Map<Node, DatasetGraph> nodeToDatasetGraph = ls.fetchData(concept, null, null);