Johnson Liang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 20200204 Activity 2.1.1 Schema ## DB Mapping - articles: https://github.com/cofacts/rumors-db/blob/master/schema/articles.js#L62 - tags: https://github.com/cofacts/rumors-db/blob/master/schema/tags.js ```javascript= // articles // (Remove "tags" field) articles = { articleCategories: { type: 'nested', properties: { // Who connected the replyId with the article. // Empty if the category is added by AI userId: { type: 'keyword' }, appId: { type: 'keyword' }, // exists only for AI tags aiModel: {type: 'keyword'}, aiConfidence: { type: 'double' }, // Counter cache for feedbacks positiveFeedbackCount: { type: 'long' }, negativeFeedbackCount: { type: 'long' }, // Foreign key categoryId: { type: 'keyword' }, status: { type: 'keyword' }, // NORMAL, DELETED createdAt: { type: 'date' }, updatedAt: { type: 'date' }, }, }, } articlecategoryfeedbacks = { // The article ID and reply ID is used in calculating replyrequests' ID. articleId: { type: 'keyword' }, categoryId: { type: 'keyword' }, // Auth userId: { type: 'keyword' }, // The user submits the feedback with which client. // Should be one of backend APP ID, 'BOT_LEGACY', 'RUMORS_LINE_BOT' or 'WEBSITE' appId: { type: 'keyword' }, score: { type: 'byte' }, // 1, -1 comment: { type: 'text', analyzer: 'cjk_url_email' }, // user comment for the article category createdAt: { type: 'date' }, updatedAt: { type: 'date' }, } // categories categories = { properties: { title: { type: 'text', analyzer: 'cjk' }, description: { type: 'text', analyzer: 'cjk' }, createdAt: { type: 'date' }, updatedAt: { type: 'date' }, } }; ``` ## GraphQL 看 `# [[NEW]]` 的 ```graphql # [[NEW]] type Category { id: String title: String description: String createdAt: String updatedAt: String } type Article { id: String text: String createdAt: String updatedAt: String """ [[NEW]] Number of normal article categories""" categoryCount: Int # [[NEW]] articleCategories( """ When specified, returns only article category with the specified status """ status: ArticleCategoryStatusEnum ): [ArticleCategory] """Number of normal article replies""" replyCount: Int """ Connections between this article and replies. Sorted by the logic described in https://github.com/cofacts/rumors-line-bot/issues/78. """ articleReplies( """ When specified, returns only article replies with the specified status """ status: ArticleReplyStatusEnum ): [ArticleReply] } """The linkage between an Article and a Reply""" type ArticleReply { replyId: String reply: Reply articleId: String article: Article """The user who conencted this reply and this article.""" user: User canUpdateStatus: Boolean feedbackCount: Int positiveFeedbackCount: Int negativeFeedbackCount: Int feedbacks: [ArticleReplyFeedback] """ The feedback of current user. null when not logged in or not voted yet. """ ownVote: FeedbackVote status: ArticleReplyStatusEnum createdAt: String updatedAt: String } """[[NEW]] The linkage between an Article and a Category""" type ArticleCategory { categoryId: String category: Category articleId: String article: Article """The user who conencted this category and this article.""" user: User aiModel: String aiConfidence: Float canUpdateStatus: Boolean feedbackCount: Int positiveFeedbackCount: Int negativeFeedbackCount: Int feedbacks: [ArticleCategoryFeedback] """ The feedback of current user. null when not logged in or not voted yet. """ ownVote: FeedbackVote status: ArticleCategoryStatusEnum createdAt: String updatedAt: String } """User feedback to an ArticleReply""" type ArticleReplyFeedback { id: String user: User comment: String """ One of 1, 0 and -1. Representing upvote, neutral and downvote, respectively [[NEW]] Breaking change for UI """ score: FeedbackVote } """[[NEW]] User feedback to an ArticleCategory""" type ArticleCategoryFeedback { id: String user: User comment: String """ One of 1, 0 and -1. Representing upvote, neutral and downvote, respectively """ score: FeedbackVote } enum ArticleReplyStatusEnum { NORMAL DELETED } # [[NEW]] enum ArticleCategoryStatusEnum { NORMAL DELETED } enum FeedbackVote { UPVOTE NEUTRAL DOWNVOTE } input ListArticleFilter { """List only the articles whose number of replies matches the criteria.""" replyCount: ListArticleReplyCountExpr # [[NEW]] categoryCount: ListArticleReplyCountExpr # [[NEW]] Articles with more matching categories will come to front categoryIds: [String] """List all articles related to a given string.""" moreLikeThis: ListArticleMoreLikeThisInput """List only the articles whose number of replies matches the criteria.""" replyRequestCount: ListArticleReplyRequestCountExpr """Use with userId to show only articles from a specific user.""" appId: String """Use with appId to show only articles from a specific user.""" userId: String """ Specify an articleId here to show only articles from the sender of that specified article. When specified, it overrides the settings of appId and userId. """ fromUserOfArticleId: String } input ListArticleMoreLikeThisInput { """The text string to query.""" like: String minimumShouldMatch: String } """ An entry of orderBy argument. Specifies field name and the sort order. Only one field name is allowd per entry. """ input ListArticleOrderBy { _score: SortOrderEnum updatedAt: SortOrderEnum createdAt: SortOrderEnum replyRequestCount: SortOrderEnum replyCount: SortOrderEnum lastRequestedAt: SortOrderEnum } input ListArticleReplyCountExpr { LT: Int GT: Int EQ: Int } input ListArticleReplyRequestCountExpr { LT: Int GT: Int EQ: Int } type ListReplyConnection { """ The total count of the entire collection, regardless of "before", "after". """ totalCount: Int edges: [ListReplyConnectionEdges] pageInfo: ListReplyConnectionPageInfo } type ListReplyConnectionEdges { node: Reply cursor: String score: Float } type ListReplyConnectionPageInfo { """ The cursor pointing to the last node of the entire collection, regardless of "before" and "after". Can be used to determine if is in the last page. """ lastCursor: String """ The cursor pointing to the first node of the entire collection, regardless of "before" and "after". Can be used to determine if is in first page. """ firstCursor: String } input ListReplyFilter { moreLikeThis: ListReplyMoreLikeThisInput """List the replies created by the requester themselves""" selfOnly: Boolean """List the replies of certain types""" type: ReplyTypeEnum } input ListReplyMoreLikeThisInput { like: String minimumShouldMatch: String } """ An entry of orderBy argument. Specifies field name and the sort order. Only one field name is allowd per entry. """ input ListReplyOrderBy { _score: SortOrderEnum createdAt: SortOrderEnum } type Mutation { """Create an article and/or a replyRequest""" CreateArticle( text: String! reference: ArticleReferenceInput! """ The reason why the user want to submit this article. Mandatory for 1st sender """ reason: String ): MutationResult """Create a reply that replies to the specified article.""" CreateReply(articleId: String!, text: String!, type: ReplyTypeEnum!, reference: String): MutationResult """Connects specified reply and specified article.""" CreateArticleReply(articleId: String!, replyId: String!): [ArticleReply] """[[NEW]] Connects specified reply and specified article.""" CreateArticleCategory(articleId: String!, categoryId: String!): [ArticleCategory] """Create or update a feedback on an article-reply connection""" CreateOrUpdateArticleReplyFeedback(articleId: String!, replyId: String!, vote: FeedbackVote!, comment: String): ArticleReply """[[NEW]] Create or update a feedback on an article-reply connection""" CreateOrUpdateArticleCategoryFeedback(articleId: String!, categoryId: String!, vote: FeedbackVote!, comment: String): ArticleCategory """Change status of specified articleReplies""" UpdateArticleReplyStatus(articleId: String!, replyId: String!, status: ArticleReplyStatusEnum!): [ArticleReply] """[[NEW]] Change status of specified articleCategories""" UpdateArticleCategoryStatus(articleId: String!, categoryId: String!, status: ArticleCategoryStatusEnum!): [ArticleCategory] } type Query { GetArticle(id: String): Article ListArticles( filter: ListArticleFilter orderBy: [ListArticleOrderBy] """Returns only first <first> results""" first: Int = 10 """ Specify a cursor, returns results after this cursor. cannot be used with "before". """ after: String """ Specify a cursor, returns results before this cursor. cannot be used with "after". """ before: String ): ArticleConnection } ```

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully