-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
Description
Hi, I am looking for a PHP implementation, so we perhaps use tableshema-py as reference algorithm for tableschema-php issue 35... The core seems the mapping and can be expressed as JSON to reuse into other contexts.
mapping = {
'any': sa.Text,
'array': None,
'boolean': sa.Boolean,
'date': sa.Date,
'datetime': sa.DateTime,
'duration': None,
'geojson': None,
'geopoint': None,
'integer': sa.Integer,
'number': sa.Float,
'object': None,
'string': sa.Text,
'time': sa.Time,
'year': sa.Integer,
'yearmonth': None,
}The suggestion: express in a external file, or generate code from a CSV with all datatype map descriptions... As "RosettaStone-tabular-datatypes" ;-)
PS: for more general translation of primitive data types, a CSV at Data Packaged Core Datasets with all datatypes, perhaps we can reuse from a
| Canonic | Description | JSON | SQL-92 | Python | Java | ... |
|---|---|---|---|---|---|---|
| JSON | UTF8 string | string | text | str | String | ... |
| SQL-92 | integer 4 bytes | number | int4 | ... | .... | .... |
| .... | .... | ... | .... | .... | .... | ... |