Giter VIP home page Giter VIP logo

smart-data-models / data-models Goto Github PK

View Code? Open in Web Editor NEW
108.0 20.0 53.0 119.64 MB

Data Models in common use based on real world use-cases. These definitions underpin a digital market of interoperable and replicable smart solutions.

Home Page: https://smartdatamodels.org/

JavaScript 0.03% Python 97.92% Shell 1.58% PHP 0.47%
schema fiware tmforum ngsi-ld iot interoperability reference-architecture data-models

data-models's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

data-models's Issues

Details needed on x-ngsi

This yaml file: https://fiware.github.io/tutorials.NGSI-LD/models/schema.org.yaml has several x-ngsi attributes defined in detail for email attribute.
x-ngsi:
model: "https://schema.org/Text"
type: Property
uri: "https://schema.org/email"
uri-prefix: "https://schema.org/"

In https://github.com/smart-data-models/dataModel.PointOfInterest/blob/master/PointOfInterest/model.yaml only
x-ngsi: model is defined and only for a few fields

Similarly, for location, this https://github.com/smart-data-models/data-models/blob/master/ngsi-ld.yaml contains detailed x-ngsi:
x-ngsi:
model:
- "https://purl.org/geojson/vocab#Point"
- "https://purl.org/geojson/vocab#LineString"
- "https://purl.org/geojson/vocab#Polygon"
- "https://purl.org/geojson/vocab#MultiPoint"
- "https://purl.org/geojson/vocab#MultiLineString"
- "https://purl.org/geojson/vocab#MultiPolygon"
type: GeoProperty
uri: "https://uri.etsi.org/ngsi-ld/location"
uri-prefix: "https://uri.etsi.org/ngsi-ld/"

However location in https://github.com/smart-data-models/dataModel.PointOfInterest/blob/master/PointOfInterest/model.yaml, doesn't contain reference to x-ngsi

Have a few questions:

  1. This javascript: https://github.com/FIWARE/tutorials.Understanding-At-Context/blob/master/context-file-generator/bin/jsonld.js
    generates context.jsonld from yaml files
    If x-ngsi (uri, uri-prefix) is not mentioned in model.yaml, the prefix 'fiware' is generated instead of 'schema' in the generated context.jsonld file.
    For instance "email": "fiware:email" is generated instead of "email": "schema:email". The prefix schema seems more apt for some of the base attributes as they are derived from there. Where can I find more info on "x-ngsi" in fiware docs?

  2. I don't see x-ngsi mentioned in any schema.json files. However I do see it in some model.yaml files. If model.yaml is auto-generated from schema.json, how does it fetch this property? There seems to be no consistency in x-ngsi representation in many yaml files. Will be nice to have one sample reference file for this.

Date related issues

The guidelines here https://github.com/smart-data-models/data-models/blob/master/guidelines.md
state that:

  • Attribute names should be in camelCase
    "DateYearLess": {
      "type": "string",
      "pattern": "^--((0[13578]|1[02])-31|(0[1,3-9]|1[0-2])-30|(0\\d|1[0-2])-([0-2]\\d))$"
    },

Should 'DateYearLess' be defined as 'dateYearLess'?

  • dateCreated and dateModified

At the same guidelines link, https://github.com/smart-data-models/data-models/blob/master/guidelines.md it is stated that:

dateCreated in NGSIv2 (createdAt in NGSI-LD) must not be used as long as they are internal attributes of the NGSI specification.
dateModified in NGSIv2 (modifiedAt in NGSI-LD) must not be used as long as they are internal attributes of the NGSI specification.

        "dateCreated": {
          "type": "string",
          "format": "date-time",
          "description": "Property. Entity creation timestamp. This will usually be allocated by the storage platform."
        },
        "dateModified": {
          "type": "string",
          "format": "date-time",
          "description": "Property. Timestamp of the last modification of the entity. This will usually be allocated by the storage platform."
        },

Should dateCreated and dateModified be in common-schema.json? If so, how will the name difference(createdAt and modifiedAt) with NGSI-LD be handled?

Missing dependency `ruamel.yaml`

Concerning the python package pysmartdatamodels

It seems like the dependency ruamel.yaml is not part of the pyproject.toml file. I would have created a PR, but the pyproject.toml file is also not part of the repository anymore (maybe deleted by mistake?)

Reproduce the error

  1. Run pip install pysmartdatamodels
  2. Run from pysmartdatamodels import pysmartdatamodels as sdm
  3. Get the error: ModuleNotFoundError: No module named 'ruamel'

Question : unit of measure

Hello,

I have some question for all models. How is defined the unit of measure ?

All models defined type number or string, but not explain the unit of measure applied to attribute (km, tonne, kilogramme, hour, format, ....) .

Where is defined ?

Thank's you

Thomas Lecarpentier

Subschema's are not deterministic

I believe there is an issue on being deterministic about subschemas in a FIWARE SmartDataModel (SDM) model. An example being in Device where the subschema "$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/GSMA-Commons" can change without a user being aware

The issue I will demonstrate and discuss is the effect to resultant uses of a schema.json where the present version and configuration management of references of subschemas such as GSMA-Commons is not deterministic .

This is exemplified by an experience I just had and will detail further

I have an automated process where by I generate python pydantic model objects for any FIWARE SDM. This Pydantic Model is then used in to interact with or extend a legacy data structure, Through this mechanism I would like to offer our existing data to 3rd parties or new processes or consume data (with appropriate access) against a FIWARE SDM standard that is deterministic.

In the process of development and testing I regenerated one of these SDM Model as a pydantic object and ended up with a significantly different Model object. In contrast that over the prior days the pydantic model was being generated repeatedly and deterministically. The Models schema.json did not change , so I had to figure out what had changed !
SmartDataModels_issue22w39d5a

I believe it is changes in subschema that the $Refs point to. These subschema links are snapshots and not deterministic. I cannot identify what and when it changed, I can see that some backend activities must have happened. Unfortunately as with the subschema commons-GSMA even looking at the source repo, and looking at all the history git log -p -- commons-gsma.json I could not find a commit for that subschema that would have generated the pydantic model that I had commited 3 days prior.

I assumed and believed the SDM schema.json of a particular commit would deterministically regenerate the pydantic model as long as generator and schema where the same.
I now believe any users of any SDM schema are vulnerable to a subschema changes introducing potentially breaking changes

Configuration

Pydantic Model that has shown the problem is using the following Subject and DataModel

    subject_name="dataModel.Device",
    data_model_name="Device",

Pydantic Model generators has had no changes ( same Github commit)

I am accessing a schema.json for Device from a local instance of Repo https://github.com/smart-data-models/dataModel.Device.git
I pulled this prior a few days ago to the then last commit and no updates done. My git log is still at 30th Aug

git log
commit f8c87c97cb8e1add4687a70b1f65bdd5409d706b (HEAD -> master, origin/master, origin/HEAD)
Author: Alberto Abella <[email protected]>
Date:   Tue Aug 30 09:55:39 2022 +0200

    beta version of DTDL digital twin

commit e220b82c7f4eb20fc6ffe3c4ba341769b016eea3
Author: Alberto Abella <[email protected]>
Date:   Tue Aug 30 09:55:17 2022 +0200

    Exported example to csv example.jsonld

Analysis

What Changed and How do we control for change ?

The model generator is under git version control, and confirmed no changes
The model generator builds out from schema.json and obviously retrieves definitions from referenced subschema's.

In the case of Device this root schema.json is uniquely versioned from the source repo. Hence my Pydantic Model object can be versioned to this schema commit https://github.com/smart-data-models/dataModel.Device/blob/f8c87c97cb8e1add4687a70b1f65bdd5409d706b/Device/schema.json#L3 there in most cases also a version attribute in the schema ie "$schemaVersion": "0.0.7",

Example of this root schema.json

  "$schema": "http://json-schema.org/schema#",
  "$schemaVersion": "0.0.7",
  "modelTags": "",
  "$id": "https://smart-data-models.github.io/dataModel.Device/Device/schema.json",
  "title": " Smart Data Models - Device schema",
  "description": "An apparatus (hardware + software + firmware) intended to accomplish a particular task (sensing the environment, actuating, etc.).",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/GSMA-Commons"
    },
    {
      "$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/Location-Commons"
    },
    {
      "$ref": "https://smart-data-models.github.io/dataModel.Device/device-schema.json#/definitions/Device-Commons"
    },

The root schema for Device can be deterministically versioned . An attribute can be assigned to my Pydantic Model being "SDMVersion": "0.0.7.f8c87c97cb8e1add4687a70b1f65bdd5409d706b", <$schemaVersion>.<GitCommit> and
"SDMrootSchema": "https://raw.githubusercontent.com/smart-data-models/dataModel.Device/f8c87c97cb8e1add4687a70b1f65bdd5409d706b/Device/schema.json", <$immutableSourceURL>
linking my pydatic model to a deterministic root schema

The issue in the case of Device is that the subschemas introduced by

"allOf": [
    {"$ref":….},
    {"$ref":….},
	…… 
	]

are not deterministic, there is no versioning in the $ref: subschema's urls.
Any change to a referenced schema could introduce a breaking change to a pydantic model derived from the root schema.json

The issue then becomes where should this versioning managed. Any change in the nth subschema will necessitate a new dependency driven version increment in all associated parent schemas above this nth tier subschema change

Options

  1. Centrally control dependency management for referenced subschemas. This I believe would need to in the FIWARE SDM Subject Repo ie the $ref changes from
    https://smart-data-models.github.io/data-models/common-schema.json#/definitions/GSMA-Commons
    to
    https://raw.githubusercontent.com/smart-data-models/data-models/c4ee5d39bcbacdc30700bcd2d916aaf2c50dc86e/common-schema.json#/definitions/GSMA-Commons
    This would be my preferred option

    • All Parent Schemas for a changed subschema need to have the $ref updated and Parents schema committed with new subschema changes. - Change control and version dependency management is easily visible to all consumers

    • Migrations can be planned

    • Viability depends if this is human or script managed. Some bearing on how deep the tree of reference subschemas can be but not impossible for an algorithm to process. Without a deep look into all models, I manually viewed the SDM dataModel.Device/Device and particularly the definitions/GSMA-Commons. There does not appear to be any schema references external to this $ref .

      However some of the $Refs are Relative and some are full URLS. ideally they should all be relative
      see

            "owner": {
          "type": "array",
          "description": "Property. A List containing a JSON encoded sequence of characters referencing the unique Ids of the owner(s)",
          "items": {
            "$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/EntityIdentifierType"
          }
        },
    From <https://raw.githubusercontent.com/smart-data-models/data-models/c4ee5d39bcbacdc30700bcd2d916aaf2c50dc86e/common-schema.json> 
    
    

    vs the Contact-Commons in the same schema

                "email": {
              "$ref": "#/definitions/email"
            },
    
    From <https://raw.githubusercontent.com/smart-data-models/data-models/c4ee5d39bcbacdc30700bcd2d916aaf2c50dc86e/common-schema.json> 
    
    
  2. In the absence of Option 1 dependency management done by the user of a schema. A map is generated for all referenced schema's including subschemas. These are pulled and versioned. The user then changes all references to the appropriate fixed dependencies. The users maintains version management, resultant schema may not be able to be shared.
    Potential Issue's :
    no central version registry,
    incompatibility between objects in 2 different systems that don’t have access to common repositories

Nomenclature for noise variables in NGSI-LD

I am developing a service for the conversion of data reported by a number of devices including air quality and noise.

The information about the context of the data that I have is the following link: https://raw.githubusercontent.com/smart-data-models/data-models/master/context.jsonld

I have seen that in the NGSI-LD changes the names for certain gases such as CO, NO2, etc have been changed to lower case for NGSI-LD but I have not been able to find what is the correct nomenclature for the observed noise levels and since these in version 2 of NGSI-LD are written as "sonometerClass", "LAeq", "LAFmax", "LAFmin", "LASmax", "LASmin" what would be the correct way to name them? Will they be added soon?

Thank you very much, best regards

Request for inclusion of common fields in common schema

Requesting for inclusion of some additional common attributes in common-schema.json, may be beneficial for uniform usage

  • Ratings related
  • Payment related

Ratings related - aggregateRating, review as described below:

                "aggregateRating":{
                    "type":"object",
                    "description":"Property. Model:'https://schema.org/AggregateRating'. The average rating based on multiple ratings or reviews.",
                    "properties":{
                        "ratingCount":{
                            "type":"integer",
                            "description":"Property. The count of total number of ratings."
                        },
                        "bestRating":{
                            "type":"integer",
                            "description":"Property. The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed."
                        },
                        "worstRating":{
                            "type":"integer",
                            "description":"Property. The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed."
                        },
                        "ratingValue":{
                            "type":"integer",
                            "description":"Property. The rating for the content."
                        }
                    }
                },
                "review":{
                    "type":"array",
                    "description":"Property. Model:'https://schema.org/Review'. A review of an item - for example, of a restaurant, movie, or store.",
                    "items":{
                        "properties":{
                            "author":{
                                "type":"string",
                                "description":"Property. Model:'https://schema.org/Text'. The author of this content or rating."
                            },
                            "datePublished":{
                                "type":"string",
                                "format":"date-time",
                                "description":"Property. Model:'https://schema.org/Text'. Date of first broadcast/publication."
                            },
                            "reviewBody":{
                                "type":"string",
                                "description":"Property. Model:'https://schema.org/Text'. The actual body of the review. "
                            },
                            "name":{
                                "type":"string",
                                "description":"Property. Model:'https://schema.org/Text'. The name of the item. "
                            },
                            "reviewRating":{
                                "type":"object",
                                "description":"Property. Model:'https://schema.org/Rating'. A rating is an evaluation on a numeric scale, such as 1 to 5 stars.",
                                "properties":{
                                    "bestRating":{
                                        "type":"integer",
                                        "description":"Property. The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed."
                                    },
                                    "worstRating":{
                                        "type":"integer",
                                        "description":"Property. The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed."
                                    },
                                    "ratingValue":{
                                        "type":"integer",
                                        "description":"Property. The rating for the content."
                                    }
                                }
                            }
                        }
                    },
                    "minItems":1
                },

Payment related - currenciesAccepted, paymentAccepted

```
        "currenciesAccepted":{
                "type":"array",
                "description":"Property. Model:'https://es.wikipedia.org/wiki/ISO_4217'",
                "items":{
                    "type":"string",
                    "enum": [
                        "AED", "AFN", "ALL", "AMD"...
                     ]
                },
                "minItems":1,
                "uniqueItems":true
            },
            "paymentAccepted":{
                "type":"array",
                "description":"Property. Model:'https://schema.org/Text'. Payment method accepted in this store.",
                "items":{
                    "type":"string",
                    "enum":[
                        "Cash",
                        "Cheque",
                        "Credit Card",
                        "Cryptocurrency"
                    ]
                }
            }

Which @context to use as reference?

Which @context should be used as reference for the smart data models? The @context in this umbrella repo uses different URIs than the @context-files in the domain specific repositories (e.g. https://uri.fiware.org/ns/data-models#refRoad vs. https://smartdatamodels.org/dataModel.Transportation/refRoad). Also the @context in this repo hasn't been updated for 2 years and therefore does not include all attributes from the current versions of the data models. On the other hand the @context-files in the domain specific repositories do include URIs only for attributes and not for the entity types themself (e.g. Road, RoadSegment).

In haven't found any recommendation in the modeling guidelines. What is the best practice regarding the URIs for using the smart data models (without mapping the models to external ontologies)?

Missing howto.md and broken link in guidelines.md

In the guidelines.md, the https://github.com/smart-data-models/data-models/blob/master/guidelines.md#data-models-guidelines has a broken link to the file howto.md.
As I can see, most of the topics of the https://github.com/FIWARE/data-models/blob/master/specs/howto.md are covered in the guidelines.md but some interesting pieces of documentation as Going through a Data Model is missing. I suggest maintaining it so I see three options:

a. To include the "Going through a Data Model" topic in the guidelines.md where include both v2 and NGSI-LD. And delete de reference to the howto.md
b. To create a new document "goingthroughadatamodel.md" with this piece of documentation and a future example for NGSI-LD.
c. Not to include this piece of documentation and delete the reference to the howto.md

I could solve this issue if you tell me what should be organization of this documentation.

Full context update?

Hi,

in the sub repos for the data models some of the full URIs have been updated to e.g.
https://smartdatamodels.org/dataModel.Environment/AirQualityObserved
and this is also reflected in the submodels specific at context
https://github.com/smart-data-models/dataModel.Environment/blob/master/context.jsonld
however the full context provided
here
https://raw.githubusercontent.com/smart-data-models/data-models/master/context.jsonld
or here
https://smart-data-models.github.io/data-models/context.jsonld

still have the the older URI
https://uri.fiware.org/ns/data-models#AirQualityObserved

so the full context is incompatible with the updated subcontexts.

Will the full context be updated?

Thanks

Broken Links

At this link https://github.com/smart-data-models/data-models,

Contributions should come in the form of pull requests made against the corresponding Vertical Data Model repository. An introductory presentation about it.

this link for the presentation: https://data-models.fiware.org/index.php/2020/05/15/contribution-manual
is broken

Another question. It is confusing to see multiple context.jsonld files. Which among these should be referred for Fiware context?

The links(https://uri.fiware.org) referred within the context.jsonld, for instance, this link: https://uri.fiware.org/ns/data-models#PointOfInterest and others are giving 404 error

Rationale for including pieces of the NGSI-LD core context in data models

Hi,

I've noticed that many (all?) data models include pieces of the NGSI-LD core context.

For instance, in https://raw.githubusercontent.com/smart-data-models/dataModel.WasteWater/master/context.jsonld, we can find id, ngsi-ld and type. And same in https://raw.githubusercontent.com/smart-data-models/dataModel.Weather/master/context.jsonld.

What is the rationale behind this? Why for instance not just linking the core context?

Few corrections in ngsi-ld_generator_keyvalues_v0.93.py

  1. payload_interger -> Typo here, please remove additional r

  2. Should the "type": "object" below be "type": "Relationship"

def payload_relationship(propertyName, dataModel):
    return {"type": "object", "value": fake_uri(propertyName, dataModel)}
  1. Handling email type

Please add the following code to handle emails as well:

        elif payload["type"] == "string" and "format" in keys:
            if payload["format"] == "date-time":
                return payload_date()
            elif payload["format"] == "uri":
                return payload_uri(prop, dataModel)    
      >     elif payload["format"] == "idn-email":
      >         return payload_email()

def payload_email():
    return {"type": "Property", "value" : {"type": "Property", "value": "[email protected]"}}

Functionality unclear with regards to properties and attributes in pysmartdatamodels

I imagine there is a plan for attributes and properties as shown in

def description_attribute(subject, datamodel, attribute):

I would like to retrieve the RepoLink as defined in official_list_data_models.json
for the moment I have implemented the following,

is there an alternative and what is the intended properties ?

def datamodels_subject(subject: str, names_only=True):
    """List the names or full record of the entities defined in the data models.
    Parameters:
        subject: name of the subject
        names_only: (default True)  output only the list of data models for a subject
                    else output the full JSON object as in `official_list_data_models.json` 
    Returns:
       if subject is found
         if names_only
            array of strings: data models' names belonging to the subject
         else
            dict of properties(full JSON object as in `official_list_data_models.json` )  about the subject
       if subject is not found
         False
    """

I will be happy to use suggestions or push this as a PR?

Error Json-Ld parse context

Error Json-Ld parse context, not valid:
ccs/sae
bbox
biodieser ethanol
commercial supply
hybrid electric/diesel
hybrid electric/petrol
rainwater capture
snow/ice
water dam

Edit configuration files

I have a question to ask the author, what editor do you use to edit the json and yaml configuration files, because it is easy to make mistakes if you modify the files directly

Converting JSON-LD Smart Data Models to RDF/Turtle File Ontology

Hello,

I am trying to experiment with Smart Data Models in order to add a common semantic layer to multiple heterogeneous data sources.

For this purpose, I would like to translate the JSON-LD file to a .ttl (RDF serialization) file ontology in order to explore and manipulate it in Protégé Software with the following steps:

The output from easy-rdf is not satisfactory because the contents field is missing, while I was expecting to have a list of classes:

@prefix dc: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<dtmi:com:ngsi-ld:TouristProfile;0>
  a <http://njh.me/Interface> ;
  dc:description "Description of a tourist profile based on the characteristics of a person, trip, choice of stay and spending while in destination."^^xsd:string .

Next, I tried to tweak it by adding a contents line to the context part of the merged json-ld file:

{
    "@context": {
        "1": "https://smartdatamodels.org/dataModel.TourismDestinations/1",

        [...]

        "wheelChairAccessible": "https://smartdatamodels.org/dataModel.TourismDestinations/wheelChairAccessible",
        "contents": "https://smartdatamodels.org/example"
    },

        [...]

But the result is not satisfactory neither, I have a bunch of blank nodes instead of well defined class:

@prefix dc: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ns0: <https://smartdatamodels.org/> .

<dtmi:com:ngsi-ld:TouristProfile;0>
  a <http://njh.me/Interface> ;
  dc:description "Description of a tourist profile based on the characteristics of a person, trip, choice of stay and spending while in destination."^^xsd:string ;
  ns0:example [
    a <http://njh.me/Property> ;
    ns0:name "alternateName"^^xsd:string

[...]

[
    a <http://njh.me/Telemetry> ;
    ns0:name "travelPartyComposition"^^xsd:string
  ] .

Does what I want to do have any sense? Is there a way to translate an SDM to a turtle ontology?

Install of PYSMARTDATAMODEL fails using poetry

In attempting to install pysmartdatamodel it fails with errors regarding dependencies

Expected behaviour:

I should be able to add pysmartdatamodels as a dependency to my application
poetry add --editable git+https://github.com/smart-data-models/data-models.git#subdirectory=pysmartdatamodels
and use it with the following

from pysmartdatamodels import list_all_datamodels
print(list_all_datamodels())

Actual Behaviour

poetry add ..... results in the following error

Because pysmartdatamodels (0.2.3) @ git+https://github.com/smart-data-models/data-models.git@HEAD#subdirectory=pysmartdatamodels depends on sys (*) which doesn't match any versions, pysmartdatamodels is forbidden.
So, because module-sll-smartdatamodels-22q3 depends on pysmartdatamodels (0.2.3) @ git+https://github.com/smart-data-models/data-models.git#subdirectory=pysmartdatamodels, version solving failed.

Steps to reproduce the behavior

My Environment is Python 3,9, Python 3.10 and using poetry (1.2.1) as dependency and virtualenv manger
installation command is poetry add --editable git+https://github.com/smart-data-models/data-models.git#subdirectory=pysmartdatamodels

working example of this can be found at
GIST https://gist.github.com/auphofBSF/abffe6f37bfbc5077eedf10304988157

Analysis

the INSTALL_REQUIRES in setup.py lists as dependencies some python core builtin dependencies. INSTALL_REQUIRES is not meant to be the main source of requirements and is only meant to show external requirements.
Python dependency management has undergone a lot of change with PEP517,518 and 621 I will add a separate PR to help in this manner, but 1st I will issue a PR that fixes this immediate situation in setup.py.

Generate the OpenAPI specification from the file "common-schema.json"

I want to extend the base models using Swagger - $ref - and at the moment there seems to be no OpenAPI specification of common-schema.json. If you use the JSON file it works but it is not recommended - schema must be of a Schema Object and not a standard JSON Schema - and the output is different.

In my case I am extending the model representing an "Organization" with a "ContactPoint" and, in the absence of common-schema.yaml, I am using the schema.org.yaml file:

components:
  schemas:
    Company:
      type: object
      allOf:
        - $ref: "https://smart-data-models.github.io/dataModel.Organization/Organization/model.yaml#/Organization"
        - $ref: "https://raw.githubusercontent.com/smart-data-models/data-models/master/schema.org.yaml#/ContactPoint"
      required:
        - "name"
        - "address"
        - "location"
        - "taxID"
        - "email"

Broken example links

Here https://github.com/smart-data-models/data-models

In this paragraph:

/examples. This directory contains the examples for the different versions of NGSI standard and different formats. Example: schema.json of WeatherObserved - example.json: a JSON example file key values of NGSI v2 Example: example.json of WeatherObserved - example-normalized.json: An example file in NGSI v2 normalized format Example: example-normalized.json of WeatherObserved - example.jsonld: a JSON example file key values of NGSI LD Example: example.json of WeatherObserved

the links:
https://github.com/smart-data-models/dataModel.Weather/blob/master/WeatherObserved/example.json
https://github.com/smart-data-models/dataModel.Weather/blob/master/WeatherObserved/example-normalized.json
https://github.com/smart-data-models/dataModel.Weather/blob/master/WeatherObserved/example.jsonld

all above links are broken.

Should be:

https://github.com/smart-data-models/dataModel.Weather/blob/master/WeatherObserved/examples/example.json
https://github.com/smart-data-models/dataModel.Weather/blob/master/WeatherObserved/examples/example-normalized.json
https://github.com/smart-data-models/dataModel.Weather/blob/master/WeatherObserved/examples/example.jsonld

Need info for certain example formats.

1. DateTime

Why are the type/ value for only DateTime represented with an '@' symbol as shown below?

"orderDate": {
"type": "Property",
"value": {
"@type": "DateTime",
"@value": "2018-08-07T12:00:00Z"
}
}

  1. Nested key-values

Should nested child members be represented as simple key-value pairs or as expanded properties with "type" : "Property" and "value": "xxx"?

Which format below is correct - a or b?

a. key-value pair

"address": {
    "type": "Property",
    "value": {
      "addressCountry": "IN",
      "addressLocality": "ABC Street"
    }
  }

b. expanded format

"address": {
    "type": "Property",
      "addressCountry": {
         "type": "Property",
         "value": "IN"
      },
      "addressLocality": {
         "type": "Property",
         "value": "ABC Street"
      }
  }

JSON-LD representation of all examples is invalid

When parsing any example in the smart data models space, I get:

Failed to retrieve https://smart-data-models.github.io/dataModel.Transportation/BikeHireDockingStation/examples/example.jsonld: Error: IRIs can not be mapped to other IRIs, found: 'CCS/SAE': 'https://uri.fiware.org/ns/data-models#CCS/SAE'

How to resolve: fix the context in https://schema.lab.fiware.org/ld/context.jsonld to not include a relative IRI as a property.

Suggestion on how to avoid regressions in the future: have a unit test with pre-commit hook in the repos to test the JSON-LD and assert a couple of triples to emit when parsing the JSON-LD files to RDF.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.