Skip to content

Instantly share code, notes, and snippets.

@tjmonsi
Last active March 12, 2020 05:01
Show Gist options
  • Save tjmonsi/209ae4dd891e0dc985afdf3dd03d0c19 to your computer and use it in GitHub Desktop.
Save tjmonsi/209ae4dd891e0dc985afdf3dd03d0c19 to your computer and use it in GitHub Desktop.
New Database for project PB

Database for project PB

The idea is to have the edges for each topic be the topicPaths based on the crowd's replies.

So in essence, there will be the mainTopic with a list of subTopics that will serve as follow ups by the bot.

The crowd replies will be the topicPaths or edges.

- domains
  - data
    - $domainId
       - designerId: $designerId
       - name: STRING

- currentEdit
  - data
    - $domainId
      - commit: STRING
      - date: timeUTC
      - startTopic: $topicId05
      - topicList
        - 0: $topicId01,
        - 1: $topicId02,
          ...
        - n: $topicIdnn
      - topicPaths
        - 0: $topicPathId01,
        - 1: $topicPathId02,
          ...
        - n: $topicPathIdnn,
      - topicTransitions
        - 0:
          - start: $topicId01
          - transition: $topicPathId01
          - end: $topicId02
        - 1:
          - start: $topicId01
          - transition: $topicPathId02
          - end: $topicId03
          ...
        - n
          - start: $topicIdxx
          - transition: $topicPathIdyy
          - end: $topicIdzz

- deployments
  - data
    - $domainId
      - $deploymentId
        - commit: STRING
        - date: timeUTC
        - startTopic: $topicId05
        - topicList
          - 0: $topicId01,
          - 1: $topicId02,
            ...
          - n: $topicIdnn
        - topicPaths
          - 0: $topicPathId01,
          - 1: $topicPathId02,
            ...
          - n: $topicPathIdnn,
        - topicTransitions
          - 0:
            - start: $topicId01
            - transition: $topicPathId01
            - end: $topicId02
          - 1:
            - start: $topicId01
            - transition: $topicPathId02
            - end: $topicId03
            ...
          - n
            - start: $topicIdxx
            - transition: $topicPathIdyy
            - end: $topicIdzz
          
  - lists
    - history
      - $domainId
        - $deploymentId01: timeUTC // time of deployment in milliseconds after Jan 1, 1970
        - $deploymentId02: timeUTC
        ...
        - $deploymentId03: timeUTC

- topicPath
  - data
    - $domainId
      - $topicPath
        - name: STRING
        - deploymentId: $deploymentId
        - domainId: $domainId
        - crowdCreated: boolean
  - lists
    - utterances
      - $domainId
        - $topicPathId
          - 0: $utteranceId
            ...
          - n: $utternaceId

- topics
  - data
    - $domainId
      - $topicId
        - name: STRING
        - deploymentId: $deploymentId
        - domainId: $domainId
        - crowdCreated: boolean
        - hasSubtopic: boolean
  - lists
    - utterances
      - $domainId
        - $topicId
          - 0: $utteranceId
            ...
          - n: $utternaceId
    - subtopics
      - $domainId
        - $topicId
          - 0: $subtopicId
            ...
          - n: $subtopciId
          
- subtopics
  - data
    - $domainId
      - $topicId
        - $subtopicId
          - name: STRING
          - deploymentId: $deploymentId
          - domainId: $domainId
          - crowdCreated: boolean
          - topicId: $topicId
  - lists
    - utterances
      - $domainId
        - $topicId
          - $subtopicId
            - 0: $utteranceId
              ...
            - n: $utternaceId
         
- utterances
  - data
    - $domainId
      - $utteranceId
        - text: STRING
        - designer: BOOLEAN // true if it is from the designer
        - bot: BOOLEAN // true if it is from bot and false if it is from user
        - crowdId: $crowdId
        - topic: $topicId
        - domain: $domainId
        - deployment: $deployedId
        - date: dateUTC

- crowdCreatedPaths
  - data
    - $domainId
      - $deploymentId
        - startTopics: 
          - 0: $topicId01,
            ...
          - n: $topicIdnn
        - topicList
          - 0: $topicId01,
          - 1: $topicId02,
            ...
          - n: $topicIdnn
        - topicPaths
          - 0: $topicPathId01,
          - 1: $topicPathId02,
            ...
          - n: $topicPathIdnn,
        - topicTransitions
          - 0:
            - start: $topicId01
            - transition: $topicPathId01
            - end: $topicId02
          - 1:
            - start: $topicId01
            - transition: $topicPathId02
            - end: $topicId03
            ...
          - n
            - start: $topicIdxx
            - transition: $topicPathIdyy
            - end: $topicIdzz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment