Package org.aksw.commons.rx.lookup
Interface MapService<C,K,V>
- All Superinterfaces:
ListService<C,Map.Entry<K, V>>
- All Known Implementing Classes:
MapServiceFromListService,MapServiceTransformItem
A list service is actually quite similar to JPA's TypedQuery,
the main difference is, that we use a Map<K, V> here instead of a
List<T>
The rationale behind that is to be able to use the keys with further LookupServices
I also had in mind retrieving data from JSON documents, where (before json-ld) there was no standard
way for a designated ID attribute; so the idea was, that the list service indexes the result by whatever is the key.
Actually, I think I did something clever anyway: When we fetch a resources, shape, we map each node to its
corresponding graph, so we use exactly this interface
So we should separate ListService yielding a (paginator of) Map from one that yields a List.
-
Method Summary
Modifier and TypeMethodDescriptioncreatePaginator(C concept) default io.reactivex.rxjava3.core.Single<Long>default io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>>fetchCount(C concept, Long itemLimit, Long rowLimit) Select Distinct ?v { { Select ?v { concept } Limit rawLimit } } Limit resLimitThe recommended map type to be used as the return value is LinkedHashMap.default <O> MapService<C,K, O> transformValues(BiFunction<? super K, ? super V, ? extends O> transform) Methods inherited from interface org.aksw.commons.rx.lookup.ListService
streamData
-
Method Details
-
createPaginator
- Specified by:
createPaginatorin interfaceListService<C,K>
-
fetchData
-
fetchData
-
fetchCount
default io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>> fetchCount(C concept, Long itemLimit, Long rowLimit) Select Distinct ?v { { Select ?v { concept } Limit rawLimit } } Limit resLimit- Parameters:
concept-itemLimit- Limit applied on the set of distinct items (resources) //@param rowLimit Limits the number of rows to scan before applying distinct- Returns:
-
fetchCount
-
fetchData
The recommended map type to be used as the return value is LinkedHashMap.- Parameters:
concept-limit-offset-- Returns:
-
transformValues
default <O> MapService<C,K, transformValuesO> (BiFunction<? super K, ? super V, ? extends O> transform)
-