DIP 102
July 22, 2023 ยท View on GitHub
Default properties for newly declared word types
For each word type, by convention, properties will be made available by default but will not necessarily be required.
slugnametitledescription
Note that in the first example above, name and title are present under widgetData but are absent from wordData.
The inclusion of name and title, though it may seem redundant, will be useful for UI purposes. The purpose of title is to basically be more formal presentation than name. Typically simply capitalized.
singular vs plural forms
In some cases, it will be desirable to distinguish singular and plural forms of slug, name, and title. In such instances, the strings slug, name, and/or titlw will be replaced by the objects oSlug, oName, and oTitle, the o indicating "object", each of which will contain two properties: singular and plural, each of which is a string. See declarations for illustrations, with singular forms under wordData but singular + plural forms under wordTypeData.
Singular and plural forms are notably in the following word types:
listwordType
relationships between slugs
Frequently, the slugs will have the following relationship, as in the example:
In this example, the slugs are all the same (all "Fido"):
{
"wordData": {
"slug": "Fido",
"name": "Fido",
"title": "Fido",
"wordTypes": ["animalData","dogData"],
"metaData": {
"nostr": {
"stewardPubkey": "c51a542e4f93afe6f45e5bef002f7a0efcc0a47460a736654c0bee5402c482fa",
"uniqueIDs": {
"slug": "relationshipType_isASubsetOf"
}
}
}
},
"animalData": {
"slug": "Fido",
},
"dogData": {
"slug": "Fido",
}
}
But in this example, wordData.slug does not equal relationshipTypeData.slug:
{
"wordData": {
"slug": "relationshipType_isASubsetOf",
"name": "relationship type: is a subset of",
"title": "Relationship Type: Is a Subset Of",
"wordTypes": ["relationshipType"],
"metaData": {
"nostr": {
"stewardPubkey": "c51a542e4f93afe6f45e5bef002f7a0efcc0a47460a736654c0bee5402c482fa",
"uniqueIDs": {
"slug": "relationshipType_isASubsetOf"
}
}
}
},
"relationshipTypeData": {
"slug": "isASubsetOf",
"name": "is a subset of",
"title": "Is a Subset Of",
"description": "One of the principle links in a class thread.",
"wordFromAllowedWordTypes": ["set", "superset"],
"wordToAllowedWordTypes": ["set", "superset"],
}
}
The reason for making them distinct is that we need to avoid multiple words using the same wordData.slug. (Is this a good example? Necessary in this case to use relationshipType_isASubsetOf rather than just isASubsetOf?)
Slug naming conventions
Naming conventions for wordData.slug are illustrated for each of the structural word types using widgets and foo bars as examples:
| word type | slug for widgets | slug for foo bars |
|---|---|---|
| word type | widget | fooBar |
| superset | widgets | fooBars |
| json schema | jsonSchemaFor_widgets | jsonSchemaFor_fooBars |
| concept | conceptFor_widgets | conceptFor_fooBars |
| item directory | itemDirectoryFor_widgets | itemDirectoryFor_fooBars |
| property directory | propertyDirectoryFor_widgets | propertyDirectoryFor_fooBars |
| set | setOf_nuclearWidgets | setOf_chocolateFooBars |
Note that for each of the standard structural conceptual word types (jsonSchema, concept, itemDirectory, propertyDirectory), the slug is (wordType)For_(the plural slug form of the concept), with the exception of wordType and superset, for which the singular and plural forms are used by themselves without the prefix, respectively. Yeah, I know that's a mixture of camelCase and snake_case ...
Why are wordType and superset special? Consider the following sentences:
- Give me the superset of all
widgets(superset). - I was today years old when I finally grokked the abstract idea of a
widget(word type).
Note that this shows why it's necessary for wordTypeData to record a singular as well as a plural form for slug, and that these stwo slugs must be DISTINCT. Otherwise, the word type and the superset nodes would use the same slug.