Skip to content

[Recommendation] Adjust how we handle dcat:Resource references/values #82

@zopalmer14

Description

@zopalmer14

Name: Zach Palmer

Affiliation: Department of Commerce (Office of the Chief Data Officer) / GSA (U.S. Digital Corps)

Type of issue: Schema (Recommendation)

Issue: We made bunch of changes to remove references to Resource as it's an abstract class and not defined, and to instead only accept string IRI's that reference a Resource object. Although this is a workable and fine solution, I thought we could be more verbose/flexible in what properties with a range of Resource accept as valid options. Neil's changes to how we handle class references and sub-schemas brought the idea to mind.

Recommended change(s): We instead broadly take an approach where properties with a range of Resource accept anyOf: an inline description of a Dataset, an inline description of a DataService, an inline description of a Distribution, or a string IRI that references the Resource object. That is:

"anyOf": [
    {
        "$ref": "/dcat-us/3.0.0/definitions/dataset",
        "description": "inline description of Dataset"
    },
    {
        "$ref": "/dcat-us/3.0.0/definitions/dataservice",
        "description": "inline description of DataService"
    },
    {
        "$ref": "/dcat-us/3.0.0/definitions/distribution",
        "description": "inline description of Distribution"
    },
    {
        "type": "string",
        "description": "reference iri of Resource",
        "format": "iri"
    }
]

Neil also made the point that we could quite easily make a specific Resource sub-schema that amounts to the above 4-way anyOf and reuse it wherever it applies.

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