Skip to content

cannot select the id field if it's BlankNodeId #22

@vigsterkr

Description

@vigsterkr

say i have the following schema:

class A(JsonLDSchema):
   _id = fields.BlankNodeId()

class B(JsonLDSchema):
   _id = fields.BlankNodeId()
   value = fields.Nested(ML_SCHEMA.specifiedBy, A(only=("_id",)))

basically i only want to reference the A node....
this will basically yield in the following exception:

ValueError: Invalid fields for <ASchema(many=False)>: {'_id'}.

if i change ASchema::_id to fields.Id() it works, but even then it as well serializes the @type of the node, which i hoped that is not gonna be the case...

maybe it's related: when a field is BlankNodeId, then the @id is not serialized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions