Lesson 1: What Are Logseq Queries and Why You Should Learn to Use Them

Q. What is a query?
A. command sentences using to request for extraction of information with purpose

Q. What are query languages, and can you name examples of query languages?
A. computer language which excute command for request imformation to DB. I don’t know if I can call it a “language”, but SQL.

Q. What are some query languages you’ve worked with in the past?
A. simple php for request data to MySQL

Q. Why do you want to learn how to write Logseq queries?
A. I would like to systematically retrieve data that I have written in logseq.

actually, I don’t know the data structure of logseq, so I’m perplexed how to write query.

for example, I don’t know the difference between the three types of search strings.

  1. “green” : enclosed in double quotation marks
  2. green : with #.
  3. [[green]] : enclosed in [[]].
    What is the difference when searching?

and another, about the date used in query, is the date of the journal or the page was created? Where can I find the timestamp of the block? Can we see the ID and properties of the block?

as such, there’s many things I want to know. I’m looking forward resolving these questions so that I could extract systematic data from my journal.

A query is a request for information from an information system.
A query language is a computer language for formulating queries.
I have worked primarily with SQL.
I want to be able to use queries to discover relationships in the data so that new ideas can emerge.

* What is a query?
  • A query helps me express my search terms in a way that the database is understanding.

    * What are query languages, and can you name examples of query languages?
    
  • Query languages, such as Datalog, are a unified set of commands that enable database-independent search.

    * What are some query languages you’ve worked with in the past?
    
  • I haven’t worked with any Query language before

    * Why do *__you__* want to learn how to write Logseq queries?
    
    • I want to apply Queries to the following:
      • Building a review system for my weekly Reviews
      • Something similar to the “on this day” feature in DayOne, which displays all entries from this day made in former years.
      • I would like to make goal planning possible in Logseq. As I am using Things for execution tasks, I want to use the task management system.
      • Finally, I want to build several small queries that I can insert via Keyboard shortcut (Keyboard Maestro) to aid me with little snippets of oversight, either in the right sidebar or as a removable object in current projects.

What is a query?

Suppose you need to find a particular piece of information from a complicated database with lots of data. A query is essentially a question you ask the database to try to narrow down or pinpoint that piece of information that you want.

What are query languages, and can you name examples of query languages?

A query language is any programming language that makes use of queries (asking questions about the database and returning the relevant pieces of information) to retrieve data from a database. Perhaps the most well-known is SQL where QL stands for ‘query language’.

What are some query languages you’ve worked with in the past?

A tiny bit of SQL, Google search if you count that, and you can use queries in data analytics programs such as R.

Why do you want to learn how to write Logseq queries?

I want to learn how I should structure my notes in an outliner so that they are easily searchable and I can later start incorporating more powerful tools. Ultimately, I want to create a tool that is useful both for writing down my thoughts in a diary-like fashion, and perhaps more importantly, that I can use in academia to help me to learn new concepts and improve my research.

2 Likes

Thanks a lot for organizing this learning sprint. I have started using Logseq a couple of months ago and I came to the point that I find it difficult to retrieve information in a fast and frictionless way.

  • What is a query?
    Query is a form of requesting information from a database.

  • What are query languages, and can you name examples of query languages?
    Query languages allow us to communicate our requests to our database in a very specific and precise way. Search engines typically use simple Boolean operations to enable filtering of the results so that they match more closely our request.

  • What are some query languages you’ve worked with in the past?
    My experience is limited to search engines.

  • Why do you want to learn how to write Logseq queries?
    After using Logseq for a few months, I came to a point where I find difficult to retrieve my data in a frictionless way. Despite having improved my productivity, I feel that I am not stuck and learning strategies on how to structure my database and retrieve information will take my productivity to another level. I find it amazing that Logseq provides such a powerful community and support to users in a way that everyone helps each other and share ideas in a very open way. Thanks a lot, @Ramses for guiding us through this important processes of structuring and retrieving data.

4 Likes
What is a query?

A description of a search to be performed for specific data.

What are query languages, and can you name examples of query languages?

Querly languages are the formal schemas (/ languages) for expressing queries. Which is a bit circular… so to expand, a formal language is one that can be parsed reliably by a computer to express a semantics intended by an author (and query is defined above).

What are some query languages you’ve worked with in the past?

SQL (esp. postgres-flavored), Mongo, GrahQL (maybe not really a QL), datalog

Why do you want to learn how to write Logseq queries?

See Working on a general approach to share a CV / Resume in Logseq. I’m generally interested in publishing subgraphs of my notes that include linear (journal) as well as aggregated (queried) information.

This lesson was extremely helpful! Absolutely cannot wait to learn more!

Thanks, @Ramses for providing this resource!

  • What is a query?
    A query is a request for information.

  • What are query languages, and can you name examples of query languages?
    A query language is a means of requesting information from a database. An example is SQL.

  • What are some query languages you’ve worked with in the past?
    I haven’t really worked with any query languages.

  • Why do you want to learn how to write Logseq queries?
    I use Logseq as a kind of technical users manual. I’m a consultant in Healthcare IT and I want to be able to reference past issues & their resolutions when I’m troubleshooting for a client. I’d like to use queries to become better at searching for and organizing information.

I was also inspired by @mat_rhein’s ideas:

Ditto to all of these! :grinning:

2 Likes
  • What is a query?
    • A structured statement intended to instruct a machine lookup
  • What are query languages, and can you name examples of query languages?
    • The particular structure a database expects. For example SQL.
  • What are some query languages you’ve worked with in the past?
    • SQL and MongoDB query language
  • Why do you want to learn how to write Logseq queries?
    • To facilitate workflows where I need to have a specific list of items on a page
  • What is a query?
    • A query is simply a search for some data by means of a filtered search. Keywords and operators enhance the scope and focus of the search, and serve as the filter’s “instructions”.
  • What are query languages, and can you name examples of query languages?
    • Query languages are a set of defined rules, or syntax, by which a user can input a query to retrieve the desired data. SQL, NoSQL, GraphQL are some popular services used to query databases. Workflows like Obsidian and Notion have their own query systems as well.
  • What are some query languages you’ve worked with in the past?
    • I’ve worked with SQL and GraphQL, as well as the searches in Notion, Obsidian, and some other services.
  • Why do you want to learn how to write Logseq queries?
    • I hope to actively curate my projects and data, as well as maintain control over my notes and data. With a well-polished system (even something simple as a #re-iterate tag), I can keep track of notes to be further developed for my study or application.
      I’m currently unfamiliar with the Logseq query syntax; this is an opportunity to see how the query works, as well as understand (and be aware of) all the properties the Logseq search uses, and thereby utilize them.
  • What is a query?
    • A query is a question with the expectation of getting an answer.
  • What are query languages, and can you name examples of query languages?
    • They are computer languages to make queries in a database or information system. I came across that definition from Wikipedia and couldn’t agree more with it
  • What are some query languages you’ve worked with in the past?
    • SQL
    • Datalog
  • Why do you want to learn how to write Logseq queries?
    • Because I want to better structure my notes in order to resurface the information when I need it. I dislike when I know I have saved a piece of knowledge but I am unable to find it again.
    • Because I want a better tool than the Logseq search bar and I am not efficient enough with advanced queries. I believe I may be underutilizing the simple queries
    • Because I love Logseq and the more I use it, the more amazing it becomes :slight_smile:
1 Like

What is a Query

  • It’s an interrogation technique to gather information from my database
    What are query languages
  • SQL is one ot them and all databases have their query langages
    What are queries langages you work with before
  • none
    Why do you want to learn how to write Logseq queries
  • I invested a huge amount of time in. building my database. I evolved with it. I’ve gone from Roam to Logseq. I was learning as my database grew more and more. Mastering queries is a must for me, to benefit from all the work I did.

Thanks @Ramses!

  • What is a query?
    A way of phrasing a request for specific info
  • What are query languages, and can you name examples of query languages?
    No real idea… only what people above have written :grinning:
  • What are query languages, and can you name examples of query languages?
    None!
  • Why do you want to learn how to write Logseq queries?
    If logseq is my second brain maybe learning how it works and how to use it will allow me to use my first brain better too!
1 Like

What is a query?
It’s a tool to request specific information and to filter them the way you need them.

What are query languages, and can you name examples of query languages?
The article mentioned the way you can use google requests in a more proper way like the OR command or citations

What are some query languages you’ve worked with in the past?
MySql

Why do you want to learn how to write Logseq queries?
To navigate my second brain, because right now, it is a little bit messy, just like my first brain,

What are queries?

  • A structured way to ask for something to receive the response you expect

What is a query language and can you name examples of query languages?

  • A specific, pre-agreed way of phrasing a request.
  • I am aware of SQL and also think SPARQL is a thing that’s pretty much it. I have not worked with any formal query languages

Why do you want to learn how to write Logseq queries?

  • I want to be able to reuse past notes more effectively so that they can create new information about my work.
-   What is a query? A query is a question for the database in the computer. 
  • What are query languages, and can you name examples of query languages?
    • query languages are commands to tell the computer the parameters to search and display data. Some query languages that I remember as SQL and Python.
  • What are some query languages you’ve worked with in the past?
    • I do not have any experience working with query languages, and I am a rookie in this field.
  • Why do you want to learn how to write Logseq queries?
    • I love LogSeq, and I think I can take advantage of its utilities using this tool. Besides, I need to understand queries to organize my knowledge system.
  • What is a query?
    • A query is a “request for information” from an interactive system, which in this case is assumed to be digital. but it doesn’t have to be.
  • What are query languages, and can you name examples of query languages?
    • Query languages are syntaxes we communicate to a computer or system to request information
  • What are some query languages you’ve worked with in the past?
    • sql, google, xpath
  • Why do you want to learn how to write Logseq queries?
    • because being more fluent in the tools i use helps me use them more as tools and less as hobbies. If I can think, when using logseq, in terms of queries, fluently, then i can make more sense of the data i’m putting in to this system, whether that is contextual to-dos, reusable family chore lists, OKR planning, or other things i haven’t even thought of yet. I’m a kinetic/interactive learner and need objective-based learning, so this is a good reason to dive in.

I have never used logseq query before but I think this should be
{{query (and [[How to Take Smart Notes]] (or [[highlights]] [[notes]])) }}
if you want to search for
highlights or notes from How to Take Smart Notes

  • What is a query? queries are requests for information; presumably from a source of information; souces can be people (librarians, writers, authors, neighbors etc…) or computing devices (operating system, database, phone, search box etc…)
  • What are query languages, and can you name examples of query languages? SQL, search boxes with some sort of advanced syntax, NoSQL languages
  • What are some query languages you’ve worked with in the past? mostly SQL, GraphQL, Neo4j, MongoDB, Postgres, Cassandra
  • Why do you want to learn how to write Logseq queries? knowing how to get information out of a system lets you know how to store information better so that you can retrieve it more easily in the future than if you had not learned anything about how the system works.

You are absolutely right, again pointing out my sloppiness. Thank you :pray: I’ve edited the lesson.