##################################################################################################################################
#                                                                                                                                #
# Table: DbParameters                                                                                                            #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# Name              # Text       #                   # Name of the parameter.                                                    #
# Value             # LongText   # Null              # Its value.                                                                #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#----------#---------------------#-----------------------------------------#-----------------------------------------------------#
#          #                     #                                         #                                                     #
# Name     # Definition          # Kind                                    # Description                                         #
#----------#---------------------#-----------------------------------------#-----------------------------------------------------#
# ByName   # +Name               # Primary & Unique                        # Used to look up a parameter.                        #
#----------#---------------------#-----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: ContentOwners                                                                                                           #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# DN                # Text       #                   # Qualified name of the owner, constructed from the Digital Certificate.    #
# ID_owner          # AutoNumber #                   # ID associated with the owner.                                             #
# IsOEM             # Bool       #                   # This is an OEM, so it can create nodes.                                   #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#------------#-------------------#-----------------------------------------#-----------------------------------------------------#
#            #                   #                                         #                                                     #
# Name       # Definition        # Kind                                    # Description                                         #
#------------#-------------------#-----------------------------------------#-----------------------------------------------------#
# ByVendorID # +DN               # Primary & Unique                        # Used to look up an owner.                           #
# Owner      # +ID_owner         # Unique                                  #                                                     #
#------------#-------------------#-----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: SynSets                                                                                                                 #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# Name              # Text       #                   # SynSet name.                                                              #
# ID_owner          # Number     #                   # Owner of the SynSet.                                                      #
# ID_synset         # Number     # Autoincrement     # SynSet number.                                                            #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
#           #                    #                                         #                                                     #
# Name      # Definition         # Kind                                    # Description                                         #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
# ByPair    # +Name+ID_owner     # Primary & Unique                        # Used during add/remove.                             #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: HelpImage                                                                                                               #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# ID_owner          # Number     #                   # Owner of the Help Image.                                                  #
# File              # Text       #                   # Name of the file that is part of the Help Image.                          #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
#           #                    #                                         #                                                     #
# Name      # Definition         # Kind                                    # Description                                         #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
# ByFile    # +File              # Primary & Unique                        # Used during add/remove.                             #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: Scope                                                                                                                   #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# ID_owner          # Number     #                   # Owner of the scope.                                                       #
# ID_scope          # Number     # Autoincrement     # Identifier for the scope.                                                 #
# Name              # Text       #                   # Name of the application.                                                  #
# Category          # LongText   #                   # Position in the taxomony.                                                 #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#----------------#---------------------#-----------------------------------#-----------------------------------------------------#
#                #                     #                                   #                                                     #
# Name           # Definition          # Kind                              # Description                                         #
#----------------#---------------------#-----------------------------------#-----------------------------------------------------#
# ByName         # +Name               # Primary & Unique                  # Used to locate a scope.                             #
# ByScope        # +ID_scope           # Unique                            #                                                     #
# OwnedScopes    # +ID_owner           # External to ContentOwners         # Used to look up all the scopes of an owner.         #
#----------------#---------------------#-----------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: IndexFiles                                                                                                              #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# ID_owner          # Number     #                   # Owner of the HHK.                                                         #
# ID_scope          # Number     #                   # Scope of the HHK.                                                         #
# Storage           # LongText   # Null              # Location and name of the CHM.                                             #
# File              # LongText   # Null              # Name of the HHK file inside the CHM.                                      #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
#           #                    #                                         #                                                     #
# Name      # Definition         # Kind                                    # Description                                         #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
# ByScope   # +ID_scope          #                                         # Used during add/remove.                             #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: FullTextSearch                                                                                                          #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# ID_owner          # Number     #                   # Owner of the CHM.                                                         #
# ID_scope          # Number     #                   # Scope of the CHM.                                                         #
# CHM               # LongText   # Null              # Location and name of the associated CHM.                                  #
# CHQ               # LongText   # Null              # Location and name of the CHQ.                                             #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
#           #                    #                                         #                                                     #
# Name      # Definition         # Kind                                    # Description                                         #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
# ByScope   # +ID_scope          #                                         # Used during add/remove.                             #
#-----------#--------------------#-----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: Taxonomy                                                                                                                #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# ID_node           # Number     # Autoincrement     # Identifier for the node.                                                  #
# Pos               # Number     #                   # Order in which to display the node.                                       #
# ID_parent         # Number     # Null              # Parent of the current node.                                               #
# ID_owner          # Number     #                   # Owner of the node.                                                        #
# Entry             # Text       #                   # Single component in the taxonomy path.                                    #
# Title             # LongText   # Null              # Display string.                                                           #
# Description       # LongText   # Null              # Description of the node.                                                  #
# DescriptionURI    # LongText   # Null              # Alternative description of the node, as an HTML page to display.          #
# IconURI           # LongText   # Null              # Optional icon for the node.                                               #
# Visible           # Bool       #                   # Boolean value to determine whether it should be visible under XMLTOC.     #
# Subsite           # Bool       #                   # Boolean value to determine whether this is a data island or not.          #
# NavModel          # Long       #                   # Type of the navigation model.                                             #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#----------------#---------------------#-----------------------------------#-----------------------------------------------------#
#                #                     #                                   #                                                     #
# Name           # Definition          # Kind                              # Description                                         #
#----------------#---------------------#-----------------------------------#-----------------------------------------------------#
# SubNode        # +ID_parent +Entry   # Primary & Unique                  # Used to locate a node under a certain parent.       #
# Children       # +ID_parent          # External to Taxonomy              # Used to find all the subnodes of a specified node.  #
# Node           # +ID_node            # Unique                            # Used to locate a specific node.                     #
#----------------#---------------------#-----------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: Topics                                                                                                                  #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# ID_topic          # Number     # Autoincrement     # Unique Identified for the topic.                                          #
# ID_node           # Number     #                   # Position on the taxonomy.                                                 #
# ID_owner          # Number     #                   # Owner of the topic.                                                       #
# Pos               # Number     #                   # Order in which to display the topic.                                      #
# Title             # LongText   # Null              # Display string.                                                           #
# URI               # LongText   # Null              # Hyperlink for the contents.                                               #
# Description       # LongText   # Null              # Long description of the topic.                                            #
# IconURI           # LongText   # Null              # Optional icon for the node.                                               #
# Type              # Number     #                   # The type of topic.                                                        #
# Visible           # Bool       #                   # Boolean value to determine whether it should be visible under XMLTOC.     #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#-----------------#---------------#----------------------------------------#-----------------------------------------------------#
#                 #               #                                        #                                                     #
# Name            # Definition    # Kind                                   # Description                                         #
#-----------------#---------------#----------------------------------------#-----------------------------------------------------#
# SingleTopic     # +ID_topic     # Primary & Unique                       # Used during search, to find a topic.                #
# TopicsUnderNode # +ID_node      # External to Taxonomy                   # Used to located all the topics under a certain node.#
# ByURI           # +URI          #                                        # Used to locate the topics for an URL.               #
#-----------------#---------------#----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: Synonyms                                                                                                                #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# Keyword           # Text       #                   # Keyword name.                                                             #
# ID_synset         # Number     #                   # Synset number.                                                            #
# ID_owner          # Number     #                   # Owner of the synset.                                                      #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#--------#-----------------------#-----------------------------------------#-----------------------------------------------------#
#        #                       #                                         #                                                     #
# Name   # Definition            # Kind                                    # Description                                         #
#--------#-----------------------#-----------------------------------------#-----------------------------------------------------#
# ByPair # +Keyword+ID_synset    # Primary & Unique                        # Used to look up the owner of a synset.              #
# ByName # +Keyword              #                                         # Used to look up the ID of a synset.                 #
#--------#-----------------------#-----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: Keywords                                                                                                                #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# Keyword           # Text       #                   # Keyword name.                                                             #
# ID_keyword        # Number     # Autoincrement     # Keyword number.                                                           #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#--------#-----------------------#-----------------------------------------#-----------------------------------------------------#
#        #                       #                                         #                                                     #
# Name   # Definition            # Kind                                    # Description                                         #
#--------#-----------------------#-----------------------------------------#-----------------------------------------------------#
# ByName # +Keyword              # Primary & Unique                        # Used to look up the ID of a keyword.                #
#--------#-----------------------#-----------------------------------------#-----------------------------------------------------#
##################################################################################################################################


##################################################################################################################################
#                                                                                                                                #
# Table: Matches                                                                                                                 #
#                                                                                                                                #
# Columns                                                                                                                        #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                   #            #                   #                                                                           #
# Name              # Type       # Flags             # Description                                                               #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
# ID_topic          # Number     #                   # External Key into "Topics" table.                                         #
# ID_keyword        # Number     #                   # External Key into "Keywords" table.                                       #
# Priority          # Number     #                   # To sort results.                                                          #
# HHK               # Bool       #                   # Boolean value to determine whether it should make it to the Merged HHK.   #
#-------------------#------------#-------------------#---------------------------------------------------------------------------#
#                                                                                                                                #
# Indexes                                                                                                                        #
#-----------#-----------------------#--------------------------------------#-----------------------------------------------------#
#           #                       #                                      #                                                     #
# Name      # Definition            # Kind                                 # Description                                         #
#-----------#-----------------------#--------------------------------------#-----------------------------------------------------#
# Pair      # +ID_keyword +ID_topic # Primary & Unique                     # Used to locate the topics associated with a keyword.#
# ByKeyword # +ID_keyword           # External to Keywords                 # Used to locate the topics associated with a keyword.#
# ByTopic   # +ID_topic             # External to Topics                   # Used to locate the keywords accociated with a topic.#
#-----------#-----------------------#--------------------------------------#-----------------------------------------------------#
##################################################################################################################################


/////////////////////////////////////////////////////////////////////////////////
//                                                                             //
// OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD //
//                                                                             //
/////////////////////////////////////////////////////////////////////////////////

DbParameters:
        Name        Text
        Value       LongText

ContentOwners:
        OWID        AutoNumber
        DN          Text

NodeOwners:
        NOID        AutoNumber
        OWID        Number

SuperKeywords:
        KID         AutoNumber
        EID         Number
        Keyword     Text

Matches:
        OID         Number          External Key into topics database
        KID         Number          Unique Keyword, which was originally submitted for the match.
        EID         Number          Equivalent Keyword ID associated with the match.
        HHK         Yes/No          Boolean value to determine whether it should make it to the Merged HHK
        Title       LongText        Alternative title to be shown

Topics:
        OID         AutoNumber      Unique ID entered when creating this TOC from the parsing process
        Category    LongText        Path to the node in the taxonomy.
        Entry       Text
        URI         HyperLink
        Title       Text
        Description LongText
        Type        Number
        OWID        Number