GS1 Web Vocabulary Joins Smart Data Models: 6 Candidate Models for Products, Organizations, Places and Offers

Smart Data Models’ Candidates repository now includes a new candidate standard translated from the GS1 Web Vocabulary: gs1-web-vocabulary, with 6 candidate models for products, food and beverage products, wearable products, organizations, places and offers. The vocabulary is published by GS1 under Apache-2.0. Like every candidate, each model comes with a JSON Schema, an NGSI-LD @context and all four example serializations (NGSI-v2 and NGSI-LD, key-values and normalized), each validated against its schema.

About the GS1 Web Vocabulary

The GS1 Web Vocabulary is GS1’s RDF vocabulary for publishing product, organization, location and offer data on the web, tied to GS1 identifiers (GTIN for products, GLN for parties and locations) and to GS1 Digital Link. It extends schema.org with the attributes of GS1 master data: net content and dimensions, packaging, allergens, ingredients, nutrition, certifications, apparel and footwear attributes, organization roles, prices and discounts. Version 1.18, the one translated here, has 120 classes, 557 properties and 63 code lists.

The models

Model GS1 class GS1 attributes Example
Product Product 95 A cordless drill (synthetic)
FoodBeverageTobaccoProduct FoodBeverageTobaccoProduct, with Beverage, FruitsVegetables, MeatPoultry, dairy and Seafood 201 A real hazelnut spread, from Open Food Facts
WearableProduct WearableProduct, with Clothing and Footwear 116 A trail running shoe (synthetic)
Organization Organization 31 A retailer (synthetic)
Place Place 24 The retailer’s store (synthetic)
Offer Offer 13 The store’s offer of the real product (synthetic)

The models are linked by GS1’s own relations: a product has a brandOwner and a manufacturer, an offer has an itemOffered, a seller and a place where it is availableAtOrFrom, and a place is occupiedBy an organization. In NGSI-LD these become Relationships.

Grounded in real data

The food example is a real product record from Open Food Facts (Open Database License): a 400 g jar of hazelnut and cocoa spread, with its GTIN, names in three languages, its allergens (milk, nuts and soy, as GS1 allergen codes) and its nutrition values per 100 g in GS1’s nutrient attributes. Only label facts are used. The retailer, store and offer around it are fictitious, and the other products use GS1’s demonstration prefix 950 for their GTINs and GLNs.

Translation notes

  • GS1 names, verbatim. Every attribute keeps its GS1 name. The only exception is an organization’s location, renamed gs1Location because location is reserved in NGSI-LD.
  • Code lists as GS1 IRIs. Coded values (allergens, organization and location roles, payment methods…) are GS1 code-list members such as gs1:AllergenTypeCode-AM, validated against the 55 code lists the models use, and expand to the official GS1 IRIs.
  • Multilingual text. Product names, descriptions and other texts are language maps, one entry per language, as in GS1.
  • Subclasses folded in. The specific product classes (beverages, seafood, clothing, footwear…) are folded into their parent model, with a gs1Class attribute saying which one applies.
  • Details nested. Allergen, nutrition, packaging, certification, price and other detail objects keep their full GS1 structure inside the entity.

Try it, and tell us what’s missing

These are Candidates: first, carefully sourced translations that are not yet official Smart Data Models subjects. Smart Data Models has no retail product subject yet, so this fills a gap. The main open questions are the generic type names Organization (already in dataModel.Organization) and Product (also in the UNTP candidate), and how GS1 products should link to digital product passports.

Browse the models, open an issue, or send a PR:
👉 https://github.com/smart-data-models/Candidates/tree/master/standards/gs1-web-vocabulary

DCSA Track & Trace Joins Smart Data Models: 3 Candidate Models for Container Shipping Events

Smart Data Models’ Candidates repository now includes a new candidate standard translated from the Digital Container Shipping Association (DCSA): dcsa-track-and-trace, with 3 candidate models for the events of container shipping: shipment, transport and equipment events. The DCSA Track & Trace specification is published under Apache-2.0. Like every candidate, each model comes with a JSON Schema, an NGSI-LD @context and all four example serializations (NGSI-v2 and NGSI-LD, key-values and normalized), each validated against its schema.

About DCSA Track & Trace

DCSA is the association of the major ocean container carriers, and it publishes open digital standards for the industry: booking, electronic bill of lading, vessel schedules, port calls and more. Track & Trace 2.2.0, the standard translated here, defines the events a carrier publishes about a shipment, offered both as a polling API and as subscriptions that push events as they happen.

The models

Model What it reports Attributes Event codes
ShipmentEvent Status of a booking or transport document 16 received, confirmed, issued, surrendered, on hold, released…
TransportEvent Arrival or departure of a vessel, barge, train or truck at a transport call 18 ARRI, DEPA (actual, planned or estimated), with SMDG delay reasons
EquipmentEvent What happens to a container 21 loaded, discharged, gated in/out, stuffed, stripped, inspected…

One consistent example shipment

DCSA publishes no open event data, so the examples are synthetic, and say so. They follow one fictitious shipment: a booking is confirmed, container CSQU3054383 (the sample number of ISO 6346) is loaded laden and sealed at the Port of Rotterdam, and the vessel departs on its export voyage, delayed by weather. The codes are real DCSA, UN/LOCODE and SMDG values; the vessel, voyage and booking are invented.

Translation notes

  • DCSA names, verbatim. Every field keeps its DCSA name (eventClassifierCode, equipmentReference, UNLocationCode…). Each @context maps it to its definition in the DCSA OpenAPI specification.
  • Nested where DCSA nests. The transport call (with its vessel and location), seals and document references keep their full DCSA structure.
  • Ready for geo-queries. Transport and equipment events get an NGSI-LD location (GeoJSON point) built from DCSA’s own coordinates. It is the only addition to the DCSA content.
  • Current fields only. Fields that DCSA has deprecated are left out. One small inconsistency in the specification, the document reference codes, was aligned with DCSA’s own examples and is documented in the metadata.

Try it, and tell us what’s missing

These are Candidates: first, carefully sourced translations that are not yet official Smart Data Models subjects. Before that step, the main open question is overlap with dataModel.MarineTransport (vessels, port calls, bookings and EDIFACT container gate reports) and with the SIMPLE logistics candidates. Natural next steps are DCSA’s Just-in-Time Port Call and Operational Vessel Schedules standards, which bring port operations into the picture.

Browse the models, open an issue, or send a PR:
👉 https://github.com/smart-data-models/Candidates/tree/master/standards/dcsa-track-and-trace

New pysmartdatamodels Version 0.8.2.0: Semantic Identification for Data Spaces

We are happy to announce a new release of our Python package, pysmartdatamodels, version 0.8.2.0. The headline feature is aimed squarely at data spaces: a new function that can give semantic meaning to a payload even when the party who sent it never provided one.

What’s New in This Version?

Semantic identification for data spaces: identify_or_draft_datamodel()

In a data space, you routinely receive payloads from other participants with no guarantee they follow any particular standard. identify_or_draft_datamodel() takes any such payload and does one of two things:

  • If it recognizes the payload as an existing Smart Data Model, it returns that model’s real schema, together with a full validation of the payload against it.
  • If it doesn’t, it drafts a brand new schema.json on the spot — following the same structural conventions as a real Smart Data Model — so you have a ready-to-review starting point instead of nothing at all.

It accepts the payload in any of the three formats actually used in practice — plain key-values, NGSI-v2 normalized, or NGSI-LD normalized — detecting and handling the right one automatically:

from pysmartdatamodels import pysmartdatamodels as sdm

payload = {
    "id": "urn:ngsi-ld:WeatherObserved:station-042",
    "type": "WeatherObserved",
    "temperature": 21.5,
    "relativeHumidity": 0.6
}

result = sdm.identify_or_draft_datamodel(payload)
print(result["schema"]["source"])   # "existing" -- it recognized WeatherObserved
print(result["schema"]["validation"]["result"])  # True

When the payload’s own “type” doesn’t match anything, you can optionally ask it to try a softer, attribute-based match against the whole catalog before giving up and drafting a new schema:

result = sdm.identify_or_draft_datamodel(payload, fuzzy=True, fuzzy_threshold=0.3)

And when nothing matches at all, the drafted schema isn’t just a bare shape guess — any attribute whose name is already established elsewhere in the catalog (over 160,000 attribute definitions) gets its real description, model reference, and units reused automatically, so only genuinely new attributes are left with a plain TODO placeholder.

A real validate_payload()

validate_payload(datamodel, subject, payload) existed before but didn’t actually validate anything. It now runs full JSON Schema validation against the live schema of the data model you name, confirms the payload’s “type” matches, and separately flags – without failing – any attribute that isn’t part of the official definition.

Reliability and performance fixes

  • generate_sql_schema() no longer crashes on attributes that can hold more than one type (e.g. a Property that can also be a Relationship), and no longer generates colliding enum type names when two unrelated models happen to share an attribute name.
  • validate_data_model_schema() no longer terminates your entire Python process on a bad input — it returns an error result like every other function in the package.
  • The ~160,000-entry attribute database is now cached in memory instead of being re-read from disk on every single function call — noticeably faster for any code calling the per-attribute lookup functions in a loop.

Get the Latest Version

Update your installation with:

pip install --upgrade pysmartdatamodels

➔️ Get the package on PyPI

New pysmartdatamodels Version 0.8.1.0: Refreshed Data (reduced size 20 times with same functionality)

We are happy to announce a new release of our Python package, pysmartdatamodels, version 0.8.1.0, with a refreshed attribute database, a smaller download, and a cleanup of some leftover dead code.

What’s New in This Version?

Refreshed Data, End to End

The package’s bundled data — the official list of data models, the attribute metadata, and the full attribute database — had gone stale. Fixing this surfaced two real issues in our own publication pipeline, now resolved:

  • One data model repository had accidentally been left private, which was silently breaking the daily metadata regeneration every time it ran.
  • The database backing the attribute export (see below) was far less complete than it should have been. It’s now fully backfilled: 164,926 attribute records across all 82 subjects.

As always, you don’t need to upgrade the package just to get fresh data — calling update_data() pulls the latest information directly:

from pysmartdatamodels import pysmartdatamodels as sdm
sdm.update_data()

Smaller Install, Compressed Attribute Database

The full attribute database is now shipped gzip-compressed inside the package (~5MB instead of ~110MB) — the installed package footprint drops from over 100MB to under 10MB. This is fully transparent if you use the documented functions (load_all_attributes(), description_attribute(), etc.) — nothing changes in how you call them.

The same compressed file is now also available for direct download, alongside the existing uncompressed one, from the attribute database export page.

Cleanup

Removed a small piece of dead code in generate_sql_schema() left over from an earlier implementation — no change in behavior, just a cleaner function. Thanks to the community member who originally reported it.

Get the Latest Version

Update your installation with:

pip install --upgrade pysmartdatamodels

➡️ Get the package on PyPI

New pysmartdatamodels Version 0.8.0.11: More Reliable SQL Schema Generation

We are happy to announce a new release of our Python package, pysmartdatamodels, version 0.8.0.11, focused on making the SQL schema generation function more robust, fixing how the package exposes its functions, and keeping our GitHub source and published package in sync.

What’s New in This Version?

More Reliable SQL Schema Generation

The generate_sql_schema() function, which turns a data model’s model.yaml into a ready-to-use PostgreSQL CREATE TABLE statement, received three fixes:

  • Column names are now properly quoted, so attribute names that are reserved words or mixed case no longer produce invalid SQL.
  • Properties using anyOf are now supported, in addition to oneOf.
  • The function no longer emits a duplicate id column in the generated schema.

Example:

from pysmartdatamodels import pysmartdatamodels as sdm

sql = sdm.generate_sql_schema("https://raw.githubusercontent.com/smart-data-models/dataModel.Weather/master/WeatherForecast/model.yaml")
print(sql)

More Usable Imports

You can now import the package’s main functions directly from the top level, instead of always going through the submodule:

from pysmartdatamodels import generate_sql_schema, load_all_datamodels

The documented usage pattern below continues to work exactly as before:

from pysmartdatamodels import pysmartdatamodels as sdm

Repository Housekeeping

The source code published on GitHub and the package published on PyPI had drifted apart over the last few releases. With this version, both are back in sync, so what you see in the repository is exactly what you get when you pip install the package.

Get the Latest Version

Update your installation with:

pip install --upgrade pysmartdatamodels

➡️ Get the package on PyPI

Our Commitment to Open and Interoperable Data

We are committed to making data interoperability easier for everyone. Thanks to everyone in the community who reports issues and helps us keep improving pysmartdatamodels!

New candidate models: SIMPLE’s Business Service extensions to FEDeRATED

Nine new candidate data models are now available in the Smart Data Models Candidates repository, covering business transactions and logistics services for road and rail freight, translated from the SIMPLE project’s extensions to the FEDeRATED Business Service ontology.

The models cover the full lifecycle of a freight movement: Consignment and Shipment (with delivery time windows and an eFTI UID for EU-Gate interoperability), TransportService and CargoHandlingService, and five order types used at cargo terminals — CargoHandlingOrder, DischargeOrder, GateInOrder, GateOutOrder and ShuntingOrder.

These models are grounded in the ontology published at vocab.plataformasimple.es and its imported FEDeRATED Business Service base ontology, with each entity’s schema reflecting the full set of inherited attributes — including required fields drawn directly from the base ontology’s own cardinality constraints.

Explore the models: standards/simple-federated-businessservice in the Candidates repository.

New candidate model: SIMPLE’s Digital Twin extension to FEDeRATED (CMR)

A new candidate data model is now available in the Smart Data Models Candidates repository: CMR, the international road freight consignment note (“carta de porte”), translated from the SIMPLE project’s extension to the FEDeRATED Digital Twin ontology.

CMR documents are the standard legal paperwork accompanying road freight shipments across most of Europe. The model captures its identifying attributes (document ID, version, type, MRN number) and external identifiers, ready to be linked from a business transaction.

Explore the model: standards/simple-federated-digitaltwin in the Candidates repository.

New candidate models: SIMPLE’s Event extensions to FEDeRATED

Twenty new candidate data models are now available in the Smart Data Models Candidates repository, covering road and rail logistics events translated from the SIMPLE project’s extensions to the FEDeRATED Event ontology.

The models cover terminal movements (GateInEvent, GateOutEvent), generic transport (VehicleArrivalEvent, VehicleDepartureEvent, PassingEvent), workforce time tracking (ClockInConfirmationEvent, ClockOutConfirmationEvent), incident reporting (IssueEvent), and the complete eCMR (electronic Consignment Note) document lifecycle — creation, sender/carrier/consignee signatures and comment edits, destination and load changes, cancellation, and signature invalidation.

Every event links back to the business transaction, digital twin and location it concerns, so these events compose directly with the recently added simple-federated-businessservice candidate models.

Explore the models: standards/simple-federated-event in the Candidates repository.

New candidate models: SIMPLE’s Logistic Roles extensions to FEDeRATED

Two new candidate data models are now available in the Smart Data Models Candidates repository, covering role-based context for logistics locations and drivers, translated from the SIMPLE project’s extensions to the FEDeRATED Logistic Roles ontology.

Driver represents a person driving a vehicle, referenced directly by the sibling Business Service candidate’s TransportService entity. LocationRole captures the role a physical location plays in a specific transport context — port of loading, place of delivery, gate-in location, and 15 other role types — tied to the transport means and event it relates to.

These models are grounded in the ontology published at vocab.plataformasimple.es, which itself republishes the FEDeRATED project’s Logistic Roles taxonomy in full alongside SIMPLE’s own additions.

Explore the models: standards/simple-federated-logisticroles in the Candidates repository.

New candidate model: SIMPLE’s Physical Infrastructure extension to FEDeRATED

A new Location candidate model is now available in the Smart Data Models Candidates repository, translated from the SIMPLE project’s extension to the FEDeRATED Physical Infrastructure ontology.

The model adds the contact details (address, email, telephone) SIMPLE requires on any physical logistics location — terminals, warehouses, ports and similar facilities — alongside location-role and containment relationships carried over from the base ontology.

Explore the model: standards/simple-federated-physicalinfrastructure in the Candidates repository.