You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to assess the complexity of converting a v1 to a v2 Data Package. Below are the steps that need to be taken. For version detection, see #262. @khusmann could you review these? There are a couple of items I'm unsure about.
There is also the edge case where $schema is already present (i.e. a v1 package with a v2 resource). => Unsure, should the present resource.$schema be left as is then?
resource.name: rules are relaxed, existing names can remain as is
resource.path: dot-paths are now forbidden. In the edge case there is such a path provided, we should not convert it, because it is impossible to know what would be the correct path. These types of paths will be flagged when reading a resource.
dialect.caseSensitiveHeader is present => https://datapackage.org/profiles/1.0/tabledialect.json
dialect.csvddfVersion is present => https://datapackage.org/profiles/1.0/tabledialect.json
Otherwise this can safely be set to https://datapackage.org/profiles/2.0/tabledialect.json
Unsure about this though. For example, if a dialect was absent (very often the case), one will be added with just the $schema property. The alternative is to leave all dialects as v1 (assuming a $schema that defaults to https://datapackage.org/profiles/1.0/tabledialect.json). That would also mean that remote dialects can stay remote.
I wanted to assess the complexity of converting a v1 to a v2 Data Package. Below are the steps that need to be taken. For version detection, see #262. @khusmann could you review these? There are a couple of items I'm unsure about.
Package
Add package.$schema, remove
package.profileUse
package.profile, then remove it.NULL=>https://datapackage.org/profiles/2.0/datapackage.jsondata-package(registered id) =>https://datapackage.org/profiles/2.0/datapackage.jsontabular-data-package(registered id) =>https://datapackage.org/profiles/2.0/datapackage.json. This also removes deprecated tabular-data-packagefiscal-data-package(registered id) => Unsure, should we use the 1.0 URL for fiscal-data-package?Add package.contributors.roles
roles(array) based onrole(string). RemoveroleOther changes
title,givenNameandfamilyName.Each resource
Add resource.$schema, remove
resource.profileUse
resource.profile, then remove itNULL=>https://datapackage.org/profiles/2.0/dataresource.jsondata-resource(registered id) =>https://datapackage.org/profiles/2.0/dataresource.jsontabular-data-resource(registered id) =>https://datapackage.org/profiles/2.0/dataresource.json(but seeresource.type)$schemais already present (i.e. a v1 package with a v2 resource). => Unsure, should the presentresource.$schemabe left as is then?Add resource.type
Use
resource.profile:NULL=> don't settabular-data-resource=>tableOther changes
For each dialect
Note that upconverting a dialect requires a remote one to be downloaded and verbosely included.
Add dialect.$schema
dialect.caseSensitiveHeaderis present =>https://datapackage.org/profiles/1.0/tabledialect.jsondialect.csvddfVersionis present =>https://datapackage.org/profiles/1.0/tabledialect.jsonhttps://datapackage.org/profiles/2.0/tabledialect.jsonUnsure about this though. For example, if a dialect was absent (very often the case), one will be added with just the
$schemaproperty. The alternative is to leave all dialects as v1 (assuming a$schemathat defaults tohttps://datapackage.org/profiles/1.0/tabledialect.json). That would also mean that remote dialects can stay remote.Other changes
For each schema
Note that upconverting a schema requires a remote one to be downloaded and verbosely included.
Add schema.$schema
https://datapackage.org/profiles/2.0/tableschema.jsonbecause we will update the schema it to that version.Update
schema.primaryKeyUpdate
schema.foreignKeysschema.foreignKeys.fieldsfrom string to arrayschema.foreignKeys.reference[x].fieldsfrom string to arrayschema.foreignKeys.reference[x].resource= resource name => remove propertyNo action required
exactfor all v1, but that is also the default for this field, so no need to set itFor each field
Other changes
enumshould be converted to a field withcategories.groupCharis a new property, no action requiredtype = any, potentially provide opt-in #168