Skip to content

Export: materialize rdf:type on nested nodes from the embedding property schema #156

Description

@simontaurus

Export materializes x-oold-instance-rdf-type as @type on the root node only (roundtrip.py#L191-L193). A node nested under an embedded property therefore lands in the graph without an rdf:type, and a type-filtered frame cannot see it: an Organization document with nested employees (persons, mapped @reverse schema:worksFor) exports its worksFor triples fine, but framing the resulting graph by the Person schema returns nothing unless every nested object authored its own type.

The spec's own framing example depends on this: its derived frame filters the nested address by "address": {"type": "schema:PostalAddress"}, which only matches if export put that type on the nested node.

Proposal: on export, type nested nodes from the schema of the property that embeds them - x-oold-instance-rdf-type inline on the property (or items) subschema, or resolved from the $ref / x-oold-range target schema. Authored types win; a property schema declaring no type leaves the node untyped, as today.

The playground's _materialize_types implements the inline case.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions