Attribute syntax can contribute additional Metadata to various Objects, including:

  • Pages
  • Items
  • Tasks


Syntax

The syntax is as follows:

[attributeName: value]


For Obsidian/LogSeq compatibility, you can also double the colon like this: [attributeName:: value]

Attribute names need to be alpha-numeric. Values are interpreted as YAML values. So here are some examples of valid attribute definitions:

  • string:
  • number:
  • array:


Multiple attributes can be attached to a single entity, e.g. like so:

  • Some item


Scope

Depending on where these attributes appear, they attach to different things. For instance, this attaches an attribute to a page:



However, usually, Frontmatter is used for this purpose instead.

Example query:

${query[[
  from index.tag "page"
  where _.name == editor.getCurrentPage()
  select {name=_.name, pageAttribute=_.pageAttribute}
]]}


This attaches an attribute to an item:



Example query:

${query[[
  from index.tag "specialitem"
  where itemAttribute == "hello"
  select {
    name = _.name,
    itemAttribute = _.itemAttribute
  }
]]}


This attaches an attribute to a task:

  • Task


Example query:

${query[[
  from index.tag "task"
  where taskAttribute == "hello"
  select {
    name = _.name,
    taskAttribute = _.taskAttribute
  }
]]}