Reference/Tine query model
Tine query model
- Tine reads Logseq's query syntax —
{{query …}}blocks and the common advanced (datalog) queries — but runs them on its own engine, not on a datalog database. This page lists every place where the answer can differ from Logseq's, and why. How to write and display queries is on Features/Queries. - This page describes Tine Beta. Tine 0.6 (stable) gets several of these wrong in ways Beta has fixed; see the last section.
The rule
- A query in Tine finds everything the same query finds in Logseq, and may find more — never less. Someone moving a graph over from Logseq should never lose a result.
- Looking at results never changes your files. Sorting by a column heading, collapsing a query or opening a result changes only what you see; only settings you save on purpose (Display, the query text) are written to the block.
Where Tine behaves exactly like Logseq
- Text is exact. A bare word or quoted text in a query matches the raw block text, property lines included, with case and accents significant:
Alphadoes not findalpha, andcafedoes not findcafé. A query is a deliberate filter, so it matches what you wrote. Ctrl+K, search tabs and in-page Find are for finding things quickly, and ignore case and accents. - References include the outline above a block.
[[x]],#xand(page-ref x)match a block that referencesx, and also its child blocks, because a child sits under that reference.#xand[[x]]mean the same. - Page properties count as properties.
(property type book)also matches the first block of a page whose header saystype:: book, as in Logseq. Use(page-property type book)to ask about pages. - Commas split only list properties.
tags,aliasand keys listed in:property/separated-by-commasare lists; every other value is one piece of text, so(property list "Foo, Bar")findslist:: Foo, Bar. - Results sort newest first unless you write
asc,(sample N)picks before it sorts, and a query of onlysort-by/sampleshows nothing. - Table settings from Logseq are read:
query-table::, a query ending intable,query-properties::andquery-sort-by::/query-sort-desc::. (task)with no markers and(priority)with no levels add no condition. Logseq drops such a filter, so(and (task) [[x]])finds what[[x]]finds, and a query left with no condition shows nothing; Tine does the same. A note on the query says so and offers to rewrite the clause to open tasks, any task, or priorities A, B or C.
Where Tine finds more
- Property values ignore case.
(property status Done)also findsstatus:: done. Logseq requires the exact spelling. - Property names ignore case.
(property Status x)works; Logseq's parser lowercases names anyway, so this rarely shows. - Numbers and dates compare as numbers and dates when a property holds them (or its page declares
tine.type::), socount:: 01equals1. Logseq compares the stored value. - A single word finds every block containing it. Logseq's desktop app runs a search instead and shows its top 30 hits.
(sort-by …)knows built-in fields: priority, page, scheduled and deadline as well as any property. Logseq sorts only by a property of that name.
What Tine does not run
- There is no datalog engine. An advanced query runs only if Tine understands every clause: task markers, priorities, page references, properties, pages, namespaces, page tags, scheduled and deadline, and journal dates. If any clause is outside that, the whole query is refused and the notice names the clauses — half an answer would look complete and be wrong.
- Advanced-query shapes that run: marker and priority triples (literal, variable,
_or omitted value),contains?marker sets and their negation, attribute comparisons, missing scheduled/deadline checks, block-to-journal-page joins, and the built-intask,priority,between,page-ref, property, page and namespace rules. A named page joined through:block/page,:block/refsor:block/path-refsaccepts a literal name or a string input.:block/refsmeans direct references only;:block/path-refsand thepage-refrule also include ancestors and the owning page. TQL'sdirect_ref('project')preserves the direct form. A simple query in an EDN:querymap, such as(and (todo DOING) (priority A)), uses the existing simple-query engine. - Tagged-page name results run for
[?t :block/name ?tag] [?p :block/tags ?t] [?p :block/name ?name]with:find ?nameand a string:inputsbinding. They show pages once each, using Tine's own display. Ordinary strings retain case:"programming"matches a stored page name,"Programming"does not;"[[Programming]]"and:current-pageare lowercased like Logseq. - Entity bindings are not guessed. A property-map pair such as
[?p :block/properties ?props] [(get ?props :class)]asks about that entity's own properties in Logseq, not the properties of each returned block's page. Tine does not translate these pairs, even with a page join: the whole query is refused with a notice. A self-page constraint such as[?b :block/page ?b]is also refused. Supported page conditions must bind the returned block to a distinct page variable explicitly. - Quoted operands use EDN string escapes, as in Logseq:
"\u0041"means"A", and\n,\t, escaped quotes and backslashes are decoded. Invalid escapes refuse the query. Your stored query text keeps its authored spelling. - Print and static exports keep query refusal notices, including the explanation to convert a legacy scheduled/deadline window to a Tine query. An unavailable answer shows a notice too. Only a successfully answered query with no results says there are no matches; a sheet that cannot run falls back to the query's notice.
- Date windows accept numeric
yyyymmddinputs,:today,:yesterday,:tomorrow, signed day/week/month/year offsets, and Logseq's older:7d,:7d-before,:7d-afterspellings. Comparisons preserve strict>/<and inclusive>=/<=. The common(or [?b :block/scheduled ?d] [?b :block/deadline ?d])shape applies both bounds to each alternative's date. The advancedbetweenrule includes both bounds in authored order; reversed bounds return nothing. - Children of matching blocks. As in Logseq, a match directly under another match is shown inside its parent and is not a result of its own. An advanced query that sets
:remove-block-children? falsekeeps every match as its own result, children included, exactly as in Logseq. - The rest refuses whole: arbitrary joins, authored rules, multiple find columns, aggregates, custom pull projections, timestamp inputs, and
:current-block,:parent-blockor:query-page. An unfiltered page-name query also includes Logseq's reference-only page entities and is not translated. One:result-transformruns: Logseq's default NOW query sort,(fn [result] (sort-by (fn [h] (get h :block/priority "Z")) result)), which orders rows by priority with a missing one last. Any other refused:result-transformwith translatable underlying rows suggests their TQL filter; choose Tine's Display settings for sorting or totals. The suggestion does not execute automatically. :viewand:result-transformnever run as code, because they are ClojureScript functions. Tine will not run them; it only recognises the exact priority sort above and performs it itself. Its own Display choices (List, Table, Board, grouping, totals) cover the common uses.- A query that would return more than 20,000 rows or 32 MiB is refused, with a message to narrow it or add
(sample N). Logseq has no such limit; Tine stops instead of freezing.
Where Tine keeps things on your device instead of in the file
- Clicking a table heading sorts for as long as the page is open. Logseq writes
query-sort-by::into the file. - Collapsing a query's results is the block's own fold, written as
collapsed:: truelike Logseq. Only a query that is not on a block of an editable page (a default journal query, a read-only page) remembers its fold on this device instead.
Other differences
- Queries are always live. Logseq stops refreshing a query that takes longer than 50 ms and shows a refresh button; Tine keeps every query current.
:current-pagein a split view is the page in the pane you used last.- Pages and blocks are separate answers. A query finds blocks or pages. To see both from the same conditions, choose Pages and blocks in the query sheet.
- Tine-only features (scheduled and deadline ranges, grouping, totals, typed comparisons, inline-tag and parent, child or descendant conditions, a bare has-a-scheduled-date or has-a-deadline check,
search,content-regex) have no equivalent{{query}}spelling. Saving one turns the block into{{tine-query …}}, says so, and offers Undo that change. For example,{{tine-query @block scheduled between today and '+7d'}}checks a scheduled date; OG Logseq drops the condition in(between scheduled …)or(between deadline …).
Tine 0.6 (stable)
- Tine 0.6 differs from this page where it has known bugs, fixed in Beta: it sorts ascending by default;
(sample N)sorts first; a query of only directives returns everything;(namespace x)matches every depth;(all-page-tags)returns the tagged pages;notwith several operands,(priority [A]),(between created-at …)and page-header properties misbehave; journal groups run oldest first; an advanced query with an unknown clause runs the clauses it understands; query text ignores case and accents; every property value is split on commas; Logseq's table settings are ignored.