Skip to content

nodeidentifier values are written as shex:nonLiteral literals by the JSON-LD context and rdflib_dumper, so they never satisfy gen-shacl #51

Open

Description

@jdsika

What

A slot with range: nodeidentifier is written as a literal with datatype shex:nonLiteral by every data path: the generated JSON-LD context and the runtime RDF dumper. gen-shacl requires sh:nodeKind sh:BlankNodeOrIRI for it, so valid data never conforms.

Reproduction (main bd102062b)

id: https://example.org/iri
name: iri
prefixes: {linkml: https://w3id.org/linkml/, ex: https://example.org/iri/}
imports: [linkml:types]
default_prefix: ex
classes:
  Thing:
    class_uri: ex:Thing
    attributes:
      id: {identifier: true}
      node: {range: nodeidentifier}

For the instance {id: ex:x, node: ex:f}:

  • JSON-LD context: ex:node "ex:f"^^shex:nonLiteral
  • rdflib_dumper: the same literal
  • gen-shacl: sh:nodeKind sh:BlankNodeOrIRI, so the data is a violation.

Spec

linkml:types nodeidentifier (uri: shex:nonLiteral): "A URI, CURIE or BNODE that represents a node in a model". shex:nonLiteral is a ShEx node-kind constraint, not an RDF datatype, so a literal typed with it denotes nothing meaningful.

Expected

The value becomes a node: an IRI after CURIE expansion, or a blank node for _: labels, as SHACL and OWL already assume.

Found while measuring URI-family values for #32 and #33 (plans/research-iri-vs-literal.md, local).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions