selfdefined / api

Self-Defined API
7 stars 2 forks source link

Data Structure #7

Open mjoynes-wombat-web opened 3 years ago

mjoynes-wombat-web commented 3 years ago

Data Structure

Based on the content of the definitions in the 11ty version of the site the data structure for the words are as follows in a SQL data structure.

New Err Diagram v2 (1)

Categories vs Entries

Categories will typically only have a title and the common attributes. They are used to categorize and related various entries with each other.

Entries are typically items with multiple attributes associated with them. They may be related to another entry but are typically done so to provide additional data about that entry and not to group and categorize them.

Translation Data Structure Rational

To handle the ability for any item to be translated into a given language each item will have multiple entries associated with it. These entries will also be associated to the localization (i.e. language) to which they are translated.

Common Entry Attributes

Entries will have a set of attributes that are common across them. At minimum I would recommend the following.

I would also recommend that any entry that will be directly accessed via a have the following.

In the case of Craft CMS these items are standard for all entries.

First Level Entry

The only first level entries are words. These word entries should have the following attributes associated with them. Words can be categorized by Flags and Statuses.

Second Level Entries

There are several second level entries. These are all groupings of items that are associated to one or more word entries to add aditional context to them but can be shared across multiple words. They are all managed in their own group and associated to the specific word entry as needed.

Alt Words

Alt Words can also be associated to the category group Alt Word Groups. Alt Words have the following attributes.

Readings

Readings have the following attributes.

Speech Parts

Speech Parts have the following attributes.

Sub Terms

Sub Terms have the following attributes.

Categories

There are several groupings of categories.

Alt Word Groups

Alt Word Groups are used to categorize Alt Words. They have the following attributes.

Flags

Flags can also be associated to the category groups Flag Levels and Flag Types. Flags have the following attributes.

Flag Levels

Flag Levels are used to categorize Flags. They have the following attributes.

Flag Types

Flag Types are used to categorize Flags. They have the following attributes.

Statuses

These have the following attributes.

Accessing Words

The data structure above allows words to be accessed/filtered in multiple ways. They can be accessed/filtered by the any of the categories. A word can be found through it's second level entry association as well.

Harnessing something like Elastic Search will allow for further access and flexibility when searching for an item. But this will be done through a search methodology and not through a filtering methodology.

mjoynes-wombat-web commented 3 years ago

Questions to discuss. @tatianamac

Are there any additional pieces of data? Are there any ways in which words will need to be categorized? Are there any ways in which the words will need to be accessed? Regarding language code for languages, are we using a particular standard? Based on the folder it looks like we're using a combination of the ISO 639-1 language code and the ISO 3166-1 Alpha-2 code. It looks like the common combination of these is with a dash but we're currently using an underscore. How should this look going forward and should we be supporting translated country names and language names? Are there any additional requirements from the front end or api users would need to change the data structure?