Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Search Queries #644

Closed
Tamriel opened this issue Feb 14, 2021 · 3 comments
Closed

Add Search Queries #644

Tamriel opened this issue Feb 14, 2021 · 3 comments

Comments

@Tamriel
Copy link

Tamriel commented Feb 14, 2021

When a block contains the query string {{[[query]]: {and: [[ex-A]] [[ex-B]]}}}, all blocks containing the strings ex-A and ex-B should be embedded below the query block.

The article Searching Roam With Queries describes this in detail.

@tangjeff0
Copy link
Collaborator

Agree something like this is needed, so we should keep this issue, but definitely don't like how Roam queries are implemented.

  1. What is the underlying problem?
  2. What is the solution space. Can the query interface actually map to a graph database?

@jtrakk
Copy link

jtrakk commented Feb 23, 2021

Designing a query language is a very very big job and I don't know how much developer time will be dedicated to query-language design.

There are a lot of graph query languages out there, from very simple to complex. At the simple end is this blog post's proposed "TQL" which looks like (foo|bar) + baz. XPath or Cypher, for example, are much more complex.

It may be worth considering some meta-solutions:

  1. picking an existing query language
  2. designing a query-language plugin system, to allow users to import, develop, and experiment with alternative query languages within Athens

@agentydragon
Copy link
Contributor

agentydragon commented Mar 7, 2021

I'd propose just allowing people to issue Datascript queries against the database, and render the results nicely if they fit some format. For example, "if you issue a query that returns a single variable ?block, then we'll render the blocks; if it's ?page, we'll render page links".

Pros

  • no need to add extra layer above DB
  • allows full power of Datascript
    • (this is particularly an improvement over Roam's {{query}}, which has a very limited vocabulary)

Cons

  • maybe security issues if running on server?
    • might need sanitization? (especially if executed outside client)
  • hard to remove once added; if people can issue arbitrary queries, and the feature is taken away later, people's queries would break
    • so what I'd do would probably be initially add a big warning saying "this can break later", or even hide this behind a feature switch
  • requires users to fiddle with underlying Datascript db instead of higher-level page/block structure
    • (but I expect power users would be okay with that)

@athensresearch athensresearch locked and limited conversation to collaborators Mar 17, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

5 participants