Digitalcollections Model
Java library containing Domain Object classes of the Digital Collection's and Digital Humanities ecosystem. Primarily started from the needs for GLAMs (Galleries, Libraries, Archives, Museums) but not restricted to it.
Business Domain Model
The domain model follows the FRBR (Functional Requirements for Bibliographic Records). The model is not restricted to books but can handle all sort of creative works and their digital counterparts ("digital objects").
One core statement (taken from Music Cataloging at Yale) is:
"A work is realized by an expression, which is embodied in a manifestation, which is exemplified by an item."
And the central object of interest of digital collections is the DigitalObject
as the digital representation of an item and curated Collections
as group of digital objects.
- For presenting digital collections online the library offers
Website
andWebpage
classes. - For arranging and describing digital objects by topics the library offers
Topic
andSubtopic
classes. - For editorial contribution in the context of digital collections the library offers
Article
with rich text formatting and embedding of different media.
The following classes can be assigned to objects (where appropriate):
- a freely definable
License
- a list of freely definable
Identifier
s, each of them identifying the object uniquely in an external source system, e.g. GND-ID ("gnd:104330171") or VIAF-ID ("viaf:96994450").
Technical Model Classes
This library supports practical handling of above domain model by adding paging, filtering and sorting classes.
Filtering-Model
Model for passing technology independent filter criterias from frontend to backend via URL-params. Backend has to take care about implementing technology dependent filtering for given criterias.
Example usage (use case: return only webpages with active publication time range):
public PageResponse<Webpage> findAll(
@RequestParam(name = "pageNumber", required = false, defaultValue = "0") int pageNumber,
@RequestParam(name = "pageSize", required = false, defaultValue = "5") int pageSize,
@RequestParam(name = "sortField", required = false, defaultValue = "uuid") String sortField,
@RequestParam(name = "sortDirection", required = false, defaultValue = "ASC") Direction sortDirection,
@RequestParam(name = "nullHandling", required = false, defaultValue = "NATIVE") NullHandling nullHandling
) {
OrderImpl order = new OrderImpl(sortDirection, sortField, nullHandling);
Sorting sorting = new SortingImpl(order);
LocalDate now = LocalDate.now();
Filtering filtering = Filtering.defaultBuilder()
.filter("publicationStart").lessOrEqual(now)
.filter("publicationEnd").greaterOrEqual(now)
.build();
PageRequest pageRequest = new PageRequestImpl(pageNumber, pageSize, sorting, filtering);
...
Supported filter operations:
Symbol | Operation | Example filter query param |
---|---|---|
eq | Equals | city=eq:Munich |
neq | Not Equals | country=neq:de |
gt | Greater Than | amount=gt:10000 |
gte | Greater Than or equals to | amount=gte:10000 |
lt | Less Than | amount=lt:10000 |
lte | Less Than or equals to | amount=lte:10000 |
in | IN | country=in:uk, usa, au |
nin | Not IN | country=nin:fr, de, nz |
btn | Between (inclusive) | joiningDate=btn:2018-01-01, 2016-01-01 |
like | Like | firstName=like:John |
set | value exists (not null) | firstName=set: |
notset | value is not set (null) | firstName=notset: |
REST-API design for filtering was inspired by:
- REST API Design: Filtering, Sorting, and Pagination
- An example application using Spring boot MVC, Spring Data JPA with the ability to do filter, pagination and sorting.
Model-Serializing
Comes with a separate module for supporting serializing model objects to JSON (dc-model-jackson module
) using Jackson