Skip to content

Commit

Permalink
Quasi-freeform tag patch
Browse files Browse the repository at this point in the history
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 KSP-CKAN#1021 opened by Andy81le.
  • Loading branch information
smattiso committed Oct 17, 2017
1 parent de2776b commit 1d6450f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 33 deletions.
15 changes: 3 additions & 12 deletions CKAN.schema
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {
Expand Down
42 changes: 21 additions & 21 deletions Spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1d6450f

Please sign in to comment.