Syntax for inline properties::

From the discussion here I think we have a cool proposal.

We want this syntax:

- [[title::The Picture of Dorian Gray]] is a [[type::book]]
  written by [[author::Oscar Wilde]].

as a more compact way to write this block:

- type:: book
  title:: The Picture of Dorian Gray
  author:: Oscar Wilde
  [[The Picture of Dorian Gray]] is a [[book]]
  written by [[Oscar Wilde]].

Rendered, with links, as:

The Picture of Dorian Gray is a book written by Oscar Wilde.

So it’s rendered just like:

- [[The Picture of Dorian Gray]] is a [[book]]
  written by [[Oscar Wilde]].

But it also has these properties:

- type:: book
  title:: The Picture of Dorian Gray
  author:: Oscar Wilde

So with a sentence we could add an entry to our personal database:

Title Author
The Picture of Dorian Gray Oscar Wilde

Imagine if in the future we will have a (Machine Learning?) tool that infer from the sentence which properties could be assigned to certain words and suggest to add the systax above: we could have a personal database automatically populated from sentences in our notes!

I like this idea, with the assumption that it would still be possible to add properties without the need to make it a link. In my example the [[type:: book]] would not be a link as I do not wan’t a page book in my vault.

With that in mind I would suggest a different syntax like {{type:: book}} for a property without the link and {{type::[[book]]}} for a property with the value (book) as a link.

The rendering should be the same as you suggest while taking into account to show the link or to not show a link.

Adding to that I would like to drop the page-property and property difference. No need for that both link to a block with the first linking to the first block on a page. No need to treat that differently I think.

1 Like

I though about that and ignored it to don’t make things more complicated for now. But also something like this would work:

- This is a type:: "book".

Notice that there are other cases not covered here, for example the , to separate multiple values:

- key:: value 1, value 2

But for the proposed syntax I prefer this:

- [[title:: This is only one value, with a comma]]

is just interpreted as:

- title:: [[This is only one value, with a comma]]

So mine is just a shortcut for the most common use case. I didn’t cover the others (not links, multiple values etc).

1 Like