Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

9.5 KB
Raw Blame
{
	"ID": "20210613191509-cbkxcbz",
	"Spec": "2",
	"Type": "NodeDocument",
	"Properties": {
		"id": "20210613191509-cbkxcbz",
		"title": "Content block attributes",
		"type": "doc",
		"updated": "20261024163828"
	},
	"Children": [
		{
			"ID": "20210613191548-b394bll",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20210613191548-b394bll",
				"updated": "20261024160716"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Overview"
				}
			]
		},
		{
			"ID": "20210613191548-o34mmas",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20210613191548-o34mmas",
				"updated": "20261024160716"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Attributes store additional information about a block as key-value pairs. Use them to name, organize, and query blocks. Attributes can be built-in or custom."
				}
			]
		},
		{
			"ID": "20210613191548-ckua3q3",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20210613191548-ckua3q3",
				"updated": "20261024163828"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Built-in attributes"
				}
			]
		},
		{
			"ID": "20210613191548-n6dt4hc",
			"Type": "NodeTable",
			"TableAligns": [
				2,
				0
			],
			"Properties": {
				"id": "20210613191548-n6dt4hc",
				"updated": "20261012014859"
			},
			"Children": [
				{
					"Type": "NodeTableHead",
					"Data": "thead",
					"Children": [
						{
							"Type": "NodeTableRow",
							"Data": "tr",
							"Children": [
								{
									"Type": "NodeTableCell",
									"Data": "th",
									"TableCellAlign": 2,
									"Children": [
										{
											"Type": "NodeText",
											"Data": "Property name"
										}
									]
								},
								{
									"Type": "NodeTableCell",
									"Data": "th",
									"Children": [
										{
											"Type": "NodeText",
											"Data": "Description"
										}
									]
								}
							]
						}
					]
				},
				{
					"Type": "NodeTableRow",
					"Data": "tr",
					"Children": [
						{
							"Type": "NodeTableCell",
							"Data": "td",
							"TableCellAlign": 2,
							"Children": [
								{
									"Type": "NodeText",
									"Data": "name"
								}
							]
						},
						{
							"Type": "NodeTableCell",
							"Data": "td",
							"Children": [
								{
									"Type": "NodeText",
									"Data": "Name of the content block"
								}
							]
						}
					]
				},
				{
					"Type": "NodeTableRow",
					"Data": "tr",
					"Children": [
						{
							"Type": "NodeTableCell",
							"Data": "td",
							"TableCellAlign": 2,
							"Children": [
								{
									"Type": "NodeText",
									"Data": "alias"
								}
							]
						},
						{
							"Type": "NodeTableCell",
							"Data": "td",
							"Children": [
								{
									"Type": "NodeText",
									"Data": "Alias of the content block"
								}
							]
						}
					]
				},
				{
					"Type": "NodeTableRow",
					"Data": "tr",
					"Children": [
						{
							"Type": "NodeTableCell",
							"Data": "td",
							"TableCellAlign": 2,
							"Children": [
								{
									"Type": "NodeText",
									"Data": "memo"
								}
							]
						},
						{
							"Type": "NodeTableCell",
							"Data": "td",
							"Children": [
								{
									"Type": "NodeText",
									"Data": "Memo of the content block"
								}
							]
						}
					]
				},
				{
					"Type": "NodeTableRow",
					"Data": "tr",
					"Children": [
						{
							"Type": "NodeTableCell",
							"Data": "td",
							"TableCellAlign": 2,
							"Children": [
								{
									"Type": "NodeText",
									"Data": "bookmark"
								}
							]
						},
						{
							"Type": "NodeTableCell",
							"Data": "td",
							"Children": [
								{
									"Type": "NodeText",
									"Data": "Bookmark of content block"
								}
							]
						}
					]
				}
			]
		},
		{
			"ID": "20261012014537-d763t09",
			"Type": "NodeHeading",
			"Properties": {
				"id": "20261012014537-d763t09",
				"updated": "20261024163828"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Edit aliases"
				}
			],
			"HeadingLevel": 3
		},
		{
			"ID": "20261012014537-a0f03gx",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20261012014537-a0f03gx",
				"updated": "20261024163828"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "In the attribute panel, aliases appear as separate chips. Click Add alias to add one or click an existing alias to edit it; click its close icon to remove it. Separate multiple aliases with English commas to add them together. "
				}
			]
		},
		{
			"ID": "20261024163828-0gax1k2",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20261024163828-0gax1k2",
				"updated": "20261024163828"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Press "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "kbd",
					"TextMarkTextContent": "Enter"
				},
				{
					"Type": "NodeText",
					"Data": " to save, or move focus away from the input. Press "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "kbd",
					"TextMarkTextContent": "Esc"
				},
				{
					"Type": "NodeText",
					"Data": " to cancel the current input. Leading and trailing whitespace, empty entries and exact duplicates are removed from new input."
				},
				{
					"Type": "NodeText",
					"Data": " "
				}
			]
		},
		{
			"ID": "20261024163828-86vg1pz",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20261024163828-86vg1pz",
				"updated": "20261024163828"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Drag aliases to reorder them; the order is saved when you release. Touchscreens also support dragging. Press "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "kbd",
					"TextMarkTextContent": "Esc"
				},
				{
					"Type": "NodeText",
					"Data": " while dragging to cancel the reorder."
				}
			]
		},
		{
			"ID": "20210613191548-65gd8yo",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20210613191548-65gd8yo",
				"updated": "20261024160716"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Custom attributes"
				}
			]
		},
		{
			"ID": "20251201102224-5uvilvm",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20251201102224-5uvilvm",
				"updated": "20261024160716"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Set custom attributes through "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "kbd",
					"TextMarkTextContent": "Block icon menu"
				},
				{
					"Type": "NodeText",
					"Data": " - "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "kbd",
					"TextMarkTextContent": "Attributes"
				},
				{
					"Type": "NodeText",
					"Data": ". Names must start with a lowercase English letter and may contain lowercase English letters, digits, and hyphens (-), such as "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "doing"
				},
				{
					"Type": "NodeText",
					"Data": ", "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "day1"
				},
				{
					"Type": "NodeText",
					"Data": ", or "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "project-id"
				},
				{
					"Type": "NodeText",
					"Data": ". Uppercase input is converted to lowercase. SiYuan adds the "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "custom-"
				},
				{
					"Type": "NodeText",
					"Data": " prefix when saving to distinguish custom attributes from built-in ones."
				}
			]
		},
		{
			"ID": "20210613191548-ihlwok9",
			"Type": "NodeHeading",
			"HeadingLevel": 2,
			"Properties": {
				"id": "20210613191548-ihlwok9",
				"updated": "20210613191548"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "Query content blocks based on attributes"
				}
			]
		},
		{
			"ID": "20210613191548-h0zl261",
			"Type": "NodeParagraph",
			"Properties": {
				"id": "20210613191548-h0zl261",
				"updated": "20210613191548"
			},
			"Children": [
				{
					"Type": "NodeText",
					"Data": "For example, when we set the properties of "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "progress=30"
				},
				{
					"Type": "NodeText",
					"Data": " and "
				},
				{
					"Type": "NodeTextMark",
					"TextMarkType": "code",
					"TextMarkTextContent": "priority=2"
				},
				{
					"Type": "NodeText",
					"Data": " for the content block, we can query all content blocks with a progress of 30 and a priority of 2 through SQL:"
				}
			]
		},
		{
			"ID": "20210613191548-vaj5jsf",
			"Type": "NodeCodeBlock",
			"IsFencedCodeBlock": true,
			"Properties": {
				"id": "20210613191548-vaj5jsf",
				"updated": "20210613191548"
			},
			"Children": [
				{
					"Type": "NodeCodeBlockFenceOpenMarker",
					"Data": "```"
				},
				{
					"Type": "NodeCodeBlockFenceInfoMarker",
					"CodeBlockInfo": "c3Fs"
				},
				{
					"ID": "20220307092214-mhz28us",
					"Type": "NodeCodeBlockCode",
					"Data": "SELECT *\nFROM blocks\nWHERE id IN (\n    SELECT block_id\n    FROM attributes AS a\n    WHERE (a.name ='custom-progress' AND a.value = '30')\n       OR (a.name ='custom-priority' AND a.value = '2')\n    GROUP BY block_id\n    HAVING count(block_id) = 2\n);\n",
					"Properties": {
						"id": "20220307092214-mhz28us"
					}
				},
				{
					"Type": "NodeCodeBlockFenceCloseMarker",
					"Data": "```"
				}
			]
		}
	]
}