-
Notifications
You must be signed in to change notification settings - Fork 1
Description
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.