Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Formats supported by the APIs

...

Linked Data formats

Linked data can be represented (ie. serialized) in various character based formats, some very well known such as JSON or XML and others that are very specific such as Turtle, N3 or N-Triples. All these formats are in fact formats for representing the RDF structure which Linked Data is based on.

The support for Linked Data formats vary between Europeana APIs, however, JSON-LD is always supported followed by RDF/XML for some APIs. This section presents a brief explanation of these formats and a guide to help better understand the terminology used when defining the data structures for each API.

Expand
titleList of formats and respective file extensions and media types

Format

Extension

Media type (previously referred to as mimetype)

JSON-LD

.jsonld

application/ld+json (normative)

application/json

RDF/XML

.rdf (normative)

.xml

application/rdf+xml (normative)

application/xml

text/xml

rdf/xml

Turtle

.ttl

text/turtle (normative)

application/turtle

application/x-turtle

N3

.n3

text/n3 (normative)

text/rdf+n3

application/n3

N-Triples

.nt

application/n-triples (normative)

application/ntriples

text/nt

JSON-LD

JSON for Linking Data (JSON-LD) is a syntax for representing Linked Data, more concretely RDF, in JSON.

All Europeana APIs that are conformant with Linked Data support JSON-LD in the compacted form which uses rules specified in a document called “context” that simplify the Linked Data structure while making it easier to ready by humans and develop against. The context(s) is typically found at the top of a JSON document like in the following example:

Code Block
languagejson
{
  "@context": "http://www.europeana.eu/schemas/context/entity.jsonld",
  ...
}

Expand
titleWhen defining the data structures for JSON-LD, the documentation uses the following terminology:

Format

Description

Corresponding representation in JSON

String

A character string

"value"

Integer

An integral number (ie non-floating point)

123

Number

A floating point number

123.4

Array

A JSON array

Code Block
[
  ...
]

Object

A JSON map

Code Block
{
  ...
}

LangMap

A JSON map where the keys are two letter ISO639 language codes

Code Block
{
  "en": "value",
  "fr": "value"
}

LangObject

A JSON map contain one mandatory field “@value“ and an optional field “@language“ containing a two letter ISO639 language code

Code Block
{
  "@value": "value",
  "@language": "en"
}

RDF/XML

Similar to JSON, there is also a syntax for representing Linked Data (ie. RDF) in XML called RDF/XML.

All Europeana APIs that are conformant with Linked Data support RDF/XML, however, they use a more restrictive structure than what is defined in RDF/XML which is defined in the EDM.xsd schema. In particular, it uses a specialization of the RDF/XML-ABBREV form where class declarations replace rdf:Description with the rdf:type of the class and makes use of a flatten structure as opposed to nesting.

Supported output formats

This API supports both JSON-LD and RDF/XML formats, which is the Linked Open Data version of JSON (with the same syntax as JSON). The format for the response does not need to be passed along to the API, if not provided it will fall back to the default.

...