Data Formats
Structured data formats used by EUlabel -- JSON-LD, schema.org, and GS1 Web Vocabulary.
EUlabel outputs passport data in formats aligned with GS1 standards, EU regulatory requirements, and web interoperability best practices.
Format overview
| Format | Standard | Purpose |
|---|---|---|
| JSON-LD | W3C JSON-LD, schema.org, GS1 Web Vocabulary | Primary structured data for passport content |
| Linkset | RFC 9264 | Machine-discoverable link collections from the resolver |
| OpenAPI | OpenAPI 3.1 | REST API documentation and SDK generation |
JSON-LD: Primary data format
Product passport data is serialized as JSON-LD using schema.org as the semantic anchor, extended with GS1 Web Vocabulary terms where schema.org lacks coverage.
JSON-LD ensures that passport data is:
- Machine-readable by search engines, AI agents, and regulatory systems
- Interoperable across platforms without proprietary data mappings
- Discoverable when embedded in HTML pages
Example: Wine passport as JSON-LD
{
"@context": ["https://schema.org", "https://www.gs1.org/voc/"],
"@type": "Product",
"name": "Quinta dos Carvalhais Alfrocheiro 2019",
"gtin": "05601012012200",
"brand": {
"@type": "Brand",
"name": "Quinta dos Carvalhais"
},
"countryOfOrigin": {
"@type": "Country",
"name": "Portugal"
},
"hasIngredientList": [
{
"@type": "gs1:FoodBeverageTobaccoIngredientDetails",
"ingredientName": "Grapes (Alfrocheiro)",
"ingredientContentPercentage": 99.986
},
{
"@type": "gs1:FoodBeverageTobaccoIngredientDetails",
"ingredientName": "Sulphites",
"ingredientContentPercentage": 0.014
}
],
"hasAllergen": [
{
"@type": "gs1:AllergenDetails",
"allergenType": "https://gs1.org/voc/AllergenTypeCode-AS",
"allergenLevelOfContainment": "CONTAINS"
}
],
"nutritionInformation": {
"@type": "NutritionInformation",
"servingSize": "100 mL",
"calories": "84 kcal",
"fatContent": "0 g",
"carbohydrateContent": "1 g",
"sugarContent": "0.1 g",
"proteinContent": "0 g",
"sodiumContent": "0 g"
}
}Content negotiation
Request Accept: application/ld+json from the passport endpoint to receive JSON-LD instead of the default JSON response:
curl https://api.eulabel.eu/v1/products/a1b2c3d4-.../passport \
-H "Authorization: Bearer sk_live_..." \
-H "Accept: application/ld+json"Embedding in HTML
Structured data is embedded in passport web pages using a <script> tag, invisible to consumers but discoverable by machines:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Quinta dos Carvalhais Alfrocheiro 2019",
"gtin": "05601012012200"
}
</script>This satisfies two requirements simultaneously: a human-readable passport page for consumers and a machine-readable dataset for regulators and search engines.