SAREF4ENER & SAREF4ENVI Join Smart Data Models: 116 Candidate Models for Energy Flexibility and Environment

Smart Data Models’ Candidates repository now includes two new candidate standards translated from ETSI’s SAREF (“Smart Applications REFerence”) ontology family: saref4ener and saref4envi, together contributing 116 candidate models. Both are official ETSI Technical Specifications, each with a normative PDF and a published Turtle/JSON-LD/RDF-XML ontology, and both ship the full Candidates artifact set — a JSON Schema, an NGSI-LD @context, and all four example serializations (NGSI-v2 and NGSI-LD, key-values and normalized) — validated against its own schema.

SAREF4ENER — 61 models

SAREF4ENER (ETSI TS 103 410-1) is the SAREF extension for energy flexibility and demand-response: the vocabulary behind smart appliances, batteries, and loads that can shift or modulate their power consumption in response to grid signals or incentives. It covers seven distinct “flexibility profile” shapes (power-envelope, power-limit, fill-rate, incentive-table, demand-driven, operation-mode…), the request/offer/instruction messages exchanged between a flexibility provider and a grid operator, load-control events and states, and the generic data-point/time-series building blocks used throughout.

Category Models Examples
Flexibility profiles & elements 14 PowerEnvelopeProfile, FillRateProfile, IncentiveTableProfile, OperationModeProfile
Instructions (one per profile type) 10 OMBCInstruction, FRBCInstruction, PEBCInstruction, DDBCInstruction
Flexibility communication 3 FlexRequest, FlexOffer, FlexibilityInstruction
Load control 4 LoadControlEventData, LoadControlStateData, LoadControlEventAction
Power/energy constraints & limits 8 PowerConstraint, PowerLimit, FailsafePowerLimit, ContractualPowerLimit
Data & scheduling 7 DataPoint, TimeSeries, GaussianDataPoint, Slot, Timer
Core & other 15 Device, Storage, PowerSequence, Role, Incentive

Branch: saref4ener-candidates — PR not yet opened.

SAREF4ENVI — 55 models

SAREF4ENVI (ETSI TS 103 410-2)
covers two distinct worlds under one ontology: a lighting/light-pollution domain (lampposts, light points, illuminance/sky-brightness observations) and a full waste-management lifecycle — from a resident’s bin, through collection rounds, to treatment, disposal, and the emissions and secondary resources that treatment produces.

Category Models Examples
Buildings/urban 9 Building, City, Neighbourhood, CollectionOfBuildings
Waste treatment devices 14 Composter, AnaerobicDigester, IncineratorWithRecovery, Sorter
Collection 6 CollectionPoint, Depot, Itinerary, WasteCollectionVehicle
Treatment tasks & functions 8 WasteTreatmentTask, WasteDisposalFunction
Lighting 4 Light, LightPoint, Lamppost, ShieldedLamppost
Waste core / resources / emissions 11 Waste, FinalWaste, Resource, Emission
General 3 DigitalRepresentation, CommunicationInterface, CommunicationProtocol

A rich object-property graph (accepts, isProducedBy, isDepositedIn, becomes, followsItinerary…) is translated throughout as NGSI-LD Relationships between these models.

Branch: saref4envi-candidates — PR not yet opened.

Translation notes

  • Open vocabularies stay open. Both ontologies lean heavily on abstract “Kind” classification classes (WasteKind, ContainerKind, EmissionKind…) whose members are a small, fixed vocabulary rather than independently-instantiable things. Rather than creating dozens of near-empty entity types, these were folded into open/enumerated string attributes on the entities that actually reference them (e.g. Container.acceptedWasteKinds, Emission.emissionKind).
  • Names preserved verbatim. SAREF4ENVI’s own class and property names were already PascalCase/camelCase and needed zero renaming. SAREF4ENER’s profile/instruction naming (OMBCInstruction, FRBCInstruction, …) is kept exactly as the ontology defines it.
  • Inheritance flattened, not duplicated. Following the precedent set by this repo’s Gaia-X candidate, a subclass’s schema lists only its own attributes; inherited ones are documented in its description instead of repeated (e.g. SAREF4ENVI’s House/NonResidentialBuilding point back to Building/Perimeter).
  • License recorded exactly as found. Both ontologies’ dcterms:license resolves to ETSI’s own software license terms (BSD-3-Clause for SAREF4ENVI) — recorded in each standard’s standard-metadata.yaml for confirmation before promotion out of Candidates.

Try it, and tell us what’s missing

These are Candidates — first, carefully-sourced translations, not yet promoted to official Smart Data Models subjects. A few things are open and would benefit from community input before that step: license confirmation for the specific v2.1.1 releases, and a check for overlap with existing official subjects (dataModel.Device, dataModel.Environment,
dataModel.WasteManagement-adjacent models).

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

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.

New candidate model: SIMPLE’s Classifications extensions to FEDeRATED

A new candidate data model, Classifications, is now available in the Smart Data Models Candidates repository, translated from the SIMPLE project’s extensions to the FEDeRATED Classifications ontology.

Classifications is the controlled-vocabulary backbone shared across FEDeRATED’s logistics ontologies: document types, cargo/container/package/equipment types, dangerous goods and nature-of-cargo codes, transport modality and movement types, seal condition codes, and TEN-T core network corridor names. Rather than one entity type per code list, this candidate models a single generic Classifications entity — each instance a code value tagged with the specific scheme it belongs to — keeping the model proportionate to what is genuinely a taxonomy, not a set of independent entity types.

SIMPLE’s own contribution: CMR, the international road consignment note, added as a new DocumentType code value.

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