The
...
Annotation API is
...
allows users to search, obtain and contribute annotations about items in Europeana. Annotations are user-contributed or
...
software-generated enhancements, additions or corrections to (or a selection of) metadata or
...
content resources. We adopted the Web Annotation Data Model as a base model for the representation of annotations and as a format for exchanging annotations between client applications and the API, but also the Web Annotation Protocol as base
...
protocol for the API.
...
Please note that this API is in an Alpha state, you can use your regular API key for GET requests in this API Using the PUT/POST/DELETE methods for this API is currently not publicly available.. You can request access to the write methods by emailing us with your use case. We have also listed some test API keys you can use below. Before starting to use this API, we recommend reading the Terms of Use. If you want to get started with this API, go directly to the Getting Started section or try it out directly on the Console. If you want to get regular updates about the Europeana API, provide feedback and discuss it with other developers, we suggest joining the Europeana API discussion group at Google Groups.
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Tip |
---|
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The Annotation Data Model
Anchor | ||||
---|---|---|---|---|
|
What are annotations?
Annotations (in the Europeana context) are user-contributed or
...
software-generated enhancements to (a selection of) metadata or
...
content resource. The Annotations API adopted the Web Annotation Data Model (
...
WADM) as a base model for representing and exchanging annotations between client applications and the API.
...
The WADM is a W3C recommendation that describes a model and format to share annotations across different platforms.
Please note that, even though we have adopted
...
WADM as underlying data model for this API, it is not expected that we support the full extent of the model. We thus advise to look at the EDM Annotations Profile which describes the basics of our implementation and, in particular, the section on Annotation Scenarios for a comprehensive list of the different kinds of annotations that we support.
Basics of the model
In
...
WADM, an annotation is essentially a reified relation between two or more resources, typically a body and a target, and conveys that the body reflects what is intended to be said about the target. A body can also be absent to describe situations where a target is simply bookmarked. A target can represent a resource or just a part of it that is being annotated.
Being reified as a class enables an annotation to be further described with a motivation which expresses the reason why the annotation was created but also some provenance information such as the user that created the annotation and the software application that was used, as well as the times when it was initially created and sent to the API.
Representation in JSON-LD
Annotations
Expand | |
---|---|
|
...
| ||||||||||||
|
...
|
...
|
...
|
...
|
...
generator
|
...
|
...
|
...
|
...
|
...
|
...
|
...
Agent
...
|
...
via
...
String
...
The URL of the annotation, if available in an external service.
|
...
|
...
Field
...
Datatype
...
|
...
|
...
Semantic Resource
...
|
...
name
...
String
...
The name of the agent. Either the name of the user that created the annotation, or the name of the client software that was used to create it.
...
homepage
...
String
...
The homepage of the user or client application, if available.
|
...
title | Table of all fields specific to the Semantic Resource Class in the Annotation Data Model |
---|
...
Field
...
...
Description
...
type
|
...
title | Table of all fields specific to the Media Resource Class in the Annotation Data Model |
---|
...
Field
...
Datatype
...
Description
|
...
Expand | |
---|---|
|
...
|
...
Field name | is the field mandatory? | Field Value | Datatype | Description |
---|---|---|---|---|
@context | O | M | N/A | M |
id | O | M | N/A | M |
type | O | M | N/A | M |
created | O | M | N/A | M |
creator | M | M | N/A | M |
generated | O | M | N/A | M |
generator | O | M | N/A | M |
motivation | M | M | N/A | M |
body | O | M (either body or bodyValue) | N/A | M (either body or bodyValue) |
bodyValue | O | M (either body or bodyValue) | N/A | M (either body or bodyValue) |
target | M | M | N/A | M |
O means that the field is Optional, M means that the Field is Mandatory. Note that for all fields, whether they’re Optional or Mandatory, if they’re used it is mandatory to give the field a value and a Description.
...
title | Example of the annotation model |
---|
...
| |
SHOW A DYNAMIC EXAMPLE |
Application Scenarios
Because annotations are a very flexible construct, in theory, any kind of information could be represented as an annotation. However, to guarantee consistency of the annotations and their proper display or reuse, a range of “use cases” for annotations were identified, modelled and implemented which we call application scenarios. This list can grow as new and relevant use cases are identified and proposed for adoption.
This section explains all the application scenarios that are presently supported with examples on how they are represented in the API.
The examples used in this Section are shortened versions of the Annotation Model which exclude administrative fields such as created, creator, generated, generator, you can find an example of a complete Annotation Data Model implementation here.
1. Tagging (without language)
A tag is a short textual label for a resource. It can be used to e.g. classify or name a resource. This scenario only applies when the language of the tag is not known, otherwise see the scenario described in the next Section.
Annotation | |
|
|
| The short text of the tag. It typically contains a single word or expression |
| The URL of the Item |
Expand | ||
---|---|---|
| ||
|
2. Tagging (with language)
A language tag is a short textual label for a resource that is qualified with a language. Similarly as the previous scenario, language qualified tags can be used to name or classify a resource.
Annotation | |
|
|
| A |
| The URL of the Item |
Expand | ||
---|---|---|
| ||
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
3. Semantic tagging
An annotation of a CHO with a semantic tag. A semantic tag is a tag from a controlled (linked data) vocabulary such as VIAF or AAT. As any other tag, semantic tags are typically used to classify a resource with the benefit of bring extra information to the annotation as the result of being a linked data resource.
Annotation | |
|
|
| The URL of the semantic resource being used to tag the item |
| The URL of the Item |
Expand | ||
---|---|---|
| ||
|
...
|
...
|
...
|
Annotation Scenarios
The Annotations API supports different types of annotations. This page explains the types of annotations that are currently supported, providing examples on how to represent them in the API.
The examples used in this Section are shortened versions of the Annotation Model, you can find an example of a complete Annotation Data Model implementation here.
Simple tags (without language)
A simple tag is a short textual description of a resource. This scenario only applies when the language of the tag is not known, otherwise see the scenario described in the next Section.
Examples: | church |
Requirement: | A maximum of 64 characters is allowed for a simple tag. A tag cannot be a URL. |
In the API: | Set the "motivation" to "tagging" and set the tag within the "bodyValue" field. |
Availability: | Since version 0.2.1. |
4. Geospatial tagging witch coordinates
An annotation of a CHO with a location given in geospatial coordinates (latitude, longitude, and optionally altitude). In addition, there can be a label expressing the name or address of the location.
Annotation | |
|
|
| A resource of type |
| The URL of the Item |
Expand | ||
---|---|---|
|
...
|
...
| ||
|
...
|
...
|
...
|
...
|
...
|
...
Simple tags (with language)
A simple tag is a short textual description of a resource.
Examples: | church |
Requirement: | A maximum of 64 characters is allowed for a simple tag. A tag cannot be a URL and the language information must be specified. |
In the API: | Set the "motivation" to "tagging" and set the tag within the "body" field as a Textual Body. |
Availability: | Since version 0.2.1. |
...
title | Example: tagging a Europeana item with the English word "painting" |
---|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
Semantic tags
A semantic tag is a tag to a resource from a controlled vocabulary, making it machine-interpretable.
...
Example:
...
This object in Europeana is somehow related to France (http://sws.geonames.org/2988507).
...
Requirement:
...
Any URI is accepted as semantic resource. In the future, it will be limited to a controlled list of acceptable domains.
...
In the API:
...
Set the "motivation" to "tagging" and set as body the URI for the semantic resource taken from a contolled vocabulary.
...
Availability:
...
5. Geospatial tagging with an address
An annotation of a CHO with a location given in geospatial coordinates (latitude, longitude, and optionally altitude). In addition, there can be a label expressing the name or address of the location.
Annotation | |
|
|
| A resource of type |
| The URL of the Item |
Expand | ||
---|---|---|
|
...
|
...
| ||
|
...
|
...
|
...
|
...
|
...
Object links
An object link is a relationship between two (Europeana) objects. This relationship can be any.
Example: | This object in Europeana is (in some way) similar to this object. |
Requirement: | An object link can only be made between two Europeana objects. |
In the API: | Set the "motivation" to "linking" and set as target an array containing the URIs of both objects. |
Availability: | Since version 0.2.1. |
...
title | Example: linking two Europeana items together. |
---|
...
|
...
|
...
|
...
|
...
|
...
|
...
Geo Tags
...
Object links
Object links
An object link is a relationship between two (Europeana) objects. This relationship can be any.
Example: | This object in Europeana |
...
is (in some way) similar to this object. | |
Requirement: | An object link can only be made between two Europeana objects. |
In the API: | Set the "motivation" to " |
...
linking" and |
...
set as target an array containing the URIs of both objects. | |
Availability: | Since version 0.2. |
...
1. |
Expand | ||
---|---|---|
|
...
| ||
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
Annotating media resources
Annotating a media resource means that the target of the annotation is not the Europeana item but instead a specific media resource within that item.
In the API: | Set the "target" of the annotation to a JSON object with the "scope" holding the unique identifier of the Europeana item and the "source" field the URL of the actual media resource being annotated. |
Availability: | Since version 0.2.8. |
Expand | ||
---|---|---|
| ||
|
Transcriptions
A transcription is typically an annotation expressing a relation between an image and the text that is represented on that image. Besides the text, the annotation can also refer to a page where the text is displayed, like in the example below.
In the API: | Set the "motivation" to "transcribing" and apply the same criteria as for media resources. |
Availability: | Since version 0.2.8. |
Expand | ||
---|---|---|
| ||
Example: annotating the image of an Europeana item with the transcription page available at Transcribathon.
|
Getting Started
Access keys
While this API is in an Alpha state you will need to use a separate API key (other than for the main Europeana REST API) to start using it. You can use the following keys:
Environment | Details |
---|---|
Test | API key apidemo with user token tester1 (allows to create, update & remove annotations on behalf of a test user in the Annotations API test environment). |
Production | API key apidemo (allows to search and retrieve annotations in the Annotations API production (live) environment). |
Creating annotations in the production (live) environment is currently limited to only selected partners, this will be opened up as part of the Beta release.
Request
Every Annotations API call is an HTTP request in a specified format that is sent to the Annotations API service. The API root URLs for the two environments are located at:
https://test-annotations.europeana.eu/annotation (test)
https://www.europeana.eu/api/annotations (production)
Response
This API only supports the JSON-LD format, which is the Linked Open Data version of JSON (with the same syntax as JSON). The request and response format does not need to be passed along to the API, if not provided it will fallback to the default. You can provide the format either via the URL (extension) or via the "Accept" header. To specify the request and response format you can either do:
/search.jsonld?wskey=xxxxx&query=*:*
Or:
Request header: "Accept: application/ld+json"
/search?wskey=xxxxx&query=*:*
Authentication
For reading requests (GET) you need to authenticate by passing along your API key as the wskey parameter. Example (replace YOUR_KEY with your API key):
/search?wskey=YOUR_KEY&query=*:*
For writing requests (POST/PUT/DELETE) on behalf of a user you need to pass along your API key as the wskey parameter along with a user token as the userToken parameter. Example (replace YOUR_KEY with your API key and YOUR_TOKEN with the user token):
/create?wskey=YOUR_KEY&userToken=YOUR_TOKEN&query=*:*
Error Codes
An error during processing of an API method is reported by (1) a relevant HTTP status code, (2) a value of the success field and (3) a meaningful error message in the error field.
The following HTTP status codes are returned:
Expand | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Annotation API Methods
Search
...
Retrieving annotations
Retrieve annotations by their identifier.
GET /{provider}/{identifier}
Response
Expand | ||
---|---|---|
| ||
|
See data model for more information on the representation of an annotation.
Discovery
Search for annotations.
GET /search
Request
Expand | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
|
Search and Facet fields
The following table shows the fields that can be used for searching annotations and the ones that can be used for faceting:
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
...
body_uri
...
keyword
...
yes
...
complete identifier of the resource within the body of an Annotation, applies to e.g. semantic tagging
...
target_uri
...
keyword
...
yes
...
complete identified of the target(s) of an Annotation
...
target_record_id
...
keyword
...
yes
...
local identifier of a record when the target is a record (/collectionId/objectId)
...
link_resource_uri
...
keyword
...
yes
...
complete identifier of the resource being linked to (ie. through the relation property)
...
link_relation
...
keyword
...
yes
...
property being used to link two resources.
Response
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
Note that providing *:* as a search query means you will get all annotations. |
Create
The API has a generic method available for the creation of annotations. The creation method expects a body payload in the request with the full annotation. Alternatively you can provide this information as part of the body parameter.
Request
...
title | Example Request for the Create method in the Annotation API |
---|
An example to create a simple tag:
...
|
Response
Expand | ||
---|---|---|
| ||
|
...
|
...
|
...
|
...
Note that the motivation for a simple and a semantic tag is always "tagging", whereas the motivation for object linking scenarios is "linking".
Response
...
title | Example Response to a Create request in the Annotation API |
---|
Response to the example request:
...
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
Note that providing *:* as a search query means you will get all annotations. |
Provision
Using the PUT/POST/DELETE methods for this API is currently not publicly available.. You can request access to the write methods by emailing us with your use case.
Create
The API has a generic method available for the creation of annotations. The creation method expects a body payload in the request with the full annotation. Alternatively you can provide this information as part of the body parameter.
Request
Expand | ||
---|---|---|
| ||
An example to create a simple tag:
|
...
For more examples and information on the data model for an annotation, see data model.
Read
Retrieve annotations by their identifier.
...
Note that the motivation for a simple and a semantic tag is always "tagging", whereas the motivation for object linking scenarios is "linking". |
Response
Expand | ||
---|---|---|
|
...
|
...
| |
Response to the example request:
|
...
|
...
|
...
|
...
|
...
For more examples and information on the
...
data model for an annotation, see data model.
Update
Update the contents of an annotation. For this you can send a PUT request to the ID of the annotation. You can only update the annotations you have created yourself.
PUT /base/1
Request
You can provide the same content in the Update method as you’d provide for the Create method. Note that you have to provide the full annotation body, you currently cannot update parts of the annotation.
Expand | ||
---|---|---|
| ||
|
Response
Expand | ||
---|---|---|
| ||
|
Delete
Delete an annotation. You can send a DELETE HTTP request using the ID of the annotation. You can only delete the annotations you have created yourself. Deletion means the annotation will not be available anymore for search, and only available for retrieval based on the ID of the annotation.
DELETE /base/1
Request
Code Block |
---|
DELETE /collections/1 HTTP/1.1 |
Response
Code Block |
---|
HTTP/1.1 204 NO CONTENT
Content-Length: 0 |
Roadmap and Changelog
...
We deploy new versions of this API quite regularly. It is currently available as a Public Alpha, which is the first public version released primarily to get feedback from you. Do note that this means that changes can be introduced which could break backwards compatibility
...
. To see the changes made for the current version and also all previous releases, see the API changelog in the project GitHub.
Credits
This API was initially developed as part of the Europeana Sounds project. It's development has been carried out by the AIT Austrian Institute of Technology in cooperation with the Europeana Foundation.