No edit summary |
mNo edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Introduction == | |||
{{DISPLAYTITLE:Share-VDE APIs: cross-cutting concepts}} | |||
{{DISPLAYTITLE:Share-VDE APIs}} | |||
__TOC__ | __TOC__ | ||
__FORCETOC__ | __FORCETOC__ | ||
Share-VDE manages a complex domain composed by several entities. That results in a complex graph of interconnected entities that can be queried and used by external requestors through a rich set of public APIs. The purpose of this section is to describe what a requestor can do in terms of API in order to interact with Share-VDE. | Share-VDE manages a complex domain composed by several entities. That results in a complex graph of interconnected entities that can be queried and used by external requestors through a rich set of public APIs. The purpose of this section is to describe what a requestor can do in terms of API in order to interact with Share-VDE. | ||
We strongly recommend to experiment the Share-VDE API using the [[ | We strongly recommend to experiment the Share-VDE API using the [[ShareDoc:The PostMan Collection|ready-to-use Postman collection]]. | ||
This page offers a high-level overview of the Share-VDE public API, which are detailed in the following two sections: | This page offers a high-level overview of the Share-VDE public API, which are detailed in the following two sections: | ||
*[[ | *[[ShareDoc:GraphQL API|GraphQL API:]] GraphQL<ref>https://graphql.org/</ref> provides a front controller on top of heterogeneous data sources, whether the provider is an API, a database, or an arbitrary application that provides data through an interoperable protocol. | ||
*[[ | *[[ShareDoc:RESTFul API|REST]]: REST<ref>https://en.wikipedia.org/wiki/Representational_state_transfer</ref> is a software architectural style which focuses on a resource-centric domain model. | ||
==Domain model (diagram)== | ==Domain model (diagram)== | ||
Line 29: | Line 21: | ||
*'''"functional"''' those entities that are part of the Share-VDE Core Domain Model (e.g. Agents, Opuses, Works, Instances, Items) | *'''"functional"''' those entities that are part of the Share-VDE Core Domain Model (e.g. Agents, Opuses, Works, Instances, Items) | ||
*'''"technical"''' those entities required by some '''technical constraint''' in order to enrich the core entities with additional information (e.g. Collections, Facets, Pagination metadata). | *'''"technical"''' those entities required by some '''technical constraint''' in order to enrich the core entities with additional information (e.g. Collections, Facets, Pagination metadata). | ||
Line 39: | Line 28: | ||
==Common Concepts== | ==Common Concepts== | ||
Before going ahead with the API description, it's important to | Before going ahead with the API description, it's important to consolidate some concepts that are shared between the two available interfaces ([[ShareDoc:GraphQL API|GraphQL]] and [[ShareDoc:RESTFul API|REST]]). | ||
*[[ | *[[ShareDoc:Simple Search|Simple Search:]] How the simple search works in Share-VDE, concepts and common behaviours. | ||
*[[ | *[[ShareDoc:Content Negotiation|Content Negotiation]]: Share-VDE resources are available in several formats, learn how to deal with the different representations. | ||
*[[ | *[[ShareDoc:Query Languages|Query Languages]]: there are multiple query languages available in Share-VDE. This section offers a detailed explanation about them. | ||
The remaining part of this page describes | The remaining part of this page describes additional details you should be aware before interacting with the API. | ||
===Pagination=== | ===Pagination=== | ||
Line 114: | Line 103: | ||
|- | |- | ||
|'''name''' | |'''name''' | ||
| style=" | | style="" class="col-green-bg" | | ||
| style=" | | style="" class="col-green-bg" | | ||
| style=" | | style="" class="col-green-bg" | | ||
| style=" | | style="" class="col-green-bg" | | ||
| style=" | | style="" class="col-green-bg" | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 127: | Line 116: | ||
|- | |- | ||
|'''beginningDate''' | |'''beginningDate''' | ||
| style=" | | style="" class="col-green-bg" | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 140: | Line 129: | ||
|- | |- | ||
|'''endingDate''' | |'''endingDate''' | ||
| style=" | | style="" class="col-green-bg" | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 156: | Line 145: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 168: | Line 157: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 181: | Line 170: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 194: | Line 183: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 207: | Line 196: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 222: | Line 211: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 235: | Line 224: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 249: | Line 238: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 262: | Line 251: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 276: | Line 265: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''publicationYear''' | |'''publicationYear''' | ||
Line 289: | Line 278: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
Line 316: | Line 305: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''form''' | |'''form''' | ||
Line 329: | Line 318: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''placeOfOrigin''' | |'''placeOfOrigin''' | ||
Line 342: | Line 331: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''format''' | |'''format''' | ||
Line 356: | Line 345: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''isbn''' | |'''isbn''' | ||
Line 369: | Line 358: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''publicationType''' | |'''publicationType''' | ||
Line 382: | Line 371: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''publicationPlace''' | |'''publicationPlace''' | ||
Line 395: | Line 384: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style="" | | | style="" | | ||
Line 408: | Line 397: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''ean''' | |'''ean''' | ||
Line 421: | Line 410: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''ismn''' | |'''ismn''' | ||
Line 434: | Line 423: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|- | |- | ||
|'''barcode''' | |'''barcode''' | ||
Line 448: | Line 437: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
|- | |- | ||
Line 461: | Line 450: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
| | | | ||
|- | |- | ||
Line 487: | Line 476: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-green-bg" | | ||
|} | |} | ||
Line 493: | Line 482: | ||
All operations that return in response a collection of entities accept in input an optional multivalued parameter (i.e. an array) that allow to apply filters on the results. Specifically: | All operations that return in response a collection of entities accept in input an optional multivalued parameter (i.e. an array) that allow to apply filters on the results. Specifically: | ||
*in [[ | *in [[ShareDoc:GraphQL API|GraphQL]] API the parameter is called '''filters''' and it is an array of strings | ||
* in [[ | * in [[ShareDoc:RESTFul API|RESTful]] API the parameter is a repeatable request parameter called '''filter''' | ||
{| class="wikitable" style="" | {| class="wikitable" style="" | ||
Line 502: | Line 491: | ||
!'''Default Value''' | !'''Default Value''' | ||
|- | |- | ||
|filters ([[ | |filters ([[ShareDoc:GraphQL API|GraphQL]]) / filter ([[ShareDoc:RESTFul API|REST]]) | ||
|String | |String | ||
|A valid filter clause (see below) | |A valid filter clause (see below) | ||
Line 552: | Line 541: | ||
|- | |- | ||
|'''beginningDate''' | |'''beginningDate''' | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 565: | Line 554: | ||
|- | |- | ||
|'''endingDate''' | |'''endingDate''' | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 581: | Line 570: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 593: | Line 582: | ||
| | | | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 606: | Line 595: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 619: | Line 608: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 632: | Line 621: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 645: | Line 634: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 660: | Line 649: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 673: | Line 662: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 687: | Line 676: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 700: | Line 689: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 714: | Line 703: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
Line 727: | Line 716: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''language''' | |'''language''' | ||
Line 741: | Line 730: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''form''' | |'''form''' | ||
Line 754: | Line 743: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''subject''' | |'''subject''' | ||
Line 767: | Line 756: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''placeOfOrigin''' | |'''placeOfOrigin''' | ||
Line 780: | Line 769: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''classification''' | |'''classification''' | ||
Line 793: | Line 782: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''publicationPlace''' | |'''publicationPlace''' | ||
Line 807: | Line 796: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''publicationYear''' | |'''publicationYear''' | ||
Line 817: | Line 806: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-white-bg" | | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''format''' | |'''format''' | ||
Line 833: | Line 822: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''isbn''' | |'''isbn''' | ||
Line 846: | Line 835: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''publicationType''' | |'''publicationType''' | ||
Line 859: | Line 848: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''issn''' | |'''issn''' | ||
Line 872: | Line 861: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''printOnline''' | |'''printOnline''' | ||
Line 885: | Line 874: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''ean''' | |'''ean''' | ||
Line 898: | Line 887: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''ismn''' | |'''ismn''' | ||
Line 911: | Line 900: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''barcode''' | |'''barcode''' | ||
Line 925: | Line 914: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''holdingInstitution''' | |'''holdingInstitution''' | ||
Line 938: | Line 927: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''availability''' | |'''availability''' | ||
Line 964: | Line 953: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''contributor''' | |'''contributor''' | ||
Line 974: | Line 963: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''printOnlineChoice''' | |'''printOnlineChoice''' | ||
Line 989: | Line 978: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''library''' | |'''library''' | ||
Line 1,002: | Line 991: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''opusType''' | |'''opusType''' | ||
Line 1,014: | Line 1,003: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''auctionExhibition''' | |'''auctionExhibition''' | ||
Line 1,028: | Line 1,017: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''provenance''' | |'''provenance''' | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|- | |- | ||
|'''library''' | |'''library''' | ||
Line 1,054: | Line 1,043: | ||
| | | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
| | | | ||
| style=" | | style="" class="col-orange-bg" | | ||
|} | |} | ||
Line 1,067: | Line 1,056: | ||
**in contexts (see for example the NATBIB tenant) where there '''are no items''' in the knowledge base. In such a context the "library" attribute it is not available because as said above, it is derived from items. | **in contexts (see for example the NATBIB tenant) where there '''are no items''' in the knowledge base. In such a context the "library" attribute it is not available because as said above, it is derived from items. | ||
====[[ | ====[[ShareDoc:RESTFul API|REST]] Examples==== | ||
'''Example #1: publications having 1982 as year''' | '''Example #1: publications having 1982 as year''' | ||
Line 1,104: | Line 1,093: | ||
filter=publicationYear:1982&filter=language:"<nowiki>https://svde.org/places/28372837</nowiki>" | filter=publicationYear:1982&filter=language:"<nowiki>https://svde.org/places/28372837</nowiki>" | ||
====[[ | ====[[ShareDoc:GraphQL API|GraphQL]] Examples==== | ||
'''Example #1: publications having 1982 as year''' | '''Example #1: publications having 1982 as year''' | ||
Line 1,141: | Line 1,130: | ||
filters:["publicationYear:1982", "language:\"<nowiki>https://svde.org/places/28372837</nowiki>\""] | filters:["publicationYear:1982", "language:\"<nowiki>https://svde.org/places/28372837</nowiki>\""] | ||
{{DEFAULTSORT:Share-VDE APIs}} | {{DEFAULTSORT:Share-VDE APIs: cross-cutting concepts}} | ||
<references /> | <references /> |
Latest revision as of 08:40, 28 May 2024
Introduction
Share-VDE manages a complex domain composed by several entities. That results in a complex graph of interconnected entities that can be queried and used by external requestors through a rich set of public APIs. The purpose of this section is to describe what a requestor can do in terms of API in order to interact with Share-VDE.
We strongly recommend to experiment the Share-VDE API using the ready-to-use Postman collection.
This page offers a high-level overview of the Share-VDE public API, which are detailed in the following two sections:
- GraphQL API: GraphQL[1] provides a front controller on top of heterogeneous data sources, whether the provider is an API, a database, or an arbitrary application that provides data through an interoperable protocol.
- REST: REST[2] is a software architectural style which focuses on a resource-centric domain model.
Domain model (diagram)
At the heart of the system there's a complex domain model, as depicted in the following diagram:
The domain is composed by functional and technical entities, meaning with that a simple classification where we denote as
- "functional" those entities that are part of the Share-VDE Core Domain Model (e.g. Agents, Opuses, Works, Instances, Items)
- "technical" those entities required by some technical constraint in order to enrich the core entities with additional information (e.g. Collections, Facets, Pagination metadata).
Common Concepts
Before going ahead with the API description, it's important to consolidate some concepts that are shared between the two available interfaces (GraphQL and REST).
- Simple Search: How the simple search works in Share-VDE, concepts and common behaviours.
- Content Negotiation: Share-VDE resources are available in several formats, learn how to deal with the different representations.
- Query Languages: there are multiple query languages available in Share-VDE. This section offers a detailed explanation about them.
The remaining part of this page describes additional details you should be aware before interacting with the API.
Pagination
All operations that return in response a collection of entities accept in input two optional parameters that allow to page the results.
Name | Type | Description | Default Value |
---|---|---|---|
rows | Integer | The size of the page of results in the response. | 10 |
offset | Integer | The offset of the first item returned in results. | 0 |
In response, the pagination parameters are returned back, together with a third information called totalMatches, which informs about the total number of entities matching the executed query. Here's an example
{
"data": {
"agents": {
...
"totalMatches": 87,
"pageSize": 10,
"startOffset": 0
}
}
}
Sort
All operations that return in response a collection of entities accept an optional parameter that allow to sort the (paged) results.
Name | Type | Description | Default Value |
---|---|---|---|
sort | String | The sort clause (see below) | ----- |
The sort clause is composed by 2 parts:
- a field name: it must be marked as sortable in the Share-VDE dictionary.
- a sort order: asc (ascending) or desc (descending)
The following matrix lists, for each entity, the attributes available for sorting.
Contributor | Agent | Person | Meeting | Family | Organisation | Opus | Work | Instance | Item | Publication | |
---|---|---|---|---|---|---|---|---|---|---|---|
name | |||||||||||
beginningDate | |||||||||||
endingDate | |||||||||||
location | |||||||||||
birthDate | |||||||||||
deathDate | |||||||||||
birthPlace | |||||||||||
deathPlace | |||||||||||
startDate | |||||||||||
endDate | |||||||||||
foundingYear | |||||||||||
dissolutionYear | |||||||||||
title | |||||||||||
publicationYear | |||||||||||
genre | |||||||||||
language | |||||||||||
form | |||||||||||
placeOfOrigin | |||||||||||
format | |||||||||||
isbn | |||||||||||
publicationType | |||||||||||
publicationPlace | |||||||||||
issn | |||||||||||
ean | |||||||||||
ismn | |||||||||||
barcode | |||||||||||
holdingInstitution | |||||||||||
availability | |||||||||||
callNo |
Filters
All operations that return in response a collection of entities accept in input an optional multivalued parameter (i.e. an array) that allow to apply filters on the results. Specifically:
- in GraphQL API the parameter is called filters and it is an array of strings
- in RESTful API the parameter is a repeatable request parameter called filter
Name | Type | Description | Default Value |
---|---|---|---|
filters (GraphQL) / filter (REST) | String | A valid filter clause (see below) | ----- |
A filter clause is composed by 2 parts:
- a field name: The list of fields that can be used in a filter clause, for each entity, is provided in the sections that describe the available operations
- the colon operator :
- a valid clause: the following rules apply
- In case of string or URI fields, the clause is the value we want to filter surrounded by double quotes
- In case of numeric fields the value is just the value we want to use as a filter or a range (see below)
IMPORTANT
- multiple clause can be specified in one filter: in that case
- they must refer to the same attribute
- they must be separated using the OR keyword
- the attribute (and the colon) must repeated for each value (e.g. year:1982 OR year:2020 OR year:1999)
- multiple filters (i.e. multiple parameters) are supposed to be executed in AND. That means the result is the global intersection of matching entities between the query and all filters
The following matrix lists, for each entity, the attributes available for filtering.
Contributor | Agent | Person | Meeting | Family | Organisation | Opus | Work | Instance | Item | Publication | |
---|---|---|---|---|---|---|---|---|---|---|---|
name | |||||||||||
beginningDate | |||||||||||
endingDate | |||||||||||
location | |||||||||||
birthDate | |||||||||||
deathDate | |||||||||||
birthPlace | |||||||||||
deathPlace | |||||||||||
occupation | |||||||||||
startDate | |||||||||||
endDate | |||||||||||
foundingYear | |||||||||||
dissolutionYear | |||||||||||
year | |||||||||||
genre | |||||||||||
language | |||||||||||
form | |||||||||||
subject | |||||||||||
placeOfOrigin | |||||||||||
classification | |||||||||||
publicationPlace | |||||||||||
publicationYear | |||||||||||
format | |||||||||||
isbn | |||||||||||
publicationType | |||||||||||
issn | |||||||||||
printOnline | |||||||||||
ean | |||||||||||
ismn | |||||||||||
barcode | |||||||||||
holdingInstitution | |||||||||||
availability | |||||||||||
callNo | |||||||||||
contributor | |||||||||||
printOnlineChoice | |||||||||||
library | |||||||||||
opusType | |||||||||||
auctionExhibition | |||||||||||
provenance | |||||||||||
library |
"library" and "provenance" filters
There are two filter attributes that can be used for filtering things belonging to a specific contributor institution: library and provenance.
- library is an attribute belonging to items; it is "artificially" copied into the corresponding item owning instance (during the indexing), and as consequence of that, it is available at instance or publication level. The typical usage scenario is when you may want to get back a list of publications (or instances) that have at least one item belonging to a given library/member/provenance.
- the provenance attribute has been introduced in SVDE-8447 (therefore in Share-VDE 3.0.0 and 2.5.0 or higher). It is on every core entity (i.e. Opus, Work, Instance, Item, Agent), it is a multivalued attribute and contains the list of provenances that contributed to a given entity. It can be used
- in the /stats component, for retrieving counts by provenance
- in contexts (see for example the NATBIB tenant) where there are no items in the knowledge base. In such a context the "library" attribute it is not available because as said above, it is derived from items.
REST Examples
Example #1: publications having 1982 as year
filter=publicationYear:1982
Example #2: publications having year between 1982 and 1999
filter=year:[1982 TO 1999]
Example #3: publications having year up to 1999
filter=year:[* TO 1999]
Example #4: publications having year from 1982
filter=year:[1982 TO *]
Example #5: publications having 1982 or 1999 as year
filter=year:1982 OR year:1999
Example #6: publications having 1982 or in range between 1999 and 2020
filter=year:1982 OR year:[1999 TO 2020]
Example #7: works having a specific language
filter=language:"https://svde.org/languages/ita"
Example #8: works having one or another language
filter=language:"https://svde.org/languages/ita" OR language:"https://svde.org/languages/fre"
Example #9: publications having a specific publication year and published in specific place
filter=publicationYear:1982&filter=language:"https://svde.org/places/28372837"
GraphQL Examples
Example #1: publications having 1982 as year
filters:["publicationYear:1982"]
Example #2: publications having year between 1982 and 1999
filters:["year:[1982 TO 1999]"]
Example #3: publications having year up to 1999
filters:["year:[* TO 1999]"]
Example #4: publications having year from 1982
filters:["year:[1982 TO *]”]
Example #5: publications having 1982 or 1999 as year
filters:["year:1982 OR year:1999"]
Example #6: publications having 1982 or in range between 1999 and 2020
filters:["year:1982 OR year:[1999 TO 2020]"]
Example #7: works having a specific language
filters:["language:\"https://svde.org/languages/ita\""]
Example #8: works having one or another language
filters:["language:\"https://svde.org/languages/ita\" OR language:\"https://svde.org/languages/fre\""]
Example #9: publications having a specific publication year and published in specific place
filters:["publicationYear:1982", "language:\"https://svde.org/places/28372837\""]