Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

This document explains implementation/adoption of Sunbird DIAL context. Document details about 3 areas. First, how to extend the Sunbird DIAL Context Vocabulary. Second, how DIAL context is being updated/handled in Sunbird Content service. Third, how to update the context of existing DIAL codes.

Repositories: 

https://github.com/project-sunbird/sunbird-dial-service/tree/release-5.0.0

https://github.com/project-sunbird/knowledge-platform-jobs/tree/release-5.0.0

How to extend the Sunbird DIAL context? 

'jsonld-schema' folder is used to save context and json-ld (vocabulary) files. In order to extend the Sunbird DIAL Context vocabulary or to implement custom context:

  1. Create ‘jsonld-schema’ folder in the private repository.

  2. Create a new folder under 'jsonld-schema' folder (Ex: jsonld-schema/adopter). 

  3. The Adopter folder should contain a 'context.json' file which is the adopter’s custom context file. 

  4. Specify the adopter folder name in 'jsonld.type' attribute in 'application.conf' file for application to refer to custom context. 

  5. One can also define 'contextValidation.json' (optional) in the adopter folder, similar to the one in the ‘sb’ folder. This file will be referred to perform data type validation of the incoming requests. If defined, context data input validation will happen when DIAL code update v2 API call is made with 'contextInfo'. 

  6. Custom ‘context.json’ should have a reference of the 'sb' vocabulary (schema.jsonld).

  7. Upload the private repository ‘jsonld-schema’ folder to blob storage.

  8. Update the ‘jsonld-schema’ folder path to the ‘jsonld.basePath’ property blob location.

How does the content service update DIAL code context?

In order to ease the updation of DIAL context with content information when DIAL code is linked to a content/collection/collection unit, sunbird has updated ‘content-publish’ flink job to invoke the new dialcode-context-updater’ flink job via ‘post-publish-processor’ flink job. ‘dialcode-context-updater’ flink job uses ‘contextMapping.json’ file to prepare the input data as per the DIAL code context configured in the Sunbird DIAL Service. ‘dialcode_context_updater.context_map_path’ property mentioned in the ‘dialcode-context-updater.conf’ is used to specify the path of ‘contextMapping.json’. (Ref: https://raw.githubusercontent.com/project-sunbird/knowledge-platform-jobs/dialcode-context-updater/dialcode-context-updater/src/main/resources/contextMapping.json). At the moment, ‘contextMapping.json’ file packaged in Sunbird is in reference to the ‘sbed’ ‘context.json’ file.

How to update the content context to the already linked DIAL codes (Data Migration)?

In order to update content context information to the already linked DIAL codes, there are 2 solutions:

  1. Re-publish the content/collections after deploying and configuring the ‘DIAL service’, ‘content-publish’, ‘post-publish-processor’ and ‘dialcode-context-updater’ flink jobs.

  2. Push kafka events in below format to ‘dialcode-context-updater’ flink job input topic ({{env_name}}.dialcode.context.job.request).

Format: {"eid":"BE_JOB_REQUEST","ets":$epochTime,"mid":"LP.$epochTime.${UUID.randomUUID()}","actor":{"id":"DIAL code context update Job","type":"System"},"context":{"pdata":{"ver":"1.0","id":"org.ekstep.platform"},"channel":"$channel","env":"dev"},"object":{"ver":"1.0","id":"$dialcode"},"edata":{"action":"$action","iteration":1,"dialcode":"$dialcode","identifier": "$contentId"},"identifier": "$contentId"}

Note:  $contentId is content/collection/collection unit identifier

$channel should be the channel of the DIAL code and content. 

$dialcode is the DIAL code to which content context is to be updated.

$action is either ‘dialcode-context-update‘ or ‘dialcode-context-delete’.

Please note that DIAL Context module implementation requires NGIX side API onboarding. Please refer to ticket SB-29005 - Getting issue details... STATUS

curl --location --request GET 'https://dev.sunbirded.org/dial/U3W2X2' \
--header 'Accept: application/ld+json'

  • No labels