Skip to content

Commit

Permalink
Add docs on db importer and more on new tags
Browse files Browse the repository at this point in the history
  • Loading branch information
logseq-cldwalker committed Aug 12, 2024
1 parent 67d58c0 commit 4b9e589
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions db-version.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Description

This is a brief description of DB graph functionality as of July 12th.
This is a description of DB graph functionality as of Aug 12th.

NOTE: There is currently no automated graph backup for the DB version. Recommend only using this for testing purposes.

## Properties

Expand Down Expand Up @@ -40,21 +42,37 @@ TODO:
- Querying
- idents?

## Classes
## New Tags

To create your first class:
* Press `cmd-k` and then type `#NAME` where NAME is the name of the Class
* A dialog pops up that lets you create and/or add properties to the class.
NOTE: New tags are currently labeled as tags in the app and do not behave like the previous tags. These `new tags` are also known as classes, types or supertags. Feedback is welcome on names for `new tags`.

To create your first new tag:
* Press `cmd-k` and then type `#NAME` where NAME is new tag name.
* A dialog pops up that lets you create and/or add properties to the new tag.

Classes are configurable by navigating to their page e.g. via `cmd-k` or clicking on their `#` name. Then click on the `Configure` link above its name.
For example, say we created a new tag `Person` and added `lastName` and `birthday` properties to it. Now when `#Person` is added to a block or page, those two properties automatically display and are associated to it. A useful thing about new tags is that when its properties change those changes are immediately made to all tagged blocks and pages.

Class fields in the Configure modal:
* Parent class: Use this to allow the class to inherit the parent classes properties. By default the parent class is the `Root class` which doesn't have any properties.
* Class properties: Add or remove existing properties to associate them with a class
### Parent Tags

TODO:
- Root class
- More about inheritance
- Drag n drop
- Tags vs classes
New tags can have a parent tag. By default new tags have the `Root tag` as a parent. Allowing new tags to have or be a parent is useful as it allows tags to organized in a hierachy. This is similar to directories on your computer or the previous namespace feature. A powerful feature of using a parent tag is that the new tag inherits the properties from its parent. For example, if we created a new `#Actor`, made its parent `#Person` from above and gave it an additional `actedIn` property. `#Actor` would display 3 properties when used, with two coming from the parent: `lastName`, `birthday` and `actedIn`.

Check warning on line 57 in db-version.md

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"hierachy" should be "hierarchy".

### Configure a New Tag

New tags are configurable by navigating to their page e.g. via `cmd-k` or clicking on their `#` name. Then click on the `Configure` link above its name.

In the Configure modal:
* Parent tag: Use this to allow the class to inherit the parent classes properties. By default the parent tag is the `Root tag` which doesn't have any properties.
* Properties: Below `Parent tag`, you can add or remove existing properties to associate them with a new tag. These properties can be sorted by dragging one above or below the other. These properties will then display sorted when a new tag is used on a block or page.

## Convert File Graph to DB graph

To convert your file graph to a DB graph:

* Click on the three dots menu in the upper right corner and select `Import`.
* Click on the `File to DB graph` button.
* This brings up a dialog. For larger graphs it takes longer for the dialog to display.
* The dialog requires you to input a name for your graph. On desktop this new graph will be located under `~/logseq/graphs/GRAPH-NAME` so it is ok to give it the same name it currently has.
* The dialog has the following optional inputs:
* `Tags to import ...` - This input converts any of your old tags to the [new tags](#new-tags). This is helpful if you've been using a particular tag like a new tag. You can also convert pages later by right clicking on a page's name.
* `Properties whose values are imported as new tags` - This input converts property values for the specified property to the new tags. For example, in the official docs graph the [type property](https://docs.logseq.com/#/page/type) is used this way. This means that all `type` property values like [Feature](https://docs.logseq.com/#/page/feature) on [this page](https://docs.logseq.com/#/page/code%20block) would get converted to the new tag.
* `Properties whose values are imported as parents of ...` - This input converts property values for the specified property to be [a parent of a new tag](#parent-tags). For example, in the official docs graph the [parent property](https://docs.logseq.com/#/page/parent) is used this way. This means that all `parent` property values like [Thing](https://docs.logseq.com/#/page/thing) on [this page](https://docs.logseq.com/#/page/feature) would get converted to the new tag.

0 comments on commit 4b9e589

Please sign in to comment.