Skip to content

JSON LD Data Format

François Turbelin edited this page Apr 10, 2021 · 2 revisions

DFC protoype is based on Web Semantic principle and follows an ontology in order to define and structure its Data Model. You can find more details about it here, https://github.com/datafoodconsortium/ontology. The data format has to follow the JSON-LD standard (https://json-ld.org/). We provide you data frame for the different APIs we are supporting.

You can also find examples of data format on your gitbook, https://datafoodconsortium.gitbook.io/dfc-standard-documentation/appendixes/practical-examples.

Catalog Manipulation

List all entries

You need to provide an endpoint that will display the different elements of your Catalog in the JSON-LD standard.

The endpoint format has to follow REST format basically.

The data structure can be found inside the ontology, but let's show you an example for better oversight:

{
"@context":{
  "DFC":"http://datafoodconsortium.org/ontologies/DFC_FullModel.owl#",
  "@base":"https://my-app.com/api/dfc/v1/"
},
"@id":"/entreprise/13616/catalog",
"DFC:supplies":[
  {
    "DFC:description":"DFC-Oeufs 12 pièces",
    "DFC:quantity":12,
    "@id":"/suppliedProduct/item21345",
    "DFC:hasUnit":{"@id":"/unit/Piece"}
  },
  {
    "DFC:description":"DFC-Oeufs 6 pièces",
    "DFC:quantity":6,
    "@id":"/suppliedProduct/item21344",
    "DFC:hasUnit":{"@id":"/unit/Piece"}
  },
  {
    "DFC:description":"DFC-Paniers de légumes 12 Kg.",
    "DFC:quantity":12,
    "@id":"/suppliedProduct/item21347",
    "DFC:hasUnit":{"@id":"/unit/Kilogram"}
  },
  {
    "DFC:description":"DFC-Paniers de légumes 5 Kg.",
    "DFC:quantity":5,
    "@id":"/suppliedProduct/item21346",
    "DFC:hasUnit":{"@id":"/unit/Kilogram"}
  }
],
"@type":"DFC:Entreprise"
}

Add an entry

Work in progress...

Update an entry

Work in progress...

Delete an entry

Work in progress...