common-workflow-language / common-workflow-language/schema_salad
Differing URI resolution behavior for jsonldPredicate on purpose?
- Dominant language
- Python
- Stars
- 86
- Forks
- 64
- Avg merge
- 19h 24m
- Merged PRs (30d)
- 19
Description
### Description
If in a SALAD schema the `jsonldPredicate` of a SaladRecordField is set as
- string, the provided URI is not resolved with respect to the provided base URI, instead the predicate URI is not pre-processed in any way
- as object with property `_id` the provided URI is resolved with respect to the provided base URI during pre-processing.
### Example
**Input schema** with directly provided URI string:
```
$base: "http://www.example.org/basketSchema"
$graph:
- name: Basket
type: record
documentRoot: true
fields:
- name: basket
type:
type: array
items: string
jsonldPredicate: "#hasProducts"
```
**Output JSON-LD Context**:
```
{
"@context": {
"Basket": "http://www.example.org/basketSchema#Basket",
"basket": "#hasProducts"
}
}
```
**Input schema** with JsonldPredicate object:
```
$base: "http://www.example.org/basketSchema"
$graph:
- name: Basket
type: record
documentRoot: true
fields:
- name: basket
type:
type: array
items: string
jsonldPredicate:
_id: "#hasProducts"
```
**Output JSON-LD Context**:
```
{
"@context": {
"Basket": "http://www.example.org/basketSchema#Basket",
"basket": {
"@id": "http://www.example.org/basketSchema#hasProducts"
}
}
}
```
Intuitively, I would have assumed that the two schemes would be equivalent, but apparently they are not.
Is this observed behavior correct (or a bug) and if so, where is this defined in the current SALAD specification (currently there is some documentation about `jsonldPredicate` pre-processing in [2.7 Record field annotations](https://www.commonwl.org/v1.2/SchemaSalad.html#Record_field_annotations), but only for the cases, if the value is an object or `@id`)?
Contributor guide
Assessment
This issue has not been assessed yet.