Describe the bug
The LinkML JSON Schema generator = translates custom data types such as rdf:langString and specific URI-related types (uri, uriorcurie) always to "type": "string" types in the generated JSON schema.
For instance, the following LinkML schema,
classes:
supportContact:
description: >-
Provides information about the TD maintainer as URI scheme.
range: uriorcurie
from_schema: schema:contactPoint
generates the following JSON Schema snippet
"supportContact": {
"description": "Provides information about the TD maintainer as URI scheme",
"type": "string"
}
The same is true when I try to define customised data types, for instance:
types:
languageString:
base: rdf:langString
uri: rdf:langString
structured_pattern:
syntax: "{text}@{tag}"
slots:
title:
description: >-
Provides a human-readable title (e.g., display a text for UI representation) based on a default language.
range: languageString
required: true
slot_uri: td:title
In this case, the generated JSON Schema is,
"title": {
"description": "Provides a human-readable title (e.g., display a text for UI representation) based on a default language.",
"type": "string"
}
while ignoring the range:languageString
To Reproduce
My environment is follows:
python = "^3.11"
linkml-runtime = "^1.8.0rc2"
linkml = "^1.8.0rc2"
I use the the following code snippet for generating the JSON Schema from the LinkML schema:
Describe the bug The LinkML JSON Schema generator = translates
custom data types
such asrdf:langString
and specific URI-related types (uri, uriorcurie
) always to"type": "string"
types in the generated JSON schema. For instance, the following LinkML schema,generates the following JSON Schema snippet
The same is true when I try to define
customised data types
, for instance:In this case, the generated JSON Schema is,
while ignoring the range:languageString
To Reproduce My environment is follows: python = "^3.11" linkml-runtime = "^1.8.0rc2" linkml = "^1.8.0rc2"
I use the the following code snippet for generating the JSON Schema from the LinkML schema:
Expected behavior The JSON Schema generator should for instance consider the format in JSON Schema
"type":"string", "format":"uri"