Skip to content

Differing URI resolution behavior for jsonldPredicate on purpose? #786

Description

@stmbaier

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, but only for the cases, if the value is an object or @id)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions