From 1d6450ff0ddadcdece6fda3a4d1f921eb00cd84f Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 17 Oct 2017 10:42:49 -0700 Subject: [PATCH] Quasi-freeform tag patch This patch alters the structure of the "Sort column" schema to remove the potential problems with ontology inherent to defining "Categories", and redefines it into an array of strings called "Tags" which may be chosen from a predefined list, or custom. Custom tags are restricted to lowercase alphanumerics and hyphens. A list of potential predefined tags may be found in prior commits or in the original issue #1021 opened by Andy81le. --- CKAN.schema | 15 +++------------ Spec.md | 42 +++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 33 deletions(-) diff --git a/CKAN.schema b/CKAN.schema index 77a8b62bed..d4c4d60a1c 100644 --- a/CKAN.schema +++ b/CKAN.schema @@ -110,21 +110,12 @@ "description" : "Optional enforcement of strict version checks (defaults to false)", "type" : "boolean" }, - "categories" : { + "tags" : { "description" : "A series of descriptive keywords to provide quick filtering and organization", "type" : "array", "items" : { - "type" : "object", - "properties" : { - "main" : { - "description" : "Keywords which define how the mod interacts with or alters KSP", - "enum" : [ "plugin", "library", "physics", "parts", "config", "program", "other" ] - }, - "sub" : { - "description" : "Keywords which further describe what has been added or changed from stock gameplay", - "enum" : [ "informational", "control", "convenience", "graphics", "sound", "unmanned", "manned", "technology", "career", "sandbox", "resources", "pods", "fueltanks", "engines", "command", "structural", "coupling", "payload", "aerodynamic", "ground", "thermal", "electrical", "science", "utility", "oceanic", "terrain", "atmospheric", "orbital", "interplanetary" ] - } - } + "type" : "string", + "pattern" : "^[a-z-]+$" } }, "depends" : { diff --git a/Spec.md b/Spec.md index cd0d013acc..51ed383742 100644 --- a/Spec.md +++ b/Spec.md @@ -378,29 +378,29 @@ This field defaults to `false`, including for `spec_version`s less than `v1.16`, however CKAN clients prior to `v1.16` would only perform strict checking. -##### categories - -The `categories` field describes keywords that a user or program may use to -classify or filter the mod in a list, but which are not required. -One or more of either of the following fields may be used: - -- `main` : Keywords which define how the mod interacts with or alters KSP -- `sub` : Keywords which further describe what has been added or changed -from stock gameplay - -Example categories: - - "categories" : [ - { "main" : "physics" }, - { "main" : "parts" }, - { "sub" : "oceanic" }, - { "sub" : "thermal" }, - { "sub" : "science" } +##### tags + +The `tags` field describes keywords that a user or program may use to +classify or filter the mod in a list, but which are not required. These +may include general tags which define how the mod interacts with or alters +KSP or specific tags defining what has been added or changed from stock +gameplay. Tags may contain lowercase alphanumeric characters or hyphens. + +Example tags: + + "tags" : [ + "physics", + "parts", + "oceanic", + "thermal", + "science", + "my-1-custom-tag" ] -The first defined keyword in each category field should be considered the -most important and used to populate a sortable column, though it is intended -that all included category fields will be indexed and filterable. +The first defined keyword listed in the tag field which matches one of a +predefined set of 'standard' tags should be considered the most important +and used to populate a sortable column, though it is intended that all +included tags will be indexed and searchable. ### Relationships