Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Knowledge type service integration with sdk #34

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

arjungkk
Copy link

Support the creation, updation and deletion of ktypes in the SDK.

updated_at: Optional[Union[str, datetime]] = Field(
None, description="Time and date when the KType was updated."
)
custom_properties: Optional[Any] = Field(None, description="")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be some description added to the custom_properties model.

None, description="OpenAPI schema of the KItem."
None, description="OpenAPI schema of the KType."
)
rdf_mapping: Optional[str] = Field(None, description="")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a description of the field is needed here. Maybe something like "Optional rdf mapping for webform".


id: Optional[str] = Field(None)
label: Optional[str] = Field(None)
widget: Optional[str] = Field(None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the widgets we can make an enum.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g. with Text, Number, etc.

default_value: Optional[Any] = Field(None)
value: Optional[Any] = Field(None)
choices: List[WebformSelectOption] = Field([])
on_change: Optional[Any] = Field(None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which cases do we need the on_change field?

Copy link
Author

@arjungkk arjungkk Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the use case for this field. I just mapped all the fields that were defined in the webform builder.
https://gitlab.cc-asp.fraunhofer.de/dsms/webform-builder/-/blob/main/projects/webform-builder/src/lib/models/webform-input.ts?ref_type=heads#L7

hint: Optional[str] = Field(None)
measurement_unit: Optional[str] = Field(None)
mapping: Optional[str] = Field(None)
mapping_name: Optional[str] = Field(None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am missing the mapping_unit here.

Copy link
Author

@arjungkk arjungkk Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBueschelberger
Copy link
Member

MBueschelberger commented Oct 29, 2024

@arjungkk, can you please add seom examples into the 7_ktypes.ipynb where you demonstrate the commiting of the webforms please?

There is an initial example with ...

ktype = KType( 
        id='batch',
        name='Batch'
        webform={...
        }
)

You may extend this one with a potential webform with the following payload:

  {
    "id": "specimen",
    "name": "Specimen",
    "webform": {
      "semantics_enabled": true,
      "sections": [
        {
          "name": "",
          "inputs": [
            {
              "label": "Sample type",
              "widget": "Text",
              "defaultValue": "",
              "value": null,
              "check": null,
              "error": null,
              "feedback": null,
              "hint": null,
              "measurementUnit": null,
              "mapping": null,
              "knowledgeType": null,
              "knowledgeServiceUrl": null,
              "vocabularyServiceUrl": null,
              "hidden": false,
              "ignore": false,
              "extra": {}
            },
            {
              "label": "Sample information",
              "widget": "Text",
              "defaultValue": "",
              "value": null,
              "check": null,
              "error": null,
              "feedback": null,
              "hint": null,
              "measurementUnit": null,
              "mapping": null,
              "knowledgeType": null,
              "knowledgeServiceUrl": null,
              "vocabularyServiceUrl": null,
              "hidden": false,
              "ignore": false,
              "extra": {}
            },
            {
              "label": "Sample production process",
              "widget": "Text",
              "defaultValue": "",
              "value": null,
              "check": null,
              "error": null,
              "feedback": null,
              "hint": null,
              "measurementUnit": null,
              "mapping": null,
              "knowledgeType": null,
              "knowledgeServiceUrl": null,
              "vocabularyServiceUrl": null,
              "hidden": false,
              "ignore": false,
              "extra": {}
            }
          ],
          "hidden": false
        }
      ]
    },
    "json_schema": null,
    "rdf_mapping": null,
  }

@arjungkk arjungkk self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants