International-Data-Spaces-Association / ids-specification

The Dataspace Protocol is a set of specifications designed to facilitate interoperable data sharing between entities governed by usage control and based on Web technologies. These specifications define the schemas and protocols required for entities to publish data, negotiate Agreements, and access data in a data space
https://docs.internationaldataspaces.org/dataspace-protocol/
Apache License 2.0
26 stars 14 forks source link

DSP Modelling Design Decision: @type everywhere? #160

Closed sebbader-sap closed 9 months ago

sebbader-sap commented 9 months ago

from https://github.com/International-Data-Spaces-Association/ids-specification/pull/89/files#r1246200376 :

Shouldn't all classes also have a @type property (same goes for DataService, Dataset, Resource)? [...] we already have this problem with dct:hasPart in Catalog which is either a Catalog, Dataset, or DataService? So in that case we would need it for some objects and then it might be easier to include the @type everywhere to not require complex logic to see where to include it and where not.

sebbader-sap commented 9 months ago

It's not required by any specification. As long as it's not at the beginning of a JSON, the serialiser usually knows the class through the property (JSON key). However, in case several different classes (subclasses) are allowed, this approach won't work.

Options: 1) Only use @type where really needed. Pro: less attributes 2) Use @type in every class serialisation. Pro: consistent, simple rule. Pro: dcat:DataService, dcat:Dataset, and dcat:Resource can be distinguished.

sebbader-sap commented 9 months ago

Decision: Option 2a: Use @type in every class serialisation, however, put the type information into the context file.