1 of 42

Creating an OCDS Extension

2020, remote

2 of 42

Introduction

3 of 42

Introduction: Welcome

Welcome everyone

  • Introduce yourselves via Zoom chat
  • Notes doc (link)

4 of 42

Introduction: Expectations and Target Audiences

This webinar has been designed with the following people in mind:

  • Intermediate or above knowledge of OCDS
  • Understand how the OCDS extension mechanism works
  • Comfortable with Github and JSON

5 of 42

Introduction: Aims and Objectives

Aim: Provide an overview of developing a OCDS extension

  1. Participants understand the resources and support available to them when they are developing an extension
  2. Participants know an overview of the steps involved in developing an extension
  3. Participants are introduced to how developing an extension looks in practice (through a demonstration)

6 of 42

Introduction: Agenda

Target Length: 45 hour

  1. Extensions recap
  2. Introduction to creating an extension
    1. Step 1: Discuss
    2. Step 2: Development
    3. Step 3: Documentation
    4. Step 4: Demonstration and Testing
  3. Extension creation live demonstration
  4. Summary and Q&A

7 of 42

Extensions recap

8 of 42

Extensions

OCDS implementation involves mapping your data to OCDS.

Some of your data might not match any field or code in OCDS. To cover such cases, you can use extensions to add extra fields and codes.

Extensions provide a way to document these extra fields and codes and define validation for them as well as declaring them as available for data users and tools.

OCDS�fields and codes

Your�data

Data that maps

Unused�fields and codes

Extensions

9 of 42

Do I need to use extensions?

Use the field level mapping template to identify data which:

Maps to the core OCDS schema�Extensions are not required to publish this data.

Maps to fields in a recommended extension�Use the extensions explorer to find out how to use the extension.

Doesn’t map to either of the above�Use the extension explorer to check if another extension exists which could be used to disclose your data.

Contact the helpdesk (data@open-contracting.org) if you have data that doesn’t map to the core OCDS schema or any existing extensions.

10 of 42

Declaring an extension

Extensions are declared in the package metadata for releases and records

11 of 42

Creating an extension

12 of 42

When to create an extension

Before you begin developing an extension; check that you definitely need to. Develop an extension when you are certain that:

✔ You have checked that your data does not map to an existing OCDS field or extension

✔ You have searched the OCDS Standard repo for open/closed issues

✔ Nobody else is working on a similar problem

13 of 42

Check your knowledge

Developing an extension requires an understanding of the following:

You can use the standard extension template to support you

JSON Schema

14 of 42

Creating an extension: 4Ds

  • Step 1: Discuss�
  • Step 2: Development�
  • Step 3: Documentation�
  • Step 4: Demonstration & testing

15 of 42

Step 1: Discuss

16 of 42

1: Discuss

  • Check for existing extensions on the extensions explorer
  • Search for existing issues on the OCDS github (including closed issues)
  • Open a new issue to describe your needs and plans for the data: get the community engaged

17 of 42

  1. Discuss

When creating an issue, make sure that you communicate clearly and include the following:

  • A description of the process you’re trying to represent
  • Examples of existing data, to help with data modeling
  • What belongs in OCDS vs secondary datasets
  • A description of the use-cases

18 of 42

  1. Discuss

“I need an extension to represent multiple buyers

This discussion lead to the multiple buyers - contract level extension

19 of 42

  1. Discuss

Practical tips for this step:

  • Always check the extensions explorer and OCDS Standard Github issues first
  • When opening a new issue be clear about your use-cases and needs and how you’re proposing to model them
  • Get the community engaged by contacting the OCDS mailing list and helpdesk teams
  • Be prepared to collaborate

20 of 42

Step 2: Development

21 of 42

2. Development: The structure of an extension

  1. Documentation explaining the use-cases for fields and codes (README.md)
  2. JSON merge-patch against the schema introducing the schema definitions of new fields and codes (release-schema.json)
  3. Extension definition that describes the extension (extension.json)

22 of 42

2. Development: Getting started

23 of 42

2. Development

1. design your field names and structures

String: procurementManager, Array (Cost Centre): costCentres

2. Mock up the data

24 of 42

2. Development

3. Consider the OCDS Schema conventions

Visit the style guide to check you’re meeting the style

4. Produce the JSON Schema merge patch

25 of 42

2. Development

Practical tips for this step:

26 of 42

Step 3: Documentation

27 of 42

3. Documentation

You should provide clear and concise documentation in the README file so that implementers and data users know how your extension works. Good documentation consists of:

  • An introduction providing a short description of the motivation for the extension
  • Definitions of each of the field, matching the definitions provided in the schema itself
  • Examples of data that could be provided using the extension.

28 of 42

3. Documentation

29 of 42

3. Documentation

Practical tips for this step:

  • Introduce and motivate the extension
  • Provide plain-english descriptions of fields
  • Provide examples of data using the extension
  • Write clearly and concisely; check your writing using a readability app
  • Read existing extension documentation to see good practice in action

30 of 42

Step 4: Demonstration & Testing

31 of 42

4. Demonstration & Testing

Before using your extension in an implementation it is important to test it out.

  • Host the extension using Github
  • Declare the extension in some sample data
  • Upload your sample data to the Data Review Tool

32 of 42

4. Demonstration & Testing

You should be testing for two things during this step:

  1. That you can apply your new fields and codes and that they’re valid and not “additional fields”
  2. That your validation rules are applied correctly (ie break some data!)

33 of 42

4. Demonstration & Testing

Practical tips for this step:

  • Test with sample data first to make sure your extension is being applied properly
  • Test data that should validate and invalidate; use different data types to try and break validation
  • Consult the JSON Schema website for tips on writing JSON Schema
  • Get in touch with the helpdesk at data@open-contracting.org

34 of 42

Extension Creation Live demo

35 of 42

Extension Creation Live Demo

“I need an extension to model a tender with a predefined location”

36 of 42

Extension Creation Live Demo

Creating an extension is straightforward using our tools:

  1. Use the extension creator to modify the schema and download your new extension
  2. Upload to a public place, like a github repository
  3. Review the sample data with the Data Review Tool

Sample files to try yourself:

37 of 42

Key Tools

38 of 42

Key Tools

39 of 42

Summary and Q&A

40 of 42

Summary

  • OCDS extensions document the structure, format and meaning of additional fields and codes.�
  • Create your own extension if you need to publish data which doesn’t map to either the core OCDS schema or any existing extensions.�
  • Remember the 4 D’s for creating an extension: Discuss, Develop, Document and Demonstrate.�
  • Use the Extension Template Repository and/or the Extension Creator to develop your extension.

41 of 42

Questions and Answers

We’ll answer some questions from the notes document now and also send out answers to all questions via the OCDS Standard Mailing list.

  • Join the mailing list: link
  • Contact the Helpdesk <data@open-contracting.org>

42 of 42

English OCP Post-event Survey

www.surveymonkey.com/r/ocp-post-event

Scan the QR code below to access the survey on your device.