Check a schema validates a payload

If you want to check if a schema validates a payload  through this API call

Call: https://smartdatamodels.org/extra/validate_payload.php

Parameters: (Mandatories)

  • payloadUrl: The url of the payload in RAW version
  • schemaUrl: The link to the RAW version of the json schema (see example)

Example: https://smartdatamodels.org/extra/validate_payload.php?payloadUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Battery/master/Battery/examples/example.json&schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Battery/master/Battery/schema.json

Output: A json payload with these properties

  • result: Boolean. if the schema validates the payload.
  • time: time stamp in ISO 8601 (CET) of the validation
  • payloadUrl: The url of the payload in RAW version submitted
  • schemaUrl: The link to the RAW version of the json schema submitted

on error

  • cause: The description of the cause for the rejection to the validation

updated the contribution manual

The contribution manual (link in the upper menu of main page) is updated due to the change in the approach for documenting the data models.

Main changes:

  • Properties’ definitions are now included as an attribute in the json schema
  • The specification is generated automatically based on the json schema
  • Json schema has to pass a test to be approved.

See the rest of changes in the link

Create automatically the specification of your data model

The new version of the smart data models specification is on progress (most of the /doc directories of the data models have a version). If you want to check how this would look like you can have through this API call

Call: https://smartdatamodels.org/extra/create_spec.php

Parameters: (Mandatories)

  • dataModel: The name of the entity for the specification
  • schemaUrl: The link to the RAW version of the json schema (see example)
  • examplesUrl: the url of where the 4 examples required for a data model are available (named
  • notesUrl: The url to the yaml for the customization paragraphs (notesHeader, after the title, notesMiddle, after properties’ list and notesFooter by the end)
  • mail:  a valid mail of yours

Example: https://smartdatamodels.org/extra/create_spec.php?dataModel=Airport&schemaUrl=https://raw.githubusercontent.com/smart-data-models/incubated/master/Aeronautics/Airport/schema.json&examplesUrl=https://raw.githubusercontent.com/smart-data-models/incubated/master/Aeronautics/Airport/examples/&notesUrl=%22%22&mail=alberto.abella@fiware.org

Output: A markdown text that although the HTML visualization is faulty, the source code of the page can be pasted in any markdown viewer (optimized for github) and you see will see something like this.

We are on the transition to having all the data models compliant.

Data Models Contribution API

The schemas to be accepted in the Smart Data Model initiative need to include a description for every property. In order to review your data models before submission, it should pass this test.

Call: https://smartdatamodels.org/extra/check_schema.php

Parameters: (Mandatories)

  • schemaUrl: The link to the RAW version of the schema (see example)
  • mail: your mail
  • test: 1

Example: https://smartdatamodels.org/extra/check_schema.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Building/master/Building/schema.json&mail=alberto.abella@fiware.org&test=1

Output: A json payload with the list with of properties of the data model including those referenced through $ref and its status of documentation in the schema.

  • x-ngsi: Boolean. Describes if the description contains property, relationship or geoproperty in the description.
  • x-ngsi_text: Text. Further explanations about x-ngsi value.
  • documented: Boolean. If the description is complete enough for its use.
  • text: Text. complementary information about the documentation (It could be either incomplete or non-existing)

In order to be accepted all the properties have to include a relevant description, and therefore need to have both parameters x-ngsi and documented to True for all the properties.

We are on the transition to having all the data models compliant.

French translation of data models available

Most of the data models have a new file into its /doc directory name spec_FR.md. It contains a specification generated automatically based on the schema.json with all its texts translated into French. (With the deepL tool, so you can expect some ‘incorrect’ translated elements).

The official spec remains to be the spec.md file. However in coming days, the format, but not the name of this spec will change when the version named spec_EN-US.md will become official and it will replace the contents of spec.md.

Independently of what is happening the official version will always be spec.md.

Other languages, possibly German, Japanese and eventually Chinese are on the queue.

Spanish specification draft available

Most of the data models have a new file into its /doc directory name spec_ES.md. It contains a specification generated automatically based on the schema.json with all its texts translated into Spanish. (With the deepL tool, so you can expect some ‘incorrect’ translated elements.

The official spec remains to be the spec.md file. However in coming days the format, but not the name of this spec will change when the version named spec_EN-US.md will become official and it will replace the contents of spec.md.

Independently of what is happening the official version will be always spec.md.

Draft new specification

There is a new specification (in draft mode) in each directory (most of them) of the data models. It has the name spec_EN-US.md and it is drafting the new specification format for all the data models.

Currently, this format is under design and feedback is welcomed in this form, option feedback on the new specification.

 

New file new_model.yaml

You’ll notice that there is a new file in the directory of the data models named new_model.yaml

This file is a temporary version of model.yaml till we replace model.yaml (formerly created manually) for this new_model.yaml which is automatically generated from the json schema.

some other changes will be announced soon.

 

 

Migration to schema-generated specifications

In order to:

  1. Maintain updated the specifications
  2. Be able to provide them in multiple languages
  3. Being able to track what properties are already defined
  4. Populate properly the database of properties
  5. Have a shared image for all contributions
  6. Reduce the burden of work for the contributors (it will be reduced to just the documented json schema and the examples)

It has been decided that the description of the properties of the data models will be included in the schemas defining the data models (or those linked through $ref). so during next days, you will see minor changes in the schema.json of every data model in the initiative.

And although it will be announced previously all the spec.md will be replaced by an automatically generated (based on the info). See an example here. Design could be modified so any suggestion will be assessed and eventually implemented.

Customization will be possible through a new file named notes.yaml

This is taking most of our resources and impact on our bandwidth t provide answers to the PR, but we expect that this will reduce our workload significantly so we will be more agile after this change.

updated context.jsonld

The @context, located on the root of the github repository, of the initiative is now updated automatically.

The long URLs are now completely significative because either they point to the original URL of the property or they point to the terms.jsonld file where the definitions based on the existing data models are present.