Skip to content

Commit b9e8645

Browse files
authored
fix: list field is present in profiles (#1070)
1 parent 972e014 commit b9e8645

File tree

4 files changed

+421
-0
lines changed

4 files changed

+421
-0
lines changed

profiles/dictionary/schema.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ tableSchemaField:
120120
- "$ref": "#/definitions/tableSchemaFieldGeoPoint"
121121
- "$ref": "#/definitions/tableSchemaFieldGeoJSON"
122122
- "$ref": "#/definitions/tableSchemaFieldArray"
123+
- "$ref": "#/definitions/tableSchemaFieldList"
123124
- "$ref": "#/definitions/tableSchemaFieldDuration"
124125
- "$ref": "#/definitions/tableSchemaFieldAny"
125126
tableSchemaFieldsMatch:

public/profiles/2.1/datapackage.json

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,6 +2686,146 @@
26862686
"{\n \"name\": \"options\"\n \"type\": \"array\"\n}\n"
26872687
]
26882688
},
2689+
{
2690+
"type": "object",
2691+
"title": "List Field",
2692+
"description": "The field contains data that is an ordered one-level depth collection of primitive values with a fixed item type.",
2693+
"required": [
2694+
"name",
2695+
"type"
2696+
],
2697+
"properties": {
2698+
"name": {
2699+
"title": "Name",
2700+
"description": "A name for this field.",
2701+
"type": "string"
2702+
},
2703+
"title": {
2704+
"title": "Title",
2705+
"description": "A human-readable title.",
2706+
"type": "string",
2707+
"examples": [
2708+
"{\n \"title\": \"My Package Title\"\n}\n"
2709+
]
2710+
},
2711+
"description": {
2712+
"title": "Description",
2713+
"description": "A text description. Markdown is encouraged.",
2714+
"type": "string",
2715+
"examples": [
2716+
"{\n \"description\": \"# My Package description\\nAll about my package.\"\n}\n"
2717+
]
2718+
},
2719+
"example": {
2720+
"title": "Example",
2721+
"description": "An example value for the field.",
2722+
"type": "string",
2723+
"examples": [
2724+
"{\n \"example\": \"Put here an example value for your field\"\n}\n"
2725+
]
2726+
},
2727+
"missingValues": {
2728+
"anyOf": [
2729+
{
2730+
"type": "array",
2731+
"items": {
2732+
"type": "string"
2733+
}
2734+
},
2735+
{
2736+
"type": "array",
2737+
"items": {
2738+
"type": "object",
2739+
"required": [
2740+
"value"
2741+
],
2742+
"properties": {
2743+
"value": {
2744+
"type": "string"
2745+
},
2746+
"label": {
2747+
"type": "string"
2748+
}
2749+
}
2750+
}
2751+
}
2752+
],
2753+
"default": [
2754+
""
2755+
],
2756+
"description": "Values that when encountered in the source, should be considered as `null`, 'not present', or 'blank' values.",
2757+
"context": "Many datasets arrive with missing data values, either because a value was not collected or it never existed.\nMissing values may be indicated simply by the value being empty in other cases a special value may have been used e.g. `-`, `NaN`, `0`, `-9999` etc.\nThe `missingValues` property provides a way to indicate that these values should be interpreted as equivalent to null.\n\n`missingValues` are strings rather than being the data type of the particular field. This allows for comparison prior to casting and for fields to have missing value which are not of their type, for example a `number` field to have missing values indicated by `-`.\n\nThe default value of `missingValue` for a non-string type field is the empty string `''`. For string type fields there is no default for `missingValue` (for string fields the empty string `''` is a valid value and need not indicate null).",
2758+
"examples": [
2759+
"{\n \"missingValues\": [\n \"-\",\n \"NaN\",\n \"\"\n ]\n}\n",
2760+
"{\n \"missingValues\": []\n}\n"
2761+
]
2762+
},
2763+
"type": {
2764+
"description": "The type keyword, which `MUST` be a value of `list`.",
2765+
"enum": [
2766+
"list"
2767+
]
2768+
},
2769+
"format": {
2770+
"description": "There are no format keyword options for `list`: only `default` is allowed.",
2771+
"enum": [
2772+
"default"
2773+
],
2774+
"default": "default"
2775+
},
2776+
"delimiter": {
2777+
"title": "Delimiter",
2778+
"description": "A character sequence to use as the field separator.",
2779+
"type": "string",
2780+
"default": ",",
2781+
"examples": [
2782+
"{\n \"delimiter\": \",\"\n}\n",
2783+
"{\n \"delimiter\": \";\"\n}\n"
2784+
]
2785+
},
2786+
"itemType": {
2787+
"title": "Item type.",
2788+
"description": "Specifies the list item type.",
2789+
"type": "string",
2790+
"enum": [
2791+
"string",
2792+
"number",
2793+
"integer",
2794+
"boolean",
2795+
"datetime",
2796+
"date",
2797+
"time"
2798+
]
2799+
},
2800+
"constraints": {
2801+
"title": "Constraints",
2802+
"description": "The following constraints apply for `list` fields.",
2803+
"type": "object",
2804+
"properties": {
2805+
"required": {
2806+
"type": "boolean",
2807+
"description": "Indicates whether a property must have a value for each instance.",
2808+
"context": "An empty string is considered to be a missing value."
2809+
},
2810+
"minLength": {
2811+
"type": "integer",
2812+
"description": "An integer that specifies the minimum length of a value."
2813+
},
2814+
"maxLength": {
2815+
"type": "integer",
2816+
"description": "An integer that specifies the maximum length of a value."
2817+
}
2818+
}
2819+
},
2820+
"rdfType": {
2821+
"type": "string",
2822+
"description": "The RDF type for this field."
2823+
}
2824+
},
2825+
"examples": [
2826+
"{\n \"name\": \"options\"\n \"type\": \"list\"\n}\n"
2827+
]
2828+
},
26892829
{
26902830
"type": "object",
26912831
"title": "Duration Field",

public/profiles/2.1/dataresource.json

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,6 +2450,146 @@
24502450
"{\n \"name\": \"options\"\n \"type\": \"array\"\n}\n"
24512451
]
24522452
},
2453+
{
2454+
"type": "object",
2455+
"title": "List Field",
2456+
"description": "The field contains data that is an ordered one-level depth collection of primitive values with a fixed item type.",
2457+
"required": [
2458+
"name",
2459+
"type"
2460+
],
2461+
"properties": {
2462+
"name": {
2463+
"title": "Name",
2464+
"description": "A name for this field.",
2465+
"type": "string"
2466+
},
2467+
"title": {
2468+
"title": "Title",
2469+
"description": "A human-readable title.",
2470+
"type": "string",
2471+
"examples": [
2472+
"{\n \"title\": \"My Package Title\"\n}\n"
2473+
]
2474+
},
2475+
"description": {
2476+
"title": "Description",
2477+
"description": "A text description. Markdown is encouraged.",
2478+
"type": "string",
2479+
"examples": [
2480+
"{\n \"description\": \"# My Package description\\nAll about my package.\"\n}\n"
2481+
]
2482+
},
2483+
"example": {
2484+
"title": "Example",
2485+
"description": "An example value for the field.",
2486+
"type": "string",
2487+
"examples": [
2488+
"{\n \"example\": \"Put here an example value for your field\"\n}\n"
2489+
]
2490+
},
2491+
"missingValues": {
2492+
"anyOf": [
2493+
{
2494+
"type": "array",
2495+
"items": {
2496+
"type": "string"
2497+
}
2498+
},
2499+
{
2500+
"type": "array",
2501+
"items": {
2502+
"type": "object",
2503+
"required": [
2504+
"value"
2505+
],
2506+
"properties": {
2507+
"value": {
2508+
"type": "string"
2509+
},
2510+
"label": {
2511+
"type": "string"
2512+
}
2513+
}
2514+
}
2515+
}
2516+
],
2517+
"default": [
2518+
""
2519+
],
2520+
"description": "Values that when encountered in the source, should be considered as `null`, 'not present', or 'blank' values.",
2521+
"context": "Many datasets arrive with missing data values, either because a value was not collected or it never existed.\nMissing values may be indicated simply by the value being empty in other cases a special value may have been used e.g. `-`, `NaN`, `0`, `-9999` etc.\nThe `missingValues` property provides a way to indicate that these values should be interpreted as equivalent to null.\n\n`missingValues` are strings rather than being the data type of the particular field. This allows for comparison prior to casting and for fields to have missing value which are not of their type, for example a `number` field to have missing values indicated by `-`.\n\nThe default value of `missingValue` for a non-string type field is the empty string `''`. For string type fields there is no default for `missingValue` (for string fields the empty string `''` is a valid value and need not indicate null).",
2522+
"examples": [
2523+
"{\n \"missingValues\": [\n \"-\",\n \"NaN\",\n \"\"\n ]\n}\n",
2524+
"{\n \"missingValues\": []\n}\n"
2525+
]
2526+
},
2527+
"type": {
2528+
"description": "The type keyword, which `MUST` be a value of `list`.",
2529+
"enum": [
2530+
"list"
2531+
]
2532+
},
2533+
"format": {
2534+
"description": "There are no format keyword options for `list`: only `default` is allowed.",
2535+
"enum": [
2536+
"default"
2537+
],
2538+
"default": "default"
2539+
},
2540+
"delimiter": {
2541+
"title": "Delimiter",
2542+
"description": "A character sequence to use as the field separator.",
2543+
"type": "string",
2544+
"default": ",",
2545+
"examples": [
2546+
"{\n \"delimiter\": \",\"\n}\n",
2547+
"{\n \"delimiter\": \";\"\n}\n"
2548+
]
2549+
},
2550+
"itemType": {
2551+
"title": "Item type.",
2552+
"description": "Specifies the list item type.",
2553+
"type": "string",
2554+
"enum": [
2555+
"string",
2556+
"number",
2557+
"integer",
2558+
"boolean",
2559+
"datetime",
2560+
"date",
2561+
"time"
2562+
]
2563+
},
2564+
"constraints": {
2565+
"title": "Constraints",
2566+
"description": "The following constraints apply for `list` fields.",
2567+
"type": "object",
2568+
"properties": {
2569+
"required": {
2570+
"type": "boolean",
2571+
"description": "Indicates whether a property must have a value for each instance.",
2572+
"context": "An empty string is considered to be a missing value."
2573+
},
2574+
"minLength": {
2575+
"type": "integer",
2576+
"description": "An integer that specifies the minimum length of a value."
2577+
},
2578+
"maxLength": {
2579+
"type": "integer",
2580+
"description": "An integer that specifies the maximum length of a value."
2581+
}
2582+
}
2583+
},
2584+
"rdfType": {
2585+
"type": "string",
2586+
"description": "The RDF type for this field."
2587+
}
2588+
},
2589+
"examples": [
2590+
"{\n \"name\": \"options\"\n \"type\": \"list\"\n}\n"
2591+
]
2592+
},
24532593
{
24542594
"type": "object",
24552595
"title": "Duration Field",

0 commit comments

Comments
 (0)