diff --git a/src/components/DiscourseContext.tsx b/src/components/DiscourseContext.tsx index e4bb749..b7b7753 100644 --- a/src/components/DiscourseContext.tsx +++ b/src/components/DiscourseContext.tsx @@ -7,6 +7,7 @@ import { Tab, Tooltip, Checkbox, + Spinner, } from "@blueprintjs/core"; import React, { useCallback, @@ -313,17 +314,38 @@ const ContextTab = ({ }; export const ContextContent = ({ uid, results, args }: Props) => { - const [rawQueryResults, setRawQueryResults] = useState(results || []); + const [rawQueryResults, setRawQueryResults] = useState< + Record + >({}); const queryResults = useMemo( - () => rawQueryResults.filter((r) => !!Object.keys(r.results).length), + () => + Object.values(rawQueryResults).filter( + (r) => !!Object.keys(r.results).length + ), [rawQueryResults] ); const [loading, setLoading] = useState(true); + const onRefresh = useCallback(() => { - getDiscourseContextResults({ uid, args }) - .then(setRawQueryResults) - .finally(() => setLoading(false)); - }, [uid, results, setRawQueryResults, setLoading]); + setRawQueryResults({}); + getDiscourseContextResults({ + uid, + args, + onProgress: (result) => { + setRawQueryResults((prev) => ({ + ...prev, + [result.label]: { + label: result.label, + results: { + ...(prev[result.label]?.results || {}), + ...result.results, + }, + }, + })); + }, + }).finally(() => setLoading(false)); + }, [uid, setRawQueryResults, setLoading]); + useEffect(() => { if (!results) { onRefresh(); @@ -365,9 +387,14 @@ export const ContextContent = ({ uid, results, args }: Props) => { } /> ))} + {loading && ( +
+ +
+ )} - ) : loading ? ( + ) : loading && !results ? ( {}} vertical> { const [results, setResults] = useState([]); const containerRef = useRef(null); const onRefresh = useCallback( - (loadInBackground = false) => { + async (loadInBackground = false) => { setError(""); setLoading(!loadInBackground); const args = parseQuery(pageUid); - setTimeout(() => { - fireQuery(args) - .then((results) => { - setColumns(args.columns); - setResults(results); - }) - .catch(() => { - setError( - `Query failed to run. Try running a new query from the editor.` - ); - }) - .finally(() => { - const tree = getBasicTreeByParentUid(pageUid); - const node = getSubTree({ tree, key: "results" }); - return ( - node.uid - ? Promise.resolve(node.uid) - : createBlock({ - parentUid: pageUid, - node: { text: "results" }, - }) - ).then(() => { - setLoading(false); - }); - }); - }, 1); + + try { + const results = await fireQuery(args); + setColumns(args.columns); + setResults(results); + } catch (err) { + setError( + `Query failed to run. Try running a new query from the editor.` + ); + } finally { + const tree = getBasicTreeByParentUid(pageUid); + const node = getSubTree({ tree, key: "results" }); + const uid = + node.uid || + (await createBlock({ + parentUid: pageUid, + node: { text: "results" }, + })); + setLoading(false); + return uid; + } }, [setResults, pageUid, setLoading, setColumns] ); diff --git a/src/components/QueryTester.tsx b/src/components/QueryTester.tsx new file mode 100644 index 0000000..296b9da --- /dev/null +++ b/src/components/QueryTester.tsx @@ -0,0 +1,498 @@ +import { + Button, + Classes, + Dialog, + Intent, + RadioGroup, + Radio, + FormGroup, + NumericInput, +} from "@blueprintjs/core"; +import React, { + useState, + useEffect, + useMemo, + useCallback, + useRef, +} from "react"; +import getCurrentPageUid from "roamjs-components/dom/getCurrentPageUid"; +import getBasicTreeByParentUid from "roamjs-components/queries/getBasicTreeByParentUid"; +import renderOverlay from "roamjs-components/util/renderOverlay"; +import createBlock from "roamjs-components/writes/createBlock"; + +type QueryTesterProps = { + onClose: () => void; + isOpen: boolean; +}; + +type QueryType = { + label: string; + description: string; + fn: () => Promise; +}; + +const getTimestamp = () => { + const timestamp = new Date(); + const minutes = String(timestamp.getMinutes()).padStart(2, "0"); + const seconds = String(timestamp.getSeconds()).padStart(2, "0"); + const milliseconds = String(timestamp.getMilliseconds()).padStart(3, "0"); + return `${minutes}:${seconds}:${milliseconds}`; +}; +export const logTimestamp = (emoji: string, label: string) => { + console.log(emoji, getTimestamp(), label); +}; +const getRandomTimestamp = () => { + const now = Date.now(); + const thirteenMonthsAgo = now - 13 * 30 * 24 * 60 * 60 * 1000; + const fifteenMonthsAgo = now - 15 * 30 * 24 * 60 * 60 * 1000; + + return Math.floor( + Math.random() * (thirteenMonthsAgo - fifteenMonthsAgo) + fifteenMonthsAgo + ); +}; +const fakeBackendQuery = (id: number, delayTime: number) => { + return new Promise((resolve) => { + setTimeout(() => { + resolve([id]); + }, delayTime); + }); +}; +const fakeGetDatalogQuery = (buildTime: number) => { + console.log(`💽💽`, getTimestamp(), `Build`); + const startTime = Date.now(); + while (Date.now() - startTime < buildTime) { + // Simulate work by blocking the thread + } +}; +const PREDEFINED_TYPES = ["EVD", "CLM", "RES", "HYP", "ISS", "CON"]; + +const getQueryType = (index: number) => { + // For first 6, use predefined types in order + if (index < PREDEFINED_TYPES.length) { + return PREDEFINED_TYPES[index]; + } + // For additional ones, randomly select from predefined types + return PREDEFINED_TYPES[Math.floor(Math.random() * PREDEFINED_TYPES.length)]; +}; +const baseQuery = `[:find + (pull ?node [:block/string :node/title :block/uid]) + (pull ?node [:block/uid]) + :where + [(re-pattern "^\\\\[\\\\[TYPE\\\\]\\\\] - (.*?)$") ?QUE-.*?$-regex] + [?node :node/title ?Question-Title] + [?node :block/children ?Summary] + [?node :block/children ?Workbench] + [?Workbench :block/children ?Notes] + [?Notes :block/children ?childNotes] + [?node :create/time ?node-CreateTime] + [(< ${getRandomTimestamp()} ?node-CreateTime)] + (or [?Summary :block/string ?Summary-String] + [?Summary :node/title ?Summary-String]) + (not + [?Summary :block/children ?childSummary] + ) + (or [?Notes :block/string ?Notes-String] + [?Notes :node/title ?Notes-String]) + [(re-find ?QUE-.*?$-regex ?Question-Title)] + [(clojure.string/includes? ?Summary-String "Summary")] + [(clojure.string/includes? ?Notes-String "Notes")] + ]`; + +const CellEmbed = ({ + selectedQuery, + queryBlockUid, +}: { + selectedQuery: number; + queryBlockUid: string; +}) => { + const contentRef = useRef(null); + + const tree = useMemo( + () => getBasicTreeByParentUid(queryBlockUid), + [queryBlockUid] + ); + useEffect(() => { + const container = contentRef.current; + const uid = tree[selectedQuery].uid; + + if (container && uid) { + const existingBlock = container.querySelector(".roam-block-container"); + if (existingBlock) { + existingBlock.remove(); + } + + const blockEl = document.createElement("div"); + blockEl.className = "roam-block-container"; + container.appendChild(blockEl); + + window.roamAlphaAPI.ui.components.renderBlock({ + uid, + el: blockEl, + }); + } + + return () => { + if (container) { + const existingBlock = container.querySelector(".roam-block-container"); + if (existingBlock) { + existingBlock.remove(); + } + } + }; + }, [tree, selectedQuery, queryBlockUid]); + + return ( +
+
+
+ ); +}; + +const QueryTester = ({ onClose, isOpen }: QueryTesterProps) => { + const [selectedQuery, setSelectedQuery] = useState(0); + const [isRunning, setIsRunning] = useState(false); + const [buildTime, setBuildTime] = useState(1000); + const [delayTime, setDelayTime] = useState(3000); + const [queryBlockUid, setQueryBlockUid] = useState(null); + const [numberOfQueries, setNumberOfQueries] = useState(6); + + const queryTypes = useMemo(() => { + return Array.from({ length: numberOfQueries }, (_, i) => getQueryType(i)); + }, [numberOfQueries]); + + // lol couldn't get highlighting to work properly, so creating the blocks and rending them + useEffect(() => { + const removeConsoleLogLines = (input: string) => { + return input + .split("\n") // Split the input string into lines + .filter((line) => !line.trim().startsWith("console.log(")) // Filter out lines with `console.log` + .join("\n"); // Join the remaining lines back into a string + }; + + const createQueryBlock = async () => { + const currentPageUid = getCurrentPageUid(); + const newUid = await createBlock({ + node: { + open: false, + text: "", + children: [ + ...queries.map((query, i) => ({ + text: `\`\`\`const ${query.label.replace(/\s+/g, "")} = ${removeConsoleLogLines(query.fn.toString())} \`\`\``, + })), + ], + }, + parentUid: currentPageUid, + }); + setQueryBlockUid(newUid); + return () => { + window.roamAlphaAPI.deleteBlock({ + block: { uid: newUid }, + }); + }; + }; + createQueryBlock(); + }, []); + + const asyncQ = useCallback(async () => { + console.log("async.q: Promise.all(map(async) => await fireQuery)"); + console.log("with artificial query delay and query build time"); + console.log(`buildTime: ${buildTime}`); + console.log(`delayTime: ${delayTime}`); + + const fireQueryX = async (type: string, i: number) => { + if (buildTime) fakeGetDatalogQuery(buildTime); + console.log(`🔎🟢`, getTimestamp(), `Query`, type, i); + await new Promise((resolve) => setTimeout(resolve, delayTime)); + await window.roamAlphaAPI.data.async.q(baseQuery.replace("TYPE", type)); + console.log(`🔎🛑`, getTimestamp(), `Query`, type, i); + }; + + await Promise.all(queryTypes.map((type, i) => fireQueryX(type, i))); + + // Results + // + // I would like the query to be sent right after the build time is over + // I'm not sure if that is possible, and that doesn't seem to be the case with these results + // + // The delay is 3 seconds + // + // these results don't make sense + // last query starts at 34:322 + // RES - starts at 31:322, ends at 35:624 + // 1.5 seconds after last query start (The delay is 3 seconds) + // + // 36:535 Query HYP 3 - 1 second after previous query? + // 37:533 Query ISS 4 - 1 second after previous query? + // 38:540 Query CON 5 - 1 second after previous query? + // + // 🔎🟢 55:29:322 Query EVD 0 + // 🔎🟢 55:30:322 Query CLM 1 + // 🔎🟢 55:31:322 Query RES 2 + // 🔎🟢 55:32:322 Query HYP 3 + // 🔎🟢 55:33:322 Query ISS 4 + // 🔎🟢 55:34:322 Query CON 5 + // 🔎🛑 55:35:624 Query RES 2 + // 🔎🛑 55:35:683 Query CLM 1 + // 🔎🛑 55:35:689 Query EVD 0 + // 🔎🛑 55:36:535 Query HYP 3 (this delay doesn't make sense) + // 🔎🛑 55:37:533 Query ISS 4 (this delay doesn't make sense) + // 🔎🛑 55:38:540 Query CON 5 (this delay doesn't make sense) + }, [delayTime, buildTime, queryTypes]); + const fakeBackend = useCallback(async () => { + console.log("async.q: fakeBackendQuery() with artificial query build time"); + console.log(`buildTime: ${buildTime}`); + console.log(`fakeQueryTime: ${delayTime}`); + + const fireQueryX = async (type: string, i: number) => { + if (buildTime) fakeGetDatalogQuery(buildTime); + console.log(`🔎🟢`, getTimestamp(), `Query`, type, i); + await new Promise((resolve) => setTimeout(resolve, delayTime)); + await fakeBackendQuery(i, delayTime); + console.log(`🔎🛑`, getTimestamp(), `Query`, type, i); + }; + + await Promise.all(queryTypes.map((type, i) => fireQueryX(type, i))); + + // Results + // + // Run 1 + // these results don't make sense + // last query starts at 34:322 + // RES - starts at 31:322, ends at 35:624 + // 1 seconds after last query start (The delay is 3 seconds) + // + // 59:752 Query HYP 3 - 1 second after previous query? + // 00:751 Query ISS 4 - 1 second after previous query? + // 01:754 Query CON 5 - 1 second after previous query? + // + // 🔎🟢 23:52:750 Query EVD 0 + // 🔎🟢 23:53:750 Query CLM 1 + // 🔎🟢 23:54:750 Query RES 2 + // 🔎🟢 23:55:750 Query HYP 3 + // 🔎🟢 23:56:750 Query ISS 4 + // 🔎🟢 23:57:750 Query CON 5 + // 🔎🛑 23:58:757 Query EVD 0 + // 🔎🛑 23:58:758 Query CLM 1 + // 🔎🛑 23:58:758 Query RES 2 + // 🔎🛑 23:59:752 Query HYP 3 + // 🔎🛑 24:00:751 Query ISS 4 + // 🔎🛑 24:01:754 Query CON 5 + + // Run 2 + // 10 second build time + // 3 second delay time + // + // no delay between last query start and first query return + // no delay between query1 - query5 + // 3 seconds between last query and second last query + // + // fakeBackendQuery() with artificial query build time + // buildTime: 10000 + // fakeQueryTime: 3000 + // 💽💽 02:05:873 Build EVD 0 + // 🔎🟢 02:15:873 Query EVD 0 + // 💽💽 02:15:873 Build CLM 1 + // 🔎🟢 02:25:873 Query CLM 1 + // 💽💽 02:25:873 Build RES 2 + // 🔎🟢 02:35:873 Query RES 2 + // 💽💽 02:35:873 Build HYP 3 + // 🔎🟢 02:45:873 Query HYP 3 + // 💽💽 02:45:873 Build ISS 4 + // 🔎🟢 02:55:873 Query ISS 4 + // 💽💽 02:55:873 Build CON 5 + // 🔎🟢 03:05:873 Query CON 5 + // 🔎🛑 03:05:886 Query EVD 0 + // 🔎🛑 03:05:887 Query CLM 1 + // 🔎🛑 03:05:887 Query RES 2 + // 🔎🛑 03:05:887 Query HYP 3 + // 🔎🛑 03:05:888 Query ISS 4 + // 🔎🛑 03:08:881 Query CON 5 + + // Run 3 + // 10 second build time + // 10 second delay time + // + // no delay between last query start and first query return + // no delay between query1 - query5 + // 10 seconds between last query and second last query + // + // fakeBackendQuery() with artificial query build time + // buildTime: 10000 + // fakeQueryTime: 10000 + // 💽💽 05:16:136 Build EVD 0 + // 🔎🟢 05:26:137 Query EVD 0 + // 💽💽 05:26:137 Build CLM 1 + // 🔎🟢 05:36:137 Query CLM 1 + // 💽💽 05:36:137 Build RES 2 + // 🔎🟢 05:46:137 Query RES 2 + // 💽💽 05:46:137 Build HYP 3 + // 🔎🟢 05:56:137 Query HYP 3 + // 💽💽 05:56:137 Build ISS 4 + // 🔎🟢 06:06:137 Query ISS 4 + // 💽💽 06:06:137 Build CON 5 + // 🔎🟢 06:16:137 Query CON 5 + // 🔎🛑 06:16:176 Query EVD 0 + // 🔎🛑 06:16:176 Query CLM 1 + // 🔎🛑 06:16:176 Query RES 2 + // 🔎🛑 06:16:177 Query HYP 3 + // 🔎🛑 06:16:177 Query ISS 4 + // 🔎🛑 06:26:145 Query CON 5 + }, [delayTime, buildTime, queryTypes]); + const fastQ = useCallback(async () => { + console.log("fast.q: with artificial query delay and query build time"); + console.log(`buildTime: ${buildTime}`); + console.log(`delayTime: ${delayTime}`); + + const fireQueryX = async (type: string, i: number) => { + if (buildTime) fakeGetDatalogQuery(buildTime); + console.log(`🔎🟢`, getTimestamp(), `Query`, type, i); + + const startTime = Date.now(); + while (Date.now() - startTime < delayTime) {} + + await window.roamAlphaAPI.data.fast.q(baseQuery.replace("TYPE", type)); + console.log(`🔎🛑`, getTimestamp(), `Query`, type, i); + }; + + await Promise.all(queryTypes.map((type, i) => fireQueryX(type, i))); + }, [delayTime, buildTime, queryTypes]); + const queries: QueryType[] = useMemo( + () => [ + { + label: "async q", + description: "async.q: Promise.all(map(async) => await fireQuery)", + fn: asyncQ, + }, + { + label: "fakeBackendQuery", + description: "fakeBackendQuery()", + fn: fakeBackend, + }, + { + label: "fast q", + description: "window.roamAlphaAPI.data.fast.q", + fn: fastQ, + }, + ], + [delayTime, buildTime, numberOfQueries] + ); + + return ( + { + onClose(); + if (queryBlockUid) { + window.roamAlphaAPI.deleteBlock({ + block: { uid: queryBlockUid }, + }); + } + }} + autoFocus={false} + enforceFocus={false} + canEscapeKeyClose={true} + className="w-full h-full bg-white" + > + +
+
+
+ + + setBuildTime(Number(e))} + disabled={isRunning} + /> + + + setDelayTime(Number(e))} + disabled={isRunning} + /> + + + setNumberOfQueries(Number(e))} + disabled={isRunning} + /> + +
+ + setSelectedQuery(Number(e.currentTarget.value))} + // className="flex flex-col gap-3" + > + {queries.map((query, i) => ( + +
+
{query.label}
+
+ {query.description} +
+
+
+ ))} +
+ +
+ +
+ + {queryBlockUid && ( + <> + + + )} +
+
+
+ ); +}; + +export const renderQueryTester = (props: QueryTesterProps) => + renderOverlay({ Overlay: QueryTester, props }); + +export default QueryTester; diff --git a/src/index.ts b/src/index.ts index ef178ec..041921e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,7 +48,11 @@ import { render as renderToast } from "roamjs-components/components/Toast"; import getCurrentPageUid from "roamjs-components/dom/getCurrentPageUid"; import { openCanvasDrawer } from "./components/tldraw/CanvasDrawer"; import isDiscourseNode from "./utils/isDiscourseNode"; -import { fireQuerySync } from "./utils/fireQuery"; +import fireQuery, { + FireQueryArgs, + fireQuerySync, + getDatalogQuery, +} from "./utils/fireQuery"; import parseQuery from "./utils/parseQuery"; import { render as exportRender } from "./components/Export"; import getPageTitleByPageUid from "roamjs-components/queries/getPageTitleByPageUid"; @@ -56,6 +60,9 @@ import { NodeMenuTriggerComponent, render as renderDiscourseNodeMenu, } from "./components/DiscourseNodeMenu"; +import { logTimestamp, renderQueryTester } from "./components/QueryTester"; +import { queries } from "./utils/queryData"; +import nanoid from "nanoid"; const loadedElsewhere = document.currentScript ? document.currentScript.getAttribute("data-source") === "discourse-graph" : false; @@ -417,9 +424,8 @@ svg.rs-svg-container { ); }, 1000); } - const toggleDiscourseGraphsMode = await initializeDiscourseGraphsMode( - onloadArgs - ); + const toggleDiscourseGraphsMode = + await initializeDiscourseGraphsMode(onloadArgs); if (getNodeEnv() === "development" && localStorageGet(SETTING)) { extensionAPI.settings.set(SETTING, true); toggleDiscourseGraphsMode(true); @@ -559,10 +565,10 @@ svg.rs-svg-container { typeof v === "string" ? v : typeof v === "number" - ? v.toString() - : v instanceof Date - ? window.roamAlphaAPI.util.dateToPageTitle(v) - : "", + ? v.toString() + : v instanceof Date + ? window.roamAlphaAPI.util.dateToPageTitle(v) + : "", ]) ) ) @@ -625,6 +631,820 @@ svg.rs-svg-container { label: "Open Canvas Drawer", callback: openCanvasDrawer, }); + extensionAPI.ui.commandPalette.addCommand({ + label: "getDatalogQuery", + callback: () => { + const _args: FireQueryArgs = { + customNode: "", + definedSelections: [], + isCustomEnabled: false, + returnNode: "Evidence", + conditions: [ + { + source: "Evidence", + relation: "Consistent With", + target: "2yEG0_6MI", + uid: "UyEG8O76I", + type: "clause", + }, + ], + selections: [ + { + uid: "yshtDCXmF", + label: "context", + text: "node:UyEG8O76I-Context", + }, + ], + isSamePageEnabled: false, + context: { + relationsInQuery: [ + { + id: "fpwvws-ic", + text: "Consistent With", + target: "85wgkuO31", + isComplement: true, + }, + ], + customNodes: [ + { + format: "[[EXP]] - {content}", + text: "Experiment", + shortcut: "X", + type: "DoIcrR_MO", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[RES]] - {content} - {Experiment}", + text: "Result", + shortcut: "R", + type: "q3B9CaO6Q", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[THE]] - {content}", + text: "Theory", + shortcut: "T", + type: "84l8tEeA2", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[ISS]] - {content}", + text: "Issue", + shortcut: "I", + type: "8tpfgIm5Z", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[ART]] - {content}", + text: "Artifact", + shortcut: "A", + type: "S276jHf0s", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[CLM]] - {content}", + text: "Claim", + shortcut: "C", + type: "sys03tzKR", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: true, + }, + { + format: "[[R-N]] - {content}", + text: "R-Note", + shortcut: "R", + type: "PYci7eFJP", + specification: [ + { + uid: "PpR0iQyUo", + source: "R-Note", + target: "R-Note", + relation: "references title", + type: "clause", + not: false, + }, + ], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[MTD]] - {content}", + text: "Method", + shortcut: "M", + type: "HdsmkNfKE", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "@{content}", + text: "Source", + shortcut: "S", + type: "OZhxQs38_", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[PTN]] - {content}", + text: "Pattern", + shortcut: "P", + type: "ceW_PoMVt", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[B]] - {content}", + text: "B", + shortcut: "B", + type: "YjF0S0tKS", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[A]] - {content}", + text: "A", + shortcut: "A", + type: "B676vtaon", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[EVD]] - {content} - {Source}", + text: "Evidence", + shortcut: "E", + type: "85wgkuO31", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + format: "[[QUE]] - {content}", + text: "Question", + shortcut: "Q", + type: "CK3kwflMN", + specification: [], + backedBy: "user", + canvasSettings: {}, + graphOverview: false, + }, + { + text: "Page", + type: "page-node", + shortcut: "p", + format: "{content}", + specification: [ + { + type: "clause", + source: "Page", + relation: "has title", + target: "/^(.*)$/", + uid: "aln15HgZG", + }, + ], + canvasSettings: { + color: "#000000", + }, + backedBy: "default", + }, + { + text: "Block", + type: "blck-node", + shortcut: "b", + format: "{content}", + specification: [ + { + type: "clause", + source: "Block", + relation: "is in page", + target: "_", + uid: "U0dpStPzk", + }, + ], + canvasSettings: { + color: "#505050", + }, + backedBy: "default", + }, + ], + customRelations: [ + { + id: "DXvDSKe94", + label: "Informs", + source: "85wgkuO31", + destination: "CK3kwflMN", + complement: "Informed By", + query: + '[:find\r\n (pull ?Question [:block/string :node/title :block/uid])\r\n (pull ?Question [:block/uid])\r\n:where\r\n (or-join [?9zmVOCQFE-QUE-.*?$-regex ?9zmVOCQFE-Question-uid ?Question ?9zmVOCQFE-{{placeholder}}-uid ?{{placeholder}}]\r\n (and\r\n [?9zmVOCQFE-Page :block/uid "{{placeholder}}"]\r\n [?9zmVOCQFE-Page :block/uid ?9zmVOCQFE-{{placeholder}}-uid]\r\n [?{{placeholder}} :block/uid ?9zmVOCQFE-{{placeholder}}-uid]\r\n [?9zmVOCQFE-Block :block/refs ?9zmVOCQFE-Page]\r\n [?9zmVOCQFE-Block :block/page ?9zmVOCQFE-ParentPage]\r\n [?9zmVOCQFE-ParentPage :node/title ?9zmVOCQFE-ParentPage-Title]\r\n [?9zmVOCQFE-ParentPage :block/uid ?9zmVOCQFE-Question-uid]\r\n [?Question :block/uid ?9zmVOCQFE-Question-uid]\r\n [(re-pattern "^\\\\[\\\\[QUE\\\\]\\\\] - (.*?)$") ?9zmVOCQFE-QUE-.*?$-regex]\r\n [(re-find ?9zmVOCQFE-QUE-.*?$-regex ?9zmVOCQFE-ParentPage-Title)]\r\n )\r\n (and\r\n [?9zmVOCQFE-SrcPage :block/uid "{{placeholder}}"]\r\n [?9zmVOCQFE-LinkPage :node/title "Informs"]\r\n [?9zmVOCQFE-SrcPage :block/uid ?9zmVOCQFE-{{placeholder}}-uid]\r\n [?{{placeholder}} :block/uid ?9zmVOCQFE-{{placeholder}}-uid]\r\n [?9zmVOCQFE-SrcBlock :block/refs ?9zmVOCQFE-SrcPage]\r\n [?9zmVOCQFE-SrcBlock :block/refs ?9zmVOCQFE-LinkPage]\r\n [?9zmVOCQFE-SrcBlock :block/parents ?9zmVOCQFE-DstBlock]\r\n [?9zmVOCQFE-DstBlock :block/refs ?9zmVOCQFE-DstPage]\r\n [?9zmVOCQFE-DstPage :node/title ?9zmVOCQFE-DstPage-Title]\r\n [?9zmVOCQFE-DstPage :block/uid ?9zmVOCQFE-Question-uid]\r\n [?Question :block/uid ?9zmVOCQFE-Question-uid]\r\n [(re-pattern "^\\\\[\\\\[QUE\\\\]\\\\] - (.*?)$") ?9zmVOCQFE-QUE-.*?$-regex]\r\n [(re-find ?9zmVOCQFE-QUE-.*?$-regex ?9zmVOCQFE-DstPage-Title)]\r\n ))\r\n]', + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block", "references", "Page"], + ["Block", "is in page", "ParentPage"], + ["ParentPage", "is a", "destination"], + ], + }, + { + id: "DXvDSKe94", + label: "Informs", + source: "85wgkuO31", + destination: "CK3kwflMN", + complement: "Informed By", + query: + '[:find\r\n (pull ?Question [:block/string :node/title :block/uid])\r\n (pull ?Question [:block/uid])\r\n:where\r\n (or-join [?9zmVOCQFE-QUE-.*?$-regex ?9zmVOCQFE-Question-uid ?Question ?9zmVOCQFE-{{placeholder}}-uid ?{{placeholder}}]\r\n (and\r\n [?9zmVOCQFE-Page :block/uid "{{placeholder}}"]\r\n [?9zmVOCQFE-Page :block/uid ?9zmVOCQFE-{{placeholder}}-uid]\r\n [?{{placeholder}} :block/uid ?9zmVOCQFE-{{placeholder}}-uid]\r\n [?9zmVOCQFE-Block :block/refs ?9zmVOCQFE-Page]\r\n [?9zmVOCQFE-Block :block/page ?9zmVOCQFE-ParentPage]\r\n [?9zmVOCQFE-ParentPage :node/title ?9zmVOCQFE-ParentPage-Title]\r\n [?9zmVOCQFE-ParentPage :block/uid ?9zmVOCQFE-Question-uid]\r\n [?Question :block/uid ?9zmVOCQFE-Question-uid]\r\n [(re-pattern "^\\\\[\\\\[QUE\\\\]\\\\] - (.*?)$") ?9zmVOCQFE-QUE-.*?$-regex]\r\n [(re-find ?9zmVOCQFE-QUE-.*?$-regex ?9zmVOCQFE-ParentPage-Title)]\r\n )\r\n (and\r\n [?9zmVOCQFE-SrcPage :block/uid "{{placeholder}}"]\r\n [?9zmVOCQFE-LinkPage :node/title "Informs"]\r\n [?9zmVOCQFE-SrcPage :block/uid ?9zmVOCQFE-{{placeholder}}-uid]\r\n [?{{placeholder}} :block/uid ?9zmVOCQFE-{{placeholder}}-uid]\r\n [?9zmVOCQFE-SrcBlock :block/refs ?9zmVOCQFE-SrcPage]\r\n [?9zmVOCQFE-SrcBlock :block/refs ?9zmVOCQFE-LinkPage]\r\n [?9zmVOCQFE-SrcBlock :block/parents ?9zmVOCQFE-DstBlock]\r\n [?9zmVOCQFE-DstBlock :block/refs ?9zmVOCQFE-DstPage]\r\n [?9zmVOCQFE-DstPage :node/title ?9zmVOCQFE-DstPage-Title]\r\n [?9zmVOCQFE-DstPage :block/uid ?9zmVOCQFE-Question-uid]\r\n [?Question :block/uid ?9zmVOCQFE-Question-uid]\r\n [(re-pattern "^\\\\[\\\\[QUE\\\\]\\\\] - (.*?)$") ?9zmVOCQFE-QUE-.*?$-regex]\r\n [(re-find ?9zmVOCQFE-QUE-.*?$-regex ?9zmVOCQFE-DstPage-Title)]\r\n ))\r\n]', + complementQuery: "", + triples: [ + ["DstPage", "is a", "destination"], + ["SrcPage", "is a", "source"], + ["SrcBlock", "references", "SrcPage"], + ["DstBlock", "references", "DstPage"], + ["LinkPage", "has title", "Informs"], + ["SrcBlock", "references", "LinkPage"], + ["DstBlock", "has descendant", "SrcBlock"], + ], + }, + { + id: "Fd4HnEX0p", + label: "Supports", + source: "85wgkuO31", + destination: "sys03tzKR", + complement: "Supported By", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block", "references", "Page"], + ["Context", "references", "SPage"], + ["SPage", "has title", "SupportedBy"], + ["Context", "has child", "Block"], + ["PBlock", "references", "ParentPage"], + ["PBlock", "has child", "Context"], + ["ParentPage", "is a", "destination"], + ], + }, + { + id: "Fd4HnEX0p", + label: "Supports", + source: "85wgkuO31", + destination: "sys03tzKR", + complement: "Supported By", + query: "", + complementQuery: "", + triples: [ + ["Context", "references", "SPage"], + ["Page", "is a", "source"], + ["Context", "references", "Page"], + ["Context", "is in page", "ParentPage"], + ["ParentPage", "is a", "destination"], + ["SPage", "has title", "SupportedBy"], + ], + }, + { + id: "Fd4HnEX0p", + label: "Supports", + source: "85wgkuO31", + destination: "sys03tzKR", + complement: "Supported By", + query: "", + complementQuery: "", + triples: [ + ["Context", "references", "CPage"], + ["Context", "references", "EPage"], + ["Context", "references", "SPage"], + ["CPage", "is a", "destination"], + ["EPage", "is a", "source"], + ["SPage", "has title", "SupportedBy"], + ], + }, + { + id: "Fd4HnEX0p", + label: "Supports", + source: "85wgkuO31", + destination: "sys03tzKR", + complement: "Supported By", + query: "", + complementQuery: "", + triples: [ + ["DstPage", "is a", "destination"], + ["DstBlock", "references", "DstPage"], + ["RelPage", "has title", "SupportedBy"], + ["SrcPage", "is a", "source"], + ["Context", "references", "SrcPage"], + ["Context", "references", "RelPage"], + ["DstBlock", "has child", "Context"], + ], + }, + { + id: "Fd4HnEX0p", + label: "Supports", + source: "85wgkuO31", + destination: "sys03tzKR", + complement: "Supported By", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block", "references", "Page"], + ["Context", "has child", "Block"], + ["ParentPage", "is a", "destination"], + ["SPage", "has title", "SupportedBy"], + ["Context", "is in page", "ParentPage"], + ["Context", "references", "SPage"], + ], + }, + { + id: "Fd4HnEX0p", + label: "Supports", + source: "85wgkuO31", + destination: "sys03tzKR", + complement: "Supported By", + query: "", + complementQuery: "", + triples: [ + ["Block29", "is a", "source"], + ["Block30", "is a", "destination"], + ["Context", "references", "Block30"], + ["Block32", "has descendant", "Context"], + ["Block33", "has title", "Supports"], + ["Context", "references", "Block33"], + ["Block32", "references", "Block29"], + ], + }, + { + id: "M_0CySPtb", + label: "Opposes", + source: "85wgkuO31", + destination: "sys03tzKR", + complement: "Opposed By", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block", "references", "Page"], + ["SBlock", "references", "SPage"], + ["SPage", "has title", "Opposed By"], + ["SBlock", "has child", "Block"], + ["PBlock", "references", "ParentPage"], + ["PBlock", "has child", "SBlock"], + ["ParentPage", "is a", "destination"], + ], + }, + { + id: "TyLWOdB4U", + label: "Supports", + source: "sys03tzKR", + destination: "sys03tzKR", + complement: "Supported By", + query: "", + complementQuery: "", + triples: [ + ["DstPage", "is a", "destination"], + ["DstBlock", "references", "DstPage"], + ["SrcBlock", "references", "SrcPage"], + ["SrcPage", "is a", "source"], + ["RPage", "has title", "SupportedBy"], + ["RBlock", "references", "RPage"], + ["DstBlock", "has child", "RBlock"], + ["RBlock", "has child", "SrcBlock"], + ], + }, + { + id: "fxY-tTHCE", + label: "Informs", + source: "sys03tzKR", + destination: "CK3kwflMN", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Context", "is in page", "DstPage"], + ["Context", "references", "SrcPage"], + ["SrcPage", "is a", "source"], + ["DstPage", "is a", "destination"], + ], + }, + { + id: "fpwvws-ic", + label: "Consistent With", + source: "85wgkuO31", + destination: "85wgkuO31", + complement: "Consistent With", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block2", "references", "Page"], + ["Block3", "references", "Page2"], + ["Page2", "is a", "destination"], + ["Context", "has child", "Block2"], + ["Context", "has child", "Block3"], + ["Context", "references", "page3"], + ["page3", "has title", "SupportedBy"], + ], + }, + { + id: "fpwvws-ic", + label: "Consistent With", + source: "85wgkuO31", + destination: "85wgkuO31", + complement: "Consistent With", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block", "references", "Page"], + ["SBlock", "references", "SPage"], + ["SPage", "has title", "OpposedBy"], + ["SBlock", "has child", "Block"], + ["PBlock", "references", "ParentPage"], + ["PBlock", "has child", "SBlock"], + ["ParentPage", "is a", "destination"], + ], + }, + { + id: "fpwvws-ic", + label: "Consistent With", + source: "85wgkuO31", + destination: "85wgkuO31", + complement: "Consistent With", + query: "", + complementQuery: "", + triples: [ + ["Block16", "is a", "source"], + ["Block14", "is a", "destination"], + ["Block19", "has title", "consistentWith"], + ["Block17", "has child", "Block24"], + ["Block24", "references", "Block19"], + ["Block24", "references", "Block14"], + ["Block17", "references", "Block16"], + ], + }, + { + id: "5h91Rpo_w", + label: "Informs", + source: "OZhxQs38_", + destination: "sys03tzKR", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Context", "is in page", "Page2"], + ["Page2", "is a", "destination"], + ["Context", "references", "Page"], + ["Page", "is a", "source"], + ], + }, + { + id: "SPnC4rDfE", + label: "Informs", + source: "OZhxQs38_", + destination: "CK3kwflMN", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Context", "references", "Page"], + ["Context", "is in page", "Page2"], + ["Page2", "is a", "destination"], + ], + }, + { + id: "LWkn2SVzt", + label: "Informs", + source: "OZhxQs38_", + destination: "84l8tEeA2", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block1", "references", "Page"], + ["Block1", "is in page", "Page2"], + ["Page2", "is a", "destination"], + ], + }, + { + id: "CFnThTTI0", + label: "Informs", + source: "85wgkuO31", + destination: "84l8tEeA2", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Context", "is in page", "DstPage"], + ["Context", "references", "SrcPage"], + ["SrcPage", "is a", "source"], + ["DstPage", "is a", "destination"], + ], + }, + { + id: "CFnThTTI0", + label: "Informs", + source: "85wgkuO31", + destination: "84l8tEeA2", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["DstPage", "is a", "destination"], + ["SrcPage", "is a", "source"], + ["SrcBlock", "references", "SrcPage"], + ["DstBlock", "references", "DstPage"], + ["LinkPage", "has title", "Informs"], + ["SrcBlock", "references", "LinkPage"], + ["DstBlock", "has descendant", "SrcBlock"], + ], + }, + { + id: "bTXP3AKwO", + label: "Informs", + source: "OZhxQs38_", + destination: "ceW_PoMVt", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Context", "references", "Page"], + ["Context", "is in page", "Page2"], + ["Page2", "is a", "destination"], + ], + }, + { + id: "9xn6lpbAD", + label: "Informs", + source: "85wgkuO31", + destination: "ceW_PoMVt", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["SrcBlock", "is in page", "DstPage"], + ["SrcBlock", "references", "SrcPage"], + ["SrcPage", "is a", "source"], + ["DstPage", "is a", "destination"], + ], + }, + { + id: "9xn6lpbAD", + label: "Informs", + source: "85wgkuO31", + destination: "ceW_PoMVt", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["DstPage", "is a", "destination"], + ["SrcPage", "is a", "source"], + ["SrcBlock", "references", "SrcPage"], + ["DstBlock", "references", "DstPage"], + ["LinkPage", "has title", "Informs"], + ["SrcBlock", "references", "LinkPage"], + ["DstBlock", "has descendant", "SrcBlock"], + ], + }, + { + id: "HjthZkfw7", + label: "SourceFor", + source: "OZhxQs38_", + destination: "85wgkuO31", + complement: "FromSource", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Page2", "is a", "destination"], + ["Page2", "references", "Page"], + ], + }, + { + id: "uZu_VeT5Q", + label: "SourceFor", + source: "DoIcrR_MO", + destination: "q3B9CaO6Q", + complement: "FromSource", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Page2", "is a", "destination"], + ["Page2", "references", "Page"], + ], + }, + { + id: "_qxDacB9c", + label: "IssueFor", + source: "8tpfgIm5Z", + destination: "DoIcrR_MO", + complement: "RelatedIssue", + query: "", + complementQuery: "", + triples: [ + ["Block1", "is a", "destination"], + ["Block0", "is in page", "Block1"], + ["Block2", "is a", "source"], + ["Block0", "references", "Block2"], + ], + }, + { + id: "txJiNh8Pz", + label: "UsedIn", + source: "ceW_PoMVt", + destination: "S276jHf0s", + complement: "Uses", + query: "", + complementQuery: "", + triples: [ + ["Block0", "is a", "source"], + ["Block1", "is a", "destination"], + ["Context", "references", "Block1"], + ["Context", "is in page", "Block0"], + ["Context", "references", "Block3"], + ["Block3", "has title", "UsedIn"], + ], + }, + { + id: "Syi_vj27y", + label: "Informs", + source: "sys03tzKR", + destination: "sys03tzKR", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block", "references", "Page"], + ["Block", "is in page", "ParentPage"], + ["ParentPage", "is a", "destination"], + ], + }, + { + id: "Syi_vj27y", + label: "Informs", + source: "sys03tzKR", + destination: "sys03tzKR", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["DstPage", "is a", "destination"], + ["SrcPage", "is a", "source"], + ["SrcBlock", "references", "SrcPage"], + ["DstBlock", "references", "DstPage"], + ["LinkPage", "has title", "Informs"], + ["SrcBlock", "references", "LinkPage"], + ["DstBlock", "has descendant", "SrcBlock"], + ], + }, + { + id: "OtFiizJEX", + label: "IsTo", + source: "B676vtaon", + destination: "YjF0S0tKS", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Page", "is a", "source"], + ["Block2", "references", "Page"], + ["Block3", "references", "Page2"], + ["Page2", "is a", "destination"], + ["Context", "has child", "Block2"], + ["Context", "has child", "Block3"], + ["Context", "references", "page3"], + ["page3", "has title", "SupportedBy"], + ], + }, + { + id: "OtFiizJEX", + label: "IsTo", + source: "B676vtaon", + destination: "YjF0S0tKS", + complement: "Informed By", + query: "", + complementQuery: "", + triples: [ + ["Block16", "is a", "source"], + ["Block14", "is a", "destination"], + ["Block19", "has title", "consistentWith"], + ["Block17", "has child", "Block24"], + ["Block24", "references", "Block19"], + ["Block24", "references", "Block14"], + ["Block17", "references", "Block16"], + ], + }, + ], + }, + }; + const { + isCustomEnabled, + customNode, + isSamePageEnabled, + definedSelections, + ...args + } = _args; + const query = getDatalogQuery(args); + console.log(query); + }, + }); + extensionAPI.ui.commandPalette.addCommand({ + label: "Run Test Queries - then", + callback: async () => { + type QueryConfig = { + query: string; + }; + const executeQueriesWithLogs = async (queries: QueryConfig[]) => { + const startTime = Date.now(); + + const queryPromises = queries.map((q) => { + logTimestamp("🔍🟢", `Running query: ${q.query}`); + return window.roamAlphaAPI.data.async.q(q.query).then((result) => { + console.log(`Query completed after ${Date.now() - startTime}ms:`, { + query: q, + result, + }); + return result; + }); + }); + + const results = await Promise.all(queryPromises); + console.log( + `All queries completed after ${Date.now() - startTime}ms:`, + results + ); + return results; + }; + await executeQueriesWithLogs(queries); + }, + }); + + extensionAPI.ui.commandPalette.addCommand({ + label: "Run Test Queries", + callback: async () => { + type QueryConfig = { + query: string; + }; + + const executeQueriesWithLogs = async (queries: QueryConfig[]) => { + const startTime = Date.now(); + logTimestamp("🔍🟢", `Start`); + const results = await Promise.all( + queries.map((q) => { + const queryName = + (q.query.match(/\?(\w+)/)?.[1] || "unnamed") + `-${nanoid(4)}`; + logTimestamp("🔍🟢", `Running query: ${queryName}`); + + return window.roamAlphaAPI.data.async.q(q.query); + }) + ); + console.log( + `All queries completed after ${Date.now() - startTime}ms:`, + results + ); + return results; + }; + await executeQueriesWithLogs(queries); + }, + }); + + extensionAPI.ui.commandPalette.addCommand({ + label: "Query Tester", + callback: () => { + renderQueryTester({ + onClose: () => {}, + isOpen: true, + }); + }, + }); extensionAPI.ui.commandPalette.addCommand({ label: "Open Query Drawer", @@ -637,6 +1457,7 @@ svg.rs-svg-container { ).then((blockUid) => queryRender({ blockUid, + //@ts-ignore clearOnClick, onloadArgs, }) @@ -802,6 +1623,13 @@ svg.rs-svg-container { }); */ + renderToast({ + id: "discourse-graph-loaded", + content: "Successfully loaded", + intent: "success", + timeout: 500, + }); + const [viewBlockObserver] = createBlockObserver({ onBlockLoad: (b) => { const { blockUid } = getUids(b); diff --git a/src/utils/fireQuery.ts b/src/utils/fireQuery.ts index 5ba742b..57ce317 100644 --- a/src/utils/fireQuery.ts +++ b/src/utils/fireQuery.ts @@ -15,6 +15,8 @@ import predefinedSelections, { import { DEFAULT_RETURN_NODE } from "./parseQuery"; import { DiscourseNode } from "./getDiscourseNodes"; import { DiscourseRelation } from "./getDiscourseRelations"; +import { logTimestamp } from "../components/QueryTester"; +import nanoid from "nanoid"; export type QueryArgs = { returnNode?: string; @@ -27,6 +29,12 @@ type RelationInQuery = { text: string; isComplement: boolean; }; +type QuerySelection = { + mapper: PredefinedSelection["mapper"]; + pull: string; + label: string; + key: string; +}; export type FireQueryArgs = QueryArgs & { isSamePageEnabled?: boolean; isCustomEnabled?: boolean; @@ -36,6 +44,7 @@ export type FireQueryArgs = QueryArgs & { customNodes?: DiscourseNode[]; customRelations?: DiscourseRelation[]; }; + definedSelections?: QuerySelection[]; }; type FireQuery = (query: FireQueryArgs) => Promise; @@ -184,6 +193,69 @@ const getConditionTargets = (conditions: Condition[]): string[] => : getConditionTargets(c.conditions.flat()) ); +type FormatResultFn = (result: unknown[]) => Promise; +type FormattedOutput = { + output: string | number | Record | Date; + label: string; +}; + +const createFormatResultFn = ( + definedSelections: QuerySelection[] +): FormatResultFn => { + const formatSingleResult = async ( + pullResult: unknown, + selection: QuerySelection, + prev: QueryResult + ): Promise => { + if (typeof pullResult === "object" && pullResult !== null) { + const output = await selection.mapper( + pullResult as PullBlock, + selection.key, + prev + ); + return { output, label: selection.label }; + } + + if (typeof pullResult === "string" || typeof pullResult === "number") { + return { output: pullResult, label: selection.label }; + } + + return { output: "", label: selection.label }; + }; + + const applyOutputToResult = ( + result: QueryResult, + { output, label }: FormattedOutput + ): void => { + if (typeof output === "object" && !(output instanceof Date)) { + Object.entries(output as Record).forEach(([k, v]) => { + result[label + k] = String(v); + }); + } else if (typeof output === "number") { + result[label] = output.toString(); + } else { + result[label] = String(output); + } + }; + + return async (results: unknown[]): Promise => { + const formatters = definedSelections.map( + (selection, i) => (prev: QueryResult) => + formatSingleResult(results[i], selection, prev) + ); + + return formatters.reduce( + (prev, formatter) => + prev.then(async (p) => { + const output = await formatter(p); + applyOutputToResult(p, output); + return p; + }), + Promise.resolve({} as QueryResult) + ); + }; +}; + export const getDatalogQuery = ({ conditions, selections, @@ -258,39 +330,7 @@ export const getDatalogQuery = ({ ? `[?node :block/uid _]` : "" }${where}\n]`, - formatResult: (result: unknown[]) => - definedSelections - .map((c, i) => (prev: QueryResult) => { - const pullResult = result[i]; - return typeof pullResult === "object" && pullResult !== null - ? Promise.resolve( - c.mapper(pullResult as PullBlock, c.key, prev) - ).then((output) => ({ - output, - label: c.label, - })) - : typeof pullResult === "string" || typeof pullResult === "number" - ? Promise.resolve({ output: pullResult, label: c.label }) - : Promise.resolve({ output: "", label: c.label }); - }) - .reduce( - (prev, c) => - prev.then((p) => - c(p).then(({ output, label }) => { - if (typeof output === "object" && !(output instanceof Date)) { - Object.entries(output).forEach(([k, v]) => { - p[label + k] = v; - }); - } else if (typeof output === "number") { - p[label] = output.toString(); - } else { - p[label] = output; - } - return p; - }) - ), - Promise.resolve({} as QueryResult) - ), + formatResult: createFormatResultFn(definedSelections), inputs: expectedInputs.map((i) => inputs[i]), }; }; @@ -304,7 +344,14 @@ export const fireQuerySync = (args: FireQueryArgs): QueryResult[] => { }; const fireQuery: FireQuery = async (_args) => { - const { isCustomEnabled, customNode, isSamePageEnabled, ...args } = _args; + const { + isCustomEnabled, + customNode, + isSamePageEnabled, + definedSelections, + ...args + } = _args; + if (isSamePageEnabled) { return getSamePageAPI() .then((api) => api.postToAppBackend({ path: "query", data: { ...args } })) @@ -315,37 +362,80 @@ const fireQuery: FireQuery = async (_args) => { return []; }); } + logTimestamp("💽💽", "getDatalogQuery"); const { query, formatResult, inputs } = isCustomEnabled ? { query: customNode as string, - formatResult: (r: unknown[]): Promise => - Promise.resolve({ - text: "", - uid: "", - ...Object.fromEntries( - r.flatMap((p, index) => - typeof p === "object" && p !== null - ? Object.entries(p) - : [[index.toString(), p]] - ) - ), - }), + formatResult: definedSelections + ? createFormatResultFn(definedSelections) + : (r: unknown[]): Promise => + Promise.resolve({ + text: "", + uid: "", + ...Object.fromEntries( + r.flatMap((p, index) => + typeof p === "object" && p !== null + ? Object.entries(p) + : [[index.toString(), p]] + ) + ), + }), inputs: [], } : getDatalogQuery(args); + try { if (getNodeEnv() === "development") { - console.log("Query to Roam:"); - console.log(query); - if (inputs.length) console.log("Inputs:", ...inputs); + // console.log("Query to Roam:"); + // console.log(query); } - return Promise.all( - window.roamAlphaAPI.data.fast.q(query, ...inputs).map(formatResult) + const id = nanoid(6); + const queryName = (query.match(/\?(\w+)/)?.[1] || "unnamed") + `-${id}`; + const consistentWithCount = (query.match(/consistentWith/g) || []).length; + + const startTime = performance.now(); + logTimestamp("🔍🟢", `${queryName} - ${consistentWithCount}`); + if (inputs.length) console.log("Inputs:", ...inputs); + + const queryResults = await window.roamAlphaAPI.data.async.q( + query, + ...inputs ); + // console.log(args.context?.r || args.context); + console.log({ + label: args.context?.r.label, + iscomplement: args.context?.isComplement, + complement: args.context?.r.complement, + query, + queryResults, + }); + const duration = (performance.now() - startTime).toFixed(2); + console.log(`Query ${queryName} took ${duration}ms`); + logTimestamp("🔍🛑", `${queryName} - ${consistentWithCount}`); + + return Promise.all(queryResults.map(formatResult)); } catch (e) { - console.error("Error from Roam:"); + // console.error("Error from Roam:"); console.error((e as Error).message); - return []; + console.log({ + label: args.context?.r.label, + iscomplement: args.context?.isComplement, + complement: args.context?.r.complement, + query, + }); + + // Fallback to fast query + try { + console.log("Falling back to fast query"); + const fastResults = await window.roamAlphaAPI.data.fast.q( + query, + ...inputs + ); + return Promise.all(fastResults.map(formatResult)); + } catch (fastError) { + console.error("Fast query also failed:", (fastError as Error).message); + return []; + } } }; diff --git a/src/utils/getDiscourseContextResults.ts b/src/utils/getDiscourseContextResults.ts index 97679d1..0b937ed 100644 --- a/src/utils/getDiscourseContextResults.ts +++ b/src/utils/getDiscourseContextResults.ts @@ -7,17 +7,225 @@ import getDiscourseRelations, { DiscourseRelation, } from "./getDiscourseRelations"; import { OnloadArgs } from "roamjs-components/types"; +import { Selection } from "./types"; const resultCache: Record>> = {}; const CACHE_TIMEOUT = 1000 * 60 * 5; +type BuildQueryConfig = { + args: { + ignoreCache?: true; + isSamePageEnabledExternal?: boolean; + onloadArgs?: OnloadArgs; + }; + targetUid: string; + fireQueryContext: { + nodes: ReturnType; + relations: ReturnType; + r: DiscourseRelation; + isComplement: boolean; + }; + nodeTextByType: Record; + r: DiscourseRelation; + complement: boolean; + query?: string; +}; +type QueryConfig = { + relation: { + id: string; + text: string; + target: string; + isComplement: boolean; + }; + queryPromise: () => Promise; +}; + +type SelectionConfig = { + r: DiscourseRelation; + conditionUid?: string; +}; +const buildSelections = ({ + r, + conditionUid = window.roamAlphaAPI.util.generateUID(), +}: SelectionConfig): Selection[] => { + const selections: Selection[] = []; + + if (r.triples.some((t) => t.some((a) => /context/i.test(a)))) { + selections.push({ + uid: window.roamAlphaAPI.util.generateUID(), + label: "context", + text: `node:${conditionUid}-Context`, + }); + } else if (r.triples.some((t) => t.some((a) => /anchor/i.test(a)))) { + selections.push({ + uid: window.roamAlphaAPI.util.generateUID(), + label: "anchor", + text: `node:${conditionUid}-Anchor`, + }); + } + + return selections; +}; + +const executeQueries = async ( + queryConfigs: QueryConfig[], + targetUid: string, + nodeTextByType: Record, + + onProgress?: (result: { + label: string; + results: Record< + string, + Partial + >; + }) => void +) => { + console.time("queries"); + + const promises = queryConfigs.map(async ({ relation, queryPromise }) => { + const results = await queryPromise(); + if (onProgress) { + const groupedResult = { + label: relation.text, + results: Object.fromEntries( + results + .filter((a) => a.uid !== targetUid) + .map((res) => [ + res.uid, + { + ...res, + target: nodeTextByType[relation.target], + complement: relation.isComplement ? 1 : 0, + id: relation.id, + }, + ]) + ), + }; + onProgress(groupedResult); + } + return { relation, results }; + }); + + const results = await Promise.all(promises); + console.timeEnd("queries"); + return results; +}; + +const buildQueryConfig = ({ + args, + targetUid, + fireQueryContext, + nodeTextByType, + r, + complement: isComplement, + query, +}: BuildQueryConfig): QueryConfig => { + const { ignoreCache, isSamePageEnabledExternal, onloadArgs } = args; + const useSamePageFlag = !!onloadArgs?.extensionAPI.settings.get( + "use-backend-samepage-discourse-context" + ); + const isSamePageEnabled = + isSamePageEnabledExternal ?? useSamePageFlag ?? false; + const target = isComplement ? r.source : r.destination; + const text = isComplement ? r.complement : r.label; + const cacheKey = `${targetUid}~${text}~${target}`; + + const relation = { + id: r.id, + text, + target, + isComplement, + }; + + if (resultCache[cacheKey] && !ignoreCache) { + return { + relation, + queryPromise: () => Promise.resolve(resultCache[cacheKey]), + }; + } + + // prebuilt datalogQuery + // + // if (query) { + // + // const selections = buildSelections({ r }); + // const definedSelections = [ + // { + // key: "", + // label: "text", + // pull: `(pull ?${returnNode} [:block/string :node/title :block/uid])`, + // mapper: (r: any) => { + // return { + // "": r?.[":node/title"] || r?.[":block/string"] || "", + // "-uid": r[":block/uid"] || "", + // }; + // }, + // }, + // { + // key: "", + // label: "uid", + // pull: `(pull ?${returnNode} [:block/uid])`, + // mapper: (r: any) => { + // return r?.[":block/uid"] || ""; + // }, + // }, + // ]; + // + // return { + // relation, + // queryPromise: () => + // fireQuery({ + // customNode: query.replaceAll("{{placeholder}}", uid), + // isCustomEnabled: true, + // conditions: [], + // selections, + // definedSelections: [], //TODO + // isSamePageEnabled, + // }), + // }; + + const returnNode = nodeTextByType[target]; + + const conditionUid = window.roamAlphaAPI.util.generateUID(); + const selections = buildSelections({ r, conditionUid }); + const { nodes, relations } = fireQueryContext; + return { + relation, + queryPromise: () => + fireQuery({ + returnNode, + conditions: [ + { + source: returnNode, + // NOTE! This MUST be the OPPOSITE of `label` + relation: isComplement ? r.label : r.complement, + target: targetUid, + uid: conditionUid, + type: "clause", + }, + ], + selections, + isSamePageEnabled, + context: { + relationsInQuery: [relation], + customNodes: nodes, + customRelations: relations, + //@ts-ignore + r: fireQueryContext.r, + isComplement, + }, + }), + }; +}; + const getDiscourseContextResults = async ({ - uid, + uid: targetUid, relations = getDiscourseRelations(), nodes = getDiscourseNodes(relations), ignoreCache, isSamePageEnabled: isSamePageEnabledExternal, - args, + args: onloadArgs, + onProgress, }: { uid: string; nodes?: ReturnType; @@ -25,106 +233,79 @@ const getDiscourseContextResults = async ({ ignoreCache?: true; isSamePageEnabled?: boolean; args?: OnloadArgs; + onProgress?: (result: { + label: string; + results: Record< + string, + Partial + >; + }) => void; }) => { - const useSamePageFlag = !!args?.extensionAPI.settings.get( - "use-backend-samepage-discourse-context" - ); - const isSamePageEnabled = - isSamePageEnabledExternal ?? useSamePageFlag ?? false; - const discourseNode = findDiscourseNode(uid); + const args = { ignoreCache, isSamePageEnabledExternal, onloadArgs }; + + const discourseNode = findDiscourseNode(targetUid); if (!discourseNode) return []; const nodeType = discourseNode?.type; const nodeTextByType = Object.fromEntries( nodes.map(({ type, text }) => [type, text]) ); nodeTextByType["*"] = "Any"; - const resultsWithRelation = await Promise.all( - relations - .flatMap((r) => { - const queries = []; - if (r.source === nodeType || r.source === "*") { - queries.push({ - r, - complement: false, - }); - } - if (r.destination === nodeType || r.destination === "*") { - queries.push({ - r, - complement: true, - }); - } - return queries; - }) - .map(({ r, complement: isComplement }) => { - const target = isComplement ? r.source : r.destination; - const text = isComplement ? r.complement : r.label; - const returnNode = nodeTextByType[target]; - const cacheKey = `${uid}~${text}~${target}`; - const conditionUid = window.roamAlphaAPI.util.generateUID(); - const selections = []; - if (r.triples.some((t) => t.some((a) => /context/i.test(a)))) { - selections.push({ - uid: window.roamAlphaAPI.util.generateUID(), - label: "context", - text: `node:${conditionUid}-Context`, - }); - } else if (r.triples.some((t) => t.some((a) => /anchor/i.test(a)))) { - selections.push({ - uid: window.roamAlphaAPI.util.generateUID(), - label: "anchor", - text: `node:${conditionUid}-Anchor`, - }); - } - const relation = { - id: r.id, - text, - target, - isComplement, - }; - const rawResults = - resultCache[cacheKey] && !ignoreCache - ? Promise.resolve(resultCache[cacheKey]) - : fireQuery({ - returnNode, - conditions: [ - { - source: returnNode, - // NOTE! This MUST be the OPPOSITE of `label` - relation: isComplement ? r.label : r.complement, - target: uid, - uid: conditionUid, - type: "clause", - }, - ], - selections, - isSamePageEnabled, - context: { - relationsInQuery: [relation], - customNodes: nodes, - customRelations: relations, - }, - }).then((results) => { - resultCache[cacheKey] = results; - setTimeout(() => { - delete resultCache[cacheKey]; - }, CACHE_TIMEOUT); - return results; - }); - return rawResults.then((results) => ({ - relation: { - text, - isComplement, - target, - id: r.id, - }, - results, - })); - }) - ).catch((e) => { - console.error(e); - return [] as const; + + console.log("relations", relations); + + type RelationWithComplement = { + id: string; + r: DiscourseRelation; + complement: boolean; + }; + const uniqueRelations = new Map(); + + relations.forEach((r) => { + if (r.source === nodeType || r.source === "*") { + uniqueRelations.set(`${r.id}-false`, { + id: r.id, + r, + complement: false, + }); + } + if (r.destination === nodeType || r.destination === "*") { + uniqueRelations.set(`${r.id}-true`, { + id: r.id, + r, + complement: true, + }); + } }); + + const relationsWithComplement = Array.from(uniqueRelations.values()); + + console.log("relationsWithComplement", relationsWithComplement); + + const context = { nodes, relations }; + const queryConfigs = relationsWithComplement.map((relation) => + buildQueryConfig({ + args, + targetUid: targetUid, + nodeTextByType, + fireQueryContext: { + r: relation.r, + isComplement: relation.complement, + ...context, + }, + r: relation.r, + complement: relation.complement, + // query: relation.query, + }) + ); + // console.log("queryConfigs", queryConfigs); + + const resultsWithRelation = await executeQueries( + queryConfigs, + targetUid, + nodeTextByType, + onProgress + ); + console.log("resultsWithRelation", resultsWithRelation); const groupedResults = Object.fromEntries( resultsWithRelation.map((r) => [ r.relation.text, @@ -134,9 +315,10 @@ const getDiscourseContextResults = async ({ >, ]) ); + resultsWithRelation.forEach((r) => r.results - .filter((a) => a.uid !== uid) + .filter((a) => a.uid !== targetUid) .forEach( (res) => // TODO POST MIGRATE - set result to its own field diff --git a/src/utils/mockQuery.ts b/src/utils/mockQuery.ts new file mode 100644 index 0000000..829c442 --- /dev/null +++ b/src/utils/mockQuery.ts @@ -0,0 +1,89 @@ +// Mock types +const getTimestamp = () => { + const timestamp = new Date(); + const minutes = String(timestamp.getMinutes()).padStart(2, "0"); + const seconds = String(timestamp.getSeconds()).padStart(2, "0"); + const milliseconds = String(timestamp.getMilliseconds()).padStart(3, "0"); + return `${minutes}:${seconds}:${milliseconds}`; +}; + +const getDatalogQuery = (id, duration = 1000) => { + console.log(`🏋️‍♀️🟢 - ${id} getDatalogQuery -`, getTimestamp()); + const startTime = Date.now(); + + // Block the thread for 1 second + while (Date.now() - startTime < duration) { + // Do nothing, just wait + } + + console.log(`🏋️‍♀️🔴 - ${id} getDatalogQuery -`, getTimestamp()); +}; + +const fakeBackendQuery = (id, durationMin = 1, durationMax = 4) => { + // Convert seconds to milliseconds + const durationMinMs = durationMin * 1000; + const durationMaxMs = durationMax * 1000; + return new Promise((resolve) => { + const delay = + id === 1 + ? 0 + : Math.floor(Math.random() * ((durationMaxMs - durationMinMs) / 1000)) * + 1000 + + durationMinMs; + + const startTime = getTimestamp(); + console.log(`🔎🟢 - ${id} Query -`, startTime, delay); + + setTimeout(() => { + console.log(`🔎🔴 - ${id} Query`); + console.log(startTime, "Start"); + console.log(getTimestamp(), "End"); + console.log("Delay -", delay); + resolve([id]); + }, delay); + }); +}; + +const fireQuery = async (args) => { + getDatalogQuery(args); + const results = await fakeBackendQuery(args); + return Promise.all( + results.map((r) => ({ + text: r, + })) + ); +}; + +// Mock function that mimics resultsWithRelation behavior +const getDiscourseResults = async () => { + console.log("--- Starting Parallel Queries ---"); + console.time("total"); + + // Mock relations data + const relations = [1, 2, 3, 4]; + + const resultsWithRelation = await Promise.all( + relations.map(async (r) => { + const results = fireQuery(r); + + return results.then((results) => ({ + relation: r, + results, + })); + }) + ).catch((e) => { + console.error(e); + return []; + }); + + console.timeEnd("total"); + return resultsWithRelation; +}; + +// Run the test +// getDiscourseResults().then((results) => { +// console.log("\nFinal Results:"); +// console.log(JSON.stringify(results, null, 2)); +// }); + +export { getTimestamp, getDatalogQuery, fakeBackendQuery, fireQuery }; diff --git a/src/utils/queryData.ts b/src/utils/queryData.ts new file mode 100644 index 0000000..81cc403 --- /dev/null +++ b/src/utils/queryData.ts @@ -0,0 +1,82 @@ +export const queries = [ + { + query: + '[:find\n (pull ?Question [:block/string :node/title :block/uid])\n (pull ?Question [:block/uid])\n:where\n (or-join [?xZjrVdBtE-QUE-.*?$-regex ?xZjrVdBtE-Question-uid ?Question ?xZjrVdBtE-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?xZjrVdBtE-Page :block/uid "2yEG0_6MI"]\n [?xZjrVdBtE-Page :block/uid ?xZjrVdBtE-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?xZjrVdBtE-2yEG0_6MI-uid]\n [?xZjrVdBtE-Block :block/refs ?xZjrVdBtE-Page]\n [?xZjrVdBtE-Block :block/page ?xZjrVdBtE-ParentPage]\n [?xZjrVdBtE-ParentPage :node/title ?xZjrVdBtE-ParentPage-Title]\n [?xZjrVdBtE-ParentPage :block/uid ?xZjrVdBtE-Question-uid]\n [?Question :block/uid ?xZjrVdBtE-Question-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[QUE\\\\\\\\]\\\\\\\\] - (.*?)$") ?xZjrVdBtE-QUE-.*?$-regex]\n [(re-find ?xZjrVdBtE-QUE-.*?$-regex ?xZjrVdBtE-ParentPage-Title)]\n )\n (and\n [?xZjrVdBtE-SrcPage :block/uid "2yEG0_6MI"]\n [?xZjrVdBtE-LinkPage :node/title "Informs"]\n [?xZjrVdBtE-SrcPage :block/uid ?xZjrVdBtE-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?xZjrVdBtE-2yEG0_6MI-uid]\n [?xZjrVdBtE-SrcBlock :block/refs ?xZjrVdBtE-SrcPage]\n [?xZjrVdBtE-SrcBlock :block/refs ?xZjrVdBtE-LinkPage]\n [?xZjrVdBtE-SrcBlock :block/parents ?xZjrVdBtE-DstBlock]\n [?xZjrVdBtE-DstBlock :block/refs ?xZjrVdBtE-DstPage]\n [?xZjrVdBtE-DstPage :node/title ?xZjrVdBtE-DstPage-Title]\n [?xZjrVdBtE-DstPage :block/uid ?xZjrVdBtE-Question-uid]\n [?Question :block/uid ?xZjrVdBtE-Question-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[QUE\\\\\\\\]\\\\\\\\] - (.*?)$") ?xZjrVdBtE-QUE-.*?$-regex]\n [(re-find ?xZjrVdBtE-QUE-.*?$-regex ?xZjrVdBtE-DstPage-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Question [:block/string :node/title :block/uid])\n (pull ?Question [:block/uid])\n:where\n (or-join [?cpuarsOaV-QUE-.*?$-regex ?cpuarsOaV-Question-uid ?Question ?cpuarsOaV-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?cpuarsOaV-Page :block/uid "2yEG0_6MI"]\n [?cpuarsOaV-Page :block/uid ?cpuarsOaV-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?cpuarsOaV-2yEG0_6MI-uid]\n [?cpuarsOaV-Block :block/refs ?cpuarsOaV-Page]\n [?cpuarsOaV-Block :block/page ?cpuarsOaV-ParentPage]\n [?cpuarsOaV-ParentPage :node/title ?cpuarsOaV-ParentPage-Title]\n [?cpuarsOaV-ParentPage :block/uid ?cpuarsOaV-Question-uid]\n [?Question :block/uid ?cpuarsOaV-Question-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[QUE\\\\\\\\]\\\\\\\\] - (.*?)$") ?cpuarsOaV-QUE-.*?$-regex]\n [(re-find ?cpuarsOaV-QUE-.*?$-regex ?cpuarsOaV-ParentPage-Title)]\n )\n (and\n [?cpuarsOaV-SrcPage :block/uid "2yEG0_6MI"]\n [?cpuarsOaV-LinkPage :node/title "Informs"]\n [?cpuarsOaV-SrcPage :block/uid ?cpuarsOaV-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?cpuarsOaV-2yEG0_6MI-uid]\n [?cpuarsOaV-SrcBlock :block/refs ?cpuarsOaV-SrcPage]\n [?cpuarsOaV-SrcBlock :block/refs ?cpuarsOaV-LinkPage]\n [?cpuarsOaV-SrcBlock :block/parents ?cpuarsOaV-DstBlock]\n [?cpuarsOaV-DstBlock :block/refs ?cpuarsOaV-DstPage]\n [?cpuarsOaV-DstPage :node/title ?cpuarsOaV-DstPage-Title]\n [?cpuarsOaV-DstPage :block/uid ?cpuarsOaV-Question-uid]\n [?Question :block/uid ?cpuarsOaV-Question-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[QUE\\\\\\\\]\\\\\\\\] - (.*?)$") ?cpuarsOaV-QUE-.*?$-regex]\n [(re-find ?cpuarsOaV-QUE-.*?$-regex ?cpuarsOaV-DstPage-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Claim [:block/string :node/title :block/uid])\n (pull ?Claim [:block/uid])\n (pull ?slkGz_cHm-Context [:node/title :block/uid :block/string])\n:where\n (or-join [?slkGz_cHm-CLM-.*?$-regex ?slkGz_cHm-Claim-uid ?Claim ?slkGz_cHm-2yEG0_6MI-uid ?2yEG0_6MI ?slkGz_cHm-Context]\n (and\n [?slkGz_cHm-Page :block/uid "2yEG0_6MI"]\n [?slkGz_cHm-SPage :node/title "SupportedBy"]\n [?slkGz_cHm-Page :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?slkGz_cHm-Block :block/refs ?slkGz_cHm-Page]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-SPage]\n [?slkGz_cHm-Context :block/children ?slkGz_cHm-Block]\n [?slkGz_cHm-PBlock :block/children ?slkGz_cHm-Context]\n [?slkGz_cHm-PBlock :block/refs ?slkGz_cHm-ParentPage]\n [?slkGz_cHm-ParentPage :node/title ?slkGz_cHm-ParentPage-Title]\n [?slkGz_cHm-ParentPage :block/uid ?slkGz_cHm-Claim-uid]\n [?Claim :block/uid ?slkGz_cHm-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?slkGz_cHm-CLM-.*?$-regex]\n [(re-find ?slkGz_cHm-CLM-.*?$-regex ?slkGz_cHm-ParentPage-Title)]\n )\n (and\n [?slkGz_cHm-Page :block/uid "2yEG0_6MI"]\n [?slkGz_cHm-SPage :node/title "SupportedBy"]\n [?slkGz_cHm-Page :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-SPage]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-Page]\n [?slkGz_cHm-Context :block/page ?slkGz_cHm-ParentPage]\n [?slkGz_cHm-ParentPage :node/title ?slkGz_cHm-ParentPage-Title]\n [?slkGz_cHm-ParentPage :block/uid ?slkGz_cHm-Claim-uid]\n [?Claim :block/uid ?slkGz_cHm-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?slkGz_cHm-CLM-.*?$-regex]\n [(re-find ?slkGz_cHm-CLM-.*?$-regex ?slkGz_cHm-ParentPage-Title)]\n )\n (and\n [?slkGz_cHm-EPage :block/uid "2yEG0_6MI"]\n [?slkGz_cHm-SPage :node/title "SupportedBy"]\n [?slkGz_cHm-EPage :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-EPage]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-CPage]\n [?slkGz_cHm-CPage :node/title ?slkGz_cHm-CPage-Title]\n [?slkGz_cHm-CPage :block/uid ?slkGz_cHm-Claim-uid]\n [?Claim :block/uid ?slkGz_cHm-Claim-uid]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?slkGz_cHm-CLM-.*?$-regex]\n [(re-find ?slkGz_cHm-CLM-.*?$-regex ?slkGz_cHm-CPage-Title)]\n )\n (and\n [?slkGz_cHm-SrcPage :block/uid "2yEG0_6MI"]\n [?slkGz_cHm-RelPage :node/title "SupportedBy"]\n [?slkGz_cHm-SrcPage :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-SrcPage]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-RelPage]\n [?slkGz_cHm-DstBlock :block/children ?slkGz_cHm-Context]\n [?slkGz_cHm-DstBlock :block/refs ?slkGz_cHm-DstPage]\n [?slkGz_cHm-DstPage :node/title ?slkGz_cHm-DstPage-Title]\n [?slkGz_cHm-DstPage :block/uid ?slkGz_cHm-Claim-uid]\n [?Claim :block/uid ?slkGz_cHm-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?slkGz_cHm-CLM-.*?$-regex]\n [(re-find ?slkGz_cHm-CLM-.*?$-regex ?slkGz_cHm-DstPage-Title)]\n )\n (and\n [?slkGz_cHm-Page :block/uid "2yEG0_6MI"]\n [?slkGz_cHm-SPage :node/title "SupportedBy"]\n [?slkGz_cHm-Page :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?slkGz_cHm-Block :block/refs ?slkGz_cHm-Page]\n [?slkGz_cHm-Context :block/children ?slkGz_cHm-Block]\n [?slkGz_cHm-Context :block/page ?slkGz_cHm-ParentPage]\n [?slkGz_cHm-ParentPage :node/title ?slkGz_cHm-ParentPage-Title]\n [?slkGz_cHm-ParentPage :block/uid ?slkGz_cHm-Claim-uid]\n [?Claim :block/uid ?slkGz_cHm-Claim-uid]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?slkGz_cHm-CLM-.*?$-regex]\n [(re-find ?slkGz_cHm-CLM-.*?$-regex ?slkGz_cHm-ParentPage-Title)]\n )\n (and\n [?slkGz_cHm-Block29 :block/uid "2yEG0_6MI"]\n [?slkGz_cHm-Block33 :node/title "Supports"]\n [?slkGz_cHm-Block29 :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?slkGz_cHm-2yEG0_6MI-uid]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-Block33]\n [?slkGz_cHm-Context :block/refs ?slkGz_cHm-Block30]\n [?slkGz_cHm-Block30 :node/title ?slkGz_cHm-Block30-Title]\n [?slkGz_cHm-Block30 :block/uid ?slkGz_cHm-Claim-uid]\n [?Claim :block/uid ?slkGz_cHm-Claim-uid]\n [?slkGz_cHm-Context :block/parents ?slkGz_cHm-Block32]\n [?slkGz_cHm-Block32 :block/refs ?slkGz_cHm-Block29]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?slkGz_cHm-CLM-.*?$-regex]\n [(re-find ?slkGz_cHm-CLM-.*?$-regex ?slkGz_cHm-Block30-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Claim [:block/string :node/title :block/uid])\n (pull ?Claim [:block/uid])\n (pull ?LF4htHRW7-Context [:node/title :block/uid :block/string])\n:where\n (or-join [?LF4htHRW7-CLM-.*?$-regex ?LF4htHRW7-Claim-uid ?Claim ?LF4htHRW7-2yEG0_6MI-uid ?2yEG0_6MI ?LF4htHRW7-Context]\n (and\n [?LF4htHRW7-Page :block/uid "2yEG0_6MI"]\n [?LF4htHRW7-SPage :node/title "SupportedBy"]\n [?LF4htHRW7-Page :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?LF4htHRW7-Block :block/refs ?LF4htHRW7-Page]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-SPage]\n [?LF4htHRW7-Context :block/children ?LF4htHRW7-Block]\n [?LF4htHRW7-PBlock :block/children ?LF4htHRW7-Context]\n [?LF4htHRW7-PBlock :block/refs ?LF4htHRW7-ParentPage]\n [?LF4htHRW7-ParentPage :node/title ?LF4htHRW7-ParentPage-Title]\n [?LF4htHRW7-ParentPage :block/uid ?LF4htHRW7-Claim-uid]\n [?Claim :block/uid ?LF4htHRW7-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?LF4htHRW7-CLM-.*?$-regex]\n [(re-find ?LF4htHRW7-CLM-.*?$-regex ?LF4htHRW7-ParentPage-Title)]\n )\n (and\n [?LF4htHRW7-Page :block/uid "2yEG0_6MI"]\n [?LF4htHRW7-SPage :node/title "SupportedBy"]\n [?LF4htHRW7-Page :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-SPage]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-Page]\n [?LF4htHRW7-Context :block/page ?LF4htHRW7-ParentPage]\n [?LF4htHRW7-ParentPage :node/title ?LF4htHRW7-ParentPage-Title]\n [?LF4htHRW7-ParentPage :block/uid ?LF4htHRW7-Claim-uid]\n [?Claim :block/uid ?LF4htHRW7-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?LF4htHRW7-CLM-.*?$-regex]\n [(re-find ?LF4htHRW7-CLM-.*?$-regex ?LF4htHRW7-ParentPage-Title)]\n )\n (and\n [?LF4htHRW7-EPage :block/uid "2yEG0_6MI"]\n [?LF4htHRW7-SPage :node/title "SupportedBy"]\n [?LF4htHRW7-EPage :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-EPage]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-CPage]\n [?LF4htHRW7-CPage :node/title ?LF4htHRW7-CPage-Title]\n [?LF4htHRW7-CPage :block/uid ?LF4htHRW7-Claim-uid]\n [?Claim :block/uid ?LF4htHRW7-Claim-uid]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?LF4htHRW7-CLM-.*?$-regex]\n [(re-find ?LF4htHRW7-CLM-.*?$-regex ?LF4htHRW7-CPage-Title)]\n )\n (and\n [?LF4htHRW7-SrcPage :block/uid "2yEG0_6MI"]\n [?LF4htHRW7-RelPage :node/title "SupportedBy"]\n [?LF4htHRW7-SrcPage :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-SrcPage]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-RelPage]\n [?LF4htHRW7-DstBlock :block/children ?LF4htHRW7-Context]\n [?LF4htHRW7-DstBlock :block/refs ?LF4htHRW7-DstPage]\n [?LF4htHRW7-DstPage :node/title ?LF4htHRW7-DstPage-Title]\n [?LF4htHRW7-DstPage :block/uid ?LF4htHRW7-Claim-uid]\n [?Claim :block/uid ?LF4htHRW7-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?LF4htHRW7-CLM-.*?$-regex]\n [(re-find ?LF4htHRW7-CLM-.*?$-regex ?LF4htHRW7-DstPage-Title)]\n )\n (and\n [?LF4htHRW7-Page :block/uid "2yEG0_6MI"]\n [?LF4htHRW7-SPage :node/title "SupportedBy"]\n [?LF4htHRW7-Page :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?LF4htHRW7-Block :block/refs ?LF4htHRW7-Page]\n [?LF4htHRW7-Context :block/children ?LF4htHRW7-Block]\n [?LF4htHRW7-Context :block/page ?LF4htHRW7-ParentPage]\n [?LF4htHRW7-ParentPage :node/title ?LF4htHRW7-ParentPage-Title]\n [?LF4htHRW7-ParentPage :block/uid ?LF4htHRW7-Claim-uid]\n [?Claim :block/uid ?LF4htHRW7-Claim-uid]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?LF4htHRW7-CLM-.*?$-regex]\n [(re-find ?LF4htHRW7-CLM-.*?$-regex ?LF4htHRW7-ParentPage-Title)]\n )\n (and\n [?LF4htHRW7-Block29 :block/uid "2yEG0_6MI"]\n [?LF4htHRW7-Block33 :node/title "Supports"]\n [?LF4htHRW7-Block29 :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?LF4htHRW7-2yEG0_6MI-uid]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-Block33]\n [?LF4htHRW7-Context :block/refs ?LF4htHRW7-Block30]\n [?LF4htHRW7-Block30 :node/title ?LF4htHRW7-Block30-Title]\n [?LF4htHRW7-Block30 :block/uid ?LF4htHRW7-Claim-uid]\n [?Claim :block/uid ?LF4htHRW7-Claim-uid]\n [?LF4htHRW7-Context :block/parents ?LF4htHRW7-Block32]\n [?LF4htHRW7-Block32 :block/refs ?LF4htHRW7-Block29]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?LF4htHRW7-CLM-.*?$-regex]\n [(re-find ?LF4htHRW7-CLM-.*?$-regex ?LF4htHRW7-Block30-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Claim [:block/string :node/title :block/uid])\n (pull ?Claim [:block/uid])\n (pull ?wVts2r3ho-Context [:node/title :block/uid :block/string])\n:where\n (or-join [?wVts2r3ho-CLM-.*?$-regex ?wVts2r3ho-Claim-uid ?Claim ?wVts2r3ho-2yEG0_6MI-uid ?2yEG0_6MI ?wVts2r3ho-Context]\n (and\n [?wVts2r3ho-Page :block/uid "2yEG0_6MI"]\n [?wVts2r3ho-SPage :node/title "SupportedBy"]\n [?wVts2r3ho-Page :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?wVts2r3ho-Block :block/refs ?wVts2r3ho-Page]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-SPage]\n [?wVts2r3ho-Context :block/children ?wVts2r3ho-Block]\n [?wVts2r3ho-PBlock :block/children ?wVts2r3ho-Context]\n [?wVts2r3ho-PBlock :block/refs ?wVts2r3ho-ParentPage]\n [?wVts2r3ho-ParentPage :node/title ?wVts2r3ho-ParentPage-Title]\n [?wVts2r3ho-ParentPage :block/uid ?wVts2r3ho-Claim-uid]\n [?Claim :block/uid ?wVts2r3ho-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?wVts2r3ho-CLM-.*?$-regex]\n [(re-find ?wVts2r3ho-CLM-.*?$-regex ?wVts2r3ho-ParentPage-Title)]\n )\n (and\n [?wVts2r3ho-Page :block/uid "2yEG0_6MI"]\n [?wVts2r3ho-SPage :node/title "SupportedBy"]\n [?wVts2r3ho-Page :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-SPage]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-Page]\n [?wVts2r3ho-Context :block/page ?wVts2r3ho-ParentPage]\n [?wVts2r3ho-ParentPage :node/title ?wVts2r3ho-ParentPage-Title]\n [?wVts2r3ho-ParentPage :block/uid ?wVts2r3ho-Claim-uid]\n [?Claim :block/uid ?wVts2r3ho-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?wVts2r3ho-CLM-.*?$-regex]\n [(re-find ?wVts2r3ho-CLM-.*?$-regex ?wVts2r3ho-ParentPage-Title)]\n )\n (and\n [?wVts2r3ho-EPage :block/uid "2yEG0_6MI"]\n [?wVts2r3ho-SPage :node/title "SupportedBy"]\n [?wVts2r3ho-EPage :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-EPage]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-CPage]\n [?wVts2r3ho-CPage :node/title ?wVts2r3ho-CPage-Title]\n [?wVts2r3ho-CPage :block/uid ?wVts2r3ho-Claim-uid]\n [?Claim :block/uid ?wVts2r3ho-Claim-uid]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?wVts2r3ho-CLM-.*?$-regex]\n [(re-find ?wVts2r3ho-CLM-.*?$-regex ?wVts2r3ho-CPage-Title)]\n )\n (and\n [?wVts2r3ho-SrcPage :block/uid "2yEG0_6MI"]\n [?wVts2r3ho-RelPage :node/title "SupportedBy"]\n [?wVts2r3ho-SrcPage :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-SrcPage]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-RelPage]\n [?wVts2r3ho-DstBlock :block/children ?wVts2r3ho-Context]\n [?wVts2r3ho-DstBlock :block/refs ?wVts2r3ho-DstPage]\n [?wVts2r3ho-DstPage :node/title ?wVts2r3ho-DstPage-Title]\n [?wVts2r3ho-DstPage :block/uid ?wVts2r3ho-Claim-uid]\n [?Claim :block/uid ?wVts2r3ho-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?wVts2r3ho-CLM-.*?$-regex]\n [(re-find ?wVts2r3ho-CLM-.*?$-regex ?wVts2r3ho-DstPage-Title)]\n )\n (and\n [?wVts2r3ho-Page :block/uid "2yEG0_6MI"]\n [?wVts2r3ho-SPage :node/title "SupportedBy"]\n [?wVts2r3ho-Page :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?wVts2r3ho-Block :block/refs ?wVts2r3ho-Page]\n [?wVts2r3ho-Context :block/children ?wVts2r3ho-Block]\n [?wVts2r3ho-Context :block/page ?wVts2r3ho-ParentPage]\n [?wVts2r3ho-ParentPage :node/title ?wVts2r3ho-ParentPage-Title]\n [?wVts2r3ho-ParentPage :block/uid ?wVts2r3ho-Claim-uid]\n [?Claim :block/uid ?wVts2r3ho-Claim-uid]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?wVts2r3ho-CLM-.*?$-regex]\n [(re-find ?wVts2r3ho-CLM-.*?$-regex ?wVts2r3ho-ParentPage-Title)]\n )\n (and\n [?wVts2r3ho-Block29 :block/uid "2yEG0_6MI"]\n [?wVts2r3ho-Block33 :node/title "Supports"]\n [?wVts2r3ho-Block29 :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wVts2r3ho-2yEG0_6MI-uid]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-Block33]\n [?wVts2r3ho-Context :block/refs ?wVts2r3ho-Block30]\n [?wVts2r3ho-Block30 :node/title ?wVts2r3ho-Block30-Title]\n [?wVts2r3ho-Block30 :block/uid ?wVts2r3ho-Claim-uid]\n [?Claim :block/uid ?wVts2r3ho-Claim-uid]\n [?wVts2r3ho-Context :block/parents ?wVts2r3ho-Block32]\n [?wVts2r3ho-Block32 :block/refs ?wVts2r3ho-Block29]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?wVts2r3ho-CLM-.*?$-regex]\n [(re-find ?wVts2r3ho-CLM-.*?$-regex ?wVts2r3ho-Block30-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Claim [:block/string :node/title :block/uid])\n (pull ?Claim [:block/uid])\n (pull ?pXBaily7b-Context [:node/title :block/uid :block/string])\n:where\n (or-join [?pXBaily7b-CLM-.*?$-regex ?pXBaily7b-Claim-uid ?Claim ?pXBaily7b-2yEG0_6MI-uid ?2yEG0_6MI ?pXBaily7b-Context]\n (and\n [?pXBaily7b-Page :block/uid "2yEG0_6MI"]\n [?pXBaily7b-SPage :node/title "SupportedBy"]\n [?pXBaily7b-Page :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?pXBaily7b-Block :block/refs ?pXBaily7b-Page]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-SPage]\n [?pXBaily7b-Context :block/children ?pXBaily7b-Block]\n [?pXBaily7b-PBlock :block/children ?pXBaily7b-Context]\n [?pXBaily7b-PBlock :block/refs ?pXBaily7b-ParentPage]\n [?pXBaily7b-ParentPage :node/title ?pXBaily7b-ParentPage-Title]\n [?pXBaily7b-ParentPage :block/uid ?pXBaily7b-Claim-uid]\n [?Claim :block/uid ?pXBaily7b-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?pXBaily7b-CLM-.*?$-regex]\n [(re-find ?pXBaily7b-CLM-.*?$-regex ?pXBaily7b-ParentPage-Title)]\n )\n (and\n [?pXBaily7b-Page :block/uid "2yEG0_6MI"]\n [?pXBaily7b-SPage :node/title "SupportedBy"]\n [?pXBaily7b-Page :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-SPage]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-Page]\n [?pXBaily7b-Context :block/page ?pXBaily7b-ParentPage]\n [?pXBaily7b-ParentPage :node/title ?pXBaily7b-ParentPage-Title]\n [?pXBaily7b-ParentPage :block/uid ?pXBaily7b-Claim-uid]\n [?Claim :block/uid ?pXBaily7b-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?pXBaily7b-CLM-.*?$-regex]\n [(re-find ?pXBaily7b-CLM-.*?$-regex ?pXBaily7b-ParentPage-Title)]\n )\n (and\n [?pXBaily7b-EPage :block/uid "2yEG0_6MI"]\n [?pXBaily7b-SPage :node/title "SupportedBy"]\n [?pXBaily7b-EPage :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-EPage]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-CPage]\n [?pXBaily7b-CPage :node/title ?pXBaily7b-CPage-Title]\n [?pXBaily7b-CPage :block/uid ?pXBaily7b-Claim-uid]\n [?Claim :block/uid ?pXBaily7b-Claim-uid]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?pXBaily7b-CLM-.*?$-regex]\n [(re-find ?pXBaily7b-CLM-.*?$-regex ?pXBaily7b-CPage-Title)]\n )\n (and\n [?pXBaily7b-SrcPage :block/uid "2yEG0_6MI"]\n [?pXBaily7b-RelPage :node/title "SupportedBy"]\n [?pXBaily7b-SrcPage :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-SrcPage]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-RelPage]\n [?pXBaily7b-DstBlock :block/children ?pXBaily7b-Context]\n [?pXBaily7b-DstBlock :block/refs ?pXBaily7b-DstPage]\n [?pXBaily7b-DstPage :node/title ?pXBaily7b-DstPage-Title]\n [?pXBaily7b-DstPage :block/uid ?pXBaily7b-Claim-uid]\n [?Claim :block/uid ?pXBaily7b-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?pXBaily7b-CLM-.*?$-regex]\n [(re-find ?pXBaily7b-CLM-.*?$-regex ?pXBaily7b-DstPage-Title)]\n )\n (and\n [?pXBaily7b-Page :block/uid "2yEG0_6MI"]\n [?pXBaily7b-SPage :node/title "SupportedBy"]\n [?pXBaily7b-Page :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?pXBaily7b-Block :block/refs ?pXBaily7b-Page]\n [?pXBaily7b-Context :block/children ?pXBaily7b-Block]\n [?pXBaily7b-Context :block/page ?pXBaily7b-ParentPage]\n [?pXBaily7b-ParentPage :node/title ?pXBaily7b-ParentPage-Title]\n [?pXBaily7b-ParentPage :block/uid ?pXBaily7b-Claim-uid]\n [?Claim :block/uid ?pXBaily7b-Claim-uid]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?pXBaily7b-CLM-.*?$-regex]\n [(re-find ?pXBaily7b-CLM-.*?$-regex ?pXBaily7b-ParentPage-Title)]\n )\n (and\n [?pXBaily7b-Block29 :block/uid "2yEG0_6MI"]\n [?pXBaily7b-Block33 :node/title "Supports"]\n [?pXBaily7b-Block29 :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?pXBaily7b-2yEG0_6MI-uid]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-Block33]\n [?pXBaily7b-Context :block/refs ?pXBaily7b-Block30]\n [?pXBaily7b-Block30 :node/title ?pXBaily7b-Block30-Title]\n [?pXBaily7b-Block30 :block/uid ?pXBaily7b-Claim-uid]\n [?Claim :block/uid ?pXBaily7b-Claim-uid]\n [?pXBaily7b-Context :block/parents ?pXBaily7b-Block32]\n [?pXBaily7b-Block32 :block/refs ?pXBaily7b-Block29]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?pXBaily7b-CLM-.*?$-regex]\n [(re-find ?pXBaily7b-CLM-.*?$-regex ?pXBaily7b-Block30-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Claim [:block/string :node/title :block/uid])\n (pull ?Claim [:block/uid])\n (pull ?ixN8iAvIg-Context [:node/title :block/uid :block/string])\n:where\n (or-join [?ixN8iAvIg-CLM-.*?$-regex ?ixN8iAvIg-Claim-uid ?Claim ?ixN8iAvIg-2yEG0_6MI-uid ?2yEG0_6MI ?ixN8iAvIg-Context]\n (and\n [?ixN8iAvIg-Page :block/uid "2yEG0_6MI"]\n [?ixN8iAvIg-SPage :node/title "SupportedBy"]\n [?ixN8iAvIg-Page :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?ixN8iAvIg-Block :block/refs ?ixN8iAvIg-Page]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-SPage]\n [?ixN8iAvIg-Context :block/children ?ixN8iAvIg-Block]\n [?ixN8iAvIg-PBlock :block/children ?ixN8iAvIg-Context]\n [?ixN8iAvIg-PBlock :block/refs ?ixN8iAvIg-ParentPage]\n [?ixN8iAvIg-ParentPage :node/title ?ixN8iAvIg-ParentPage-Title]\n [?ixN8iAvIg-ParentPage :block/uid ?ixN8iAvIg-Claim-uid]\n [?Claim :block/uid ?ixN8iAvIg-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?ixN8iAvIg-CLM-.*?$-regex]\n [(re-find ?ixN8iAvIg-CLM-.*?$-regex ?ixN8iAvIg-ParentPage-Title)]\n )\n (and\n [?ixN8iAvIg-Page :block/uid "2yEG0_6MI"]\n [?ixN8iAvIg-SPage :node/title "SupportedBy"]\n [?ixN8iAvIg-Page :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-SPage]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-Page]\n [?ixN8iAvIg-Context :block/page ?ixN8iAvIg-ParentPage]\n [?ixN8iAvIg-ParentPage :node/title ?ixN8iAvIg-ParentPage-Title]\n [?ixN8iAvIg-ParentPage :block/uid ?ixN8iAvIg-Claim-uid]\n [?Claim :block/uid ?ixN8iAvIg-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?ixN8iAvIg-CLM-.*?$-regex]\n [(re-find ?ixN8iAvIg-CLM-.*?$-regex ?ixN8iAvIg-ParentPage-Title)]\n )\n (and\n [?ixN8iAvIg-EPage :block/uid "2yEG0_6MI"]\n [?ixN8iAvIg-SPage :node/title "SupportedBy"]\n [?ixN8iAvIg-EPage :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-EPage]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-CPage]\n [?ixN8iAvIg-CPage :node/title ?ixN8iAvIg-CPage-Title]\n [?ixN8iAvIg-CPage :block/uid ?ixN8iAvIg-Claim-uid]\n [?Claim :block/uid ?ixN8iAvIg-Claim-uid]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?ixN8iAvIg-CLM-.*?$-regex]\n [(re-find ?ixN8iAvIg-CLM-.*?$-regex ?ixN8iAvIg-CPage-Title)]\n )\n (and\n [?ixN8iAvIg-SrcPage :block/uid "2yEG0_6MI"]\n [?ixN8iAvIg-RelPage :node/title "SupportedBy"]\n [?ixN8iAvIg-SrcPage :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-SrcPage]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-RelPage]\n [?ixN8iAvIg-DstBlock :block/children ?ixN8iAvIg-Context]\n [?ixN8iAvIg-DstBlock :block/refs ?ixN8iAvIg-DstPage]\n [?ixN8iAvIg-DstPage :node/title ?ixN8iAvIg-DstPage-Title]\n [?ixN8iAvIg-DstPage :block/uid ?ixN8iAvIg-Claim-uid]\n [?Claim :block/uid ?ixN8iAvIg-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?ixN8iAvIg-CLM-.*?$-regex]\n [(re-find ?ixN8iAvIg-CLM-.*?$-regex ?ixN8iAvIg-DstPage-Title)]\n )\n (and\n [?ixN8iAvIg-Page :block/uid "2yEG0_6MI"]\n [?ixN8iAvIg-SPage :node/title "SupportedBy"]\n [?ixN8iAvIg-Page :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?ixN8iAvIg-Block :block/refs ?ixN8iAvIg-Page]\n [?ixN8iAvIg-Context :block/children ?ixN8iAvIg-Block]\n [?ixN8iAvIg-Context :block/page ?ixN8iAvIg-ParentPage]\n [?ixN8iAvIg-ParentPage :node/title ?ixN8iAvIg-ParentPage-Title]\n [?ixN8iAvIg-ParentPage :block/uid ?ixN8iAvIg-Claim-uid]\n [?Claim :block/uid ?ixN8iAvIg-Claim-uid]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?ixN8iAvIg-CLM-.*?$-regex]\n [(re-find ?ixN8iAvIg-CLM-.*?$-regex ?ixN8iAvIg-ParentPage-Title)]\n )\n (and\n [?ixN8iAvIg-Block29 :block/uid "2yEG0_6MI"]\n [?ixN8iAvIg-Block33 :node/title "Supports"]\n [?ixN8iAvIg-Block29 :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?ixN8iAvIg-2yEG0_6MI-uid]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-Block33]\n [?ixN8iAvIg-Context :block/refs ?ixN8iAvIg-Block30]\n [?ixN8iAvIg-Block30 :node/title ?ixN8iAvIg-Block30-Title]\n [?ixN8iAvIg-Block30 :block/uid ?ixN8iAvIg-Claim-uid]\n [?Claim :block/uid ?ixN8iAvIg-Claim-uid]\n [?ixN8iAvIg-Context :block/parents ?ixN8iAvIg-Block32]\n [?ixN8iAvIg-Block32 :block/refs ?ixN8iAvIg-Block29]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?ixN8iAvIg-CLM-.*?$-regex]\n [(re-find ?ixN8iAvIg-CLM-.*?$-regex ?ixN8iAvIg-Block30-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Claim [:block/string :node/title :block/uid])\n (pull ?Claim [:block/uid])\n (pull ?-yAZ9oPkM-Context [:node/title :block/uid :block/string])\n:where\n (or-join [?-yAZ9oPkM-CLM-.*?$-regex ?-yAZ9oPkM-Claim-uid ?Claim ?-yAZ9oPkM-2yEG0_6MI-uid ?2yEG0_6MI ?-yAZ9oPkM-Context]\n (and\n [?-yAZ9oPkM-Page :block/uid "2yEG0_6MI"]\n [?-yAZ9oPkM-SPage :node/title "SupportedBy"]\n [?-yAZ9oPkM-Page :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?-yAZ9oPkM-Block :block/refs ?-yAZ9oPkM-Page]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-SPage]\n [?-yAZ9oPkM-Context :block/children ?-yAZ9oPkM-Block]\n [?-yAZ9oPkM-PBlock :block/children ?-yAZ9oPkM-Context]\n [?-yAZ9oPkM-PBlock :block/refs ?-yAZ9oPkM-ParentPage]\n [?-yAZ9oPkM-ParentPage :node/title ?-yAZ9oPkM-ParentPage-Title]\n [?-yAZ9oPkM-ParentPage :block/uid ?-yAZ9oPkM-Claim-uid]\n [?Claim :block/uid ?-yAZ9oPkM-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?-yAZ9oPkM-CLM-.*?$-regex]\n [(re-find ?-yAZ9oPkM-CLM-.*?$-regex ?-yAZ9oPkM-ParentPage-Title)]\n )\n (and\n [?-yAZ9oPkM-Page :block/uid "2yEG0_6MI"]\n [?-yAZ9oPkM-SPage :node/title "SupportedBy"]\n [?-yAZ9oPkM-Page :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-SPage]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-Page]\n [?-yAZ9oPkM-Context :block/page ?-yAZ9oPkM-ParentPage]\n [?-yAZ9oPkM-ParentPage :node/title ?-yAZ9oPkM-ParentPage-Title]\n [?-yAZ9oPkM-ParentPage :block/uid ?-yAZ9oPkM-Claim-uid]\n [?Claim :block/uid ?-yAZ9oPkM-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?-yAZ9oPkM-CLM-.*?$-regex]\n [(re-find ?-yAZ9oPkM-CLM-.*?$-regex ?-yAZ9oPkM-ParentPage-Title)]\n )\n (and\n [?-yAZ9oPkM-EPage :block/uid "2yEG0_6MI"]\n [?-yAZ9oPkM-SPage :node/title "SupportedBy"]\n [?-yAZ9oPkM-EPage :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-EPage]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-CPage]\n [?-yAZ9oPkM-CPage :node/title ?-yAZ9oPkM-CPage-Title]\n [?-yAZ9oPkM-CPage :block/uid ?-yAZ9oPkM-Claim-uid]\n [?Claim :block/uid ?-yAZ9oPkM-Claim-uid]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?-yAZ9oPkM-CLM-.*?$-regex]\n [(re-find ?-yAZ9oPkM-CLM-.*?$-regex ?-yAZ9oPkM-CPage-Title)]\n )\n (and\n [?-yAZ9oPkM-SrcPage :block/uid "2yEG0_6MI"]\n [?-yAZ9oPkM-RelPage :node/title "SupportedBy"]\n [?-yAZ9oPkM-SrcPage :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-SrcPage]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-RelPage]\n [?-yAZ9oPkM-DstBlock :block/children ?-yAZ9oPkM-Context]\n [?-yAZ9oPkM-DstBlock :block/refs ?-yAZ9oPkM-DstPage]\n [?-yAZ9oPkM-DstPage :node/title ?-yAZ9oPkM-DstPage-Title]\n [?-yAZ9oPkM-DstPage :block/uid ?-yAZ9oPkM-Claim-uid]\n [?Claim :block/uid ?-yAZ9oPkM-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?-yAZ9oPkM-CLM-.*?$-regex]\n [(re-find ?-yAZ9oPkM-CLM-.*?$-regex ?-yAZ9oPkM-DstPage-Title)]\n )\n (and\n [?-yAZ9oPkM-Page :block/uid "2yEG0_6MI"]\n [?-yAZ9oPkM-SPage :node/title "SupportedBy"]\n [?-yAZ9oPkM-Page :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?-yAZ9oPkM-Block :block/refs ?-yAZ9oPkM-Page]\n [?-yAZ9oPkM-Context :block/children ?-yAZ9oPkM-Block]\n [?-yAZ9oPkM-Context :block/page ?-yAZ9oPkM-ParentPage]\n [?-yAZ9oPkM-ParentPage :node/title ?-yAZ9oPkM-ParentPage-Title]\n [?-yAZ9oPkM-ParentPage :block/uid ?-yAZ9oPkM-Claim-uid]\n [?Claim :block/uid ?-yAZ9oPkM-Claim-uid]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-SPage]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?-yAZ9oPkM-CLM-.*?$-regex]\n [(re-find ?-yAZ9oPkM-CLM-.*?$-regex ?-yAZ9oPkM-ParentPage-Title)]\n )\n (and\n [?-yAZ9oPkM-Block29 :block/uid "2yEG0_6MI"]\n [?-yAZ9oPkM-Block33 :node/title "Supports"]\n [?-yAZ9oPkM-Block29 :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?-yAZ9oPkM-2yEG0_6MI-uid]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-Block33]\n [?-yAZ9oPkM-Context :block/refs ?-yAZ9oPkM-Block30]\n [?-yAZ9oPkM-Block30 :node/title ?-yAZ9oPkM-Block30-Title]\n [?-yAZ9oPkM-Block30 :block/uid ?-yAZ9oPkM-Claim-uid]\n [?Claim :block/uid ?-yAZ9oPkM-Claim-uid]\n [?-yAZ9oPkM-Context :block/parents ?-yAZ9oPkM-Block32]\n [?-yAZ9oPkM-Block32 :block/refs ?-yAZ9oPkM-Block29]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?-yAZ9oPkM-CLM-.*?$-regex]\n [(re-find ?-yAZ9oPkM-CLM-.*?$-regex ?-yAZ9oPkM-Block30-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Claim [:block/string :node/title :block/uid])\n (pull ?Claim [:block/uid])\n:where\n [?R8BSIOCEl-Page :block/uid "2yEG0_6MI"]\n [?R8BSIOCEl-SPage :node/title "Opposed By"]\n [?R8BSIOCEl-Page :block/uid ?R8BSIOCEl-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?R8BSIOCEl-2yEG0_6MI-uid]\n [?R8BSIOCEl-Block :block/refs ?R8BSIOCEl-Page]\n [?R8BSIOCEl-SBlock :block/refs ?R8BSIOCEl-SPage]\n [?R8BSIOCEl-SBlock :block/children ?R8BSIOCEl-Block]\n [?R8BSIOCEl-PBlock :block/children ?R8BSIOCEl-SBlock]\n [?R8BSIOCEl-PBlock :block/refs ?R8BSIOCEl-ParentPage]\n [?R8BSIOCEl-ParentPage :node/title ?R8BSIOCEl-ParentPage-Title]\n [?R8BSIOCEl-ParentPage :block/uid ?R8BSIOCEl-Claim-uid]\n [?Claim :block/uid ?R8BSIOCEl-Claim-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[CLM\\\\\\\\]\\\\\\\\] - (.*?)$") ?R8BSIOCEl-CLM-.*?$-regex]\n [(re-find ?R8BSIOCEl-CLM-.*?$-regex ?R8BSIOCEl-ParentPage-Title)]\n]', + }, + { + query: + '[:find\n (pull ?Evidence [:block/string :node/title :block/uid])\n (pull ?Evidence [:block/uid])\n:where\n (or-join [?wpqyjD0W4-EVD-.*?-.*?$-regex ?wpqyjD0W4-Evidence-uid ?Evidence ?wpqyjD0W4-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?wpqyjD0W4-Page2 :block/uid "2yEG0_6MI"]\n [?wpqyjD0W4-page3 :node/title "SupportedBy"]\n [?wpqyjD0W4-Page2 :block/uid ?wpqyjD0W4-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wpqyjD0W4-2yEG0_6MI-uid]\n [?wpqyjD0W4-Block3 :block/refs ?wpqyjD0W4-Page2]\n [?wpqyjD0W4-Context :block/children ?wpqyjD0W4-Block3]\n [?wpqyjD0W4-Context :block/children ?wpqyjD0W4-Block2]\n [?wpqyjD0W4-Block2 :block/refs ?wpqyjD0W4-Page]\n [?wpqyjD0W4-Page :node/title ?wpqyjD0W4-Page-Title]\n [?wpqyjD0W4-Page :block/uid ?wpqyjD0W4-Evidence-uid]\n [?Evidence :block/uid ?wpqyjD0W4-Evidence-uid]\n [?wpqyjD0W4-Context :block/refs ?wpqyjD0W4-page3]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?wpqyjD0W4-EVD-.*?-.*?$-regex]\n [(re-find ?wpqyjD0W4-EVD-.*?-.*?$-regex ?wpqyjD0W4-Page-Title)]\n )\n (and\n [?wpqyjD0W4-ParentPage :block/uid "2yEG0_6MI"]\n [?wpqyjD0W4-SPage :node/title "OpposedBy"]\n [?wpqyjD0W4-ParentPage :block/uid ?wpqyjD0W4-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wpqyjD0W4-2yEG0_6MI-uid]\n [?wpqyjD0W4-SBlock :block/refs ?wpqyjD0W4-SPage]\n [?wpqyjD0W4-SBlock :block/children ?wpqyjD0W4-Block]\n [?wpqyjD0W4-Block :block/refs ?wpqyjD0W4-Page]\n [?wpqyjD0W4-Page :node/title ?wpqyjD0W4-Page-Title]\n [?wpqyjD0W4-Page :block/uid ?wpqyjD0W4-Evidence-uid]\n [?Evidence :block/uid ?wpqyjD0W4-Evidence-uid]\n [?wpqyjD0W4-PBlock :block/refs ?wpqyjD0W4-ParentPage]\n [?wpqyjD0W4-PBlock :block/children ?wpqyjD0W4-SBlock]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?wpqyjD0W4-EVD-.*?-.*?$-regex]\n [(re-find ?wpqyjD0W4-EVD-.*?-.*?$-regex ?wpqyjD0W4-Page-Title)]\n )\n (and\n [?wpqyjD0W4-Block14 :block/uid "2yEG0_6MI"]\n [?wpqyjD0W4-Block19 :node/title "consistentWith"]\n [?wpqyjD0W4-Block14 :block/uid ?wpqyjD0W4-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?wpqyjD0W4-2yEG0_6MI-uid]\n [?wpqyjD0W4-Block24 :block/refs ?wpqyjD0W4-Block19]\n [?wpqyjD0W4-Block17 :block/children ?wpqyjD0W4-Block24]\n [?wpqyjD0W4-Block24 :block/refs ?wpqyjD0W4-Block14]\n [?wpqyjD0W4-Block17 :block/refs ?wpqyjD0W4-Block16]\n [?wpqyjD0W4-Block16 :node/title ?wpqyjD0W4-Block16-Title]\n [?wpqyjD0W4-Block16 :block/uid ?wpqyjD0W4-Evidence-uid]\n [?Evidence :block/uid ?wpqyjD0W4-Evidence-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?wpqyjD0W4-EVD-.*?-.*?$-regex]\n [(re-find ?wpqyjD0W4-EVD-.*?-.*?$-regex ?wpqyjD0W4-Block16-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Evidence [:block/string :node/title :block/uid])\n (pull ?Evidence [:block/uid])\n:where\n (or-join [?G8ZrsNHG5-EVD-.*?-.*?$-regex ?G8ZrsNHG5-Evidence-uid ?Evidence ?G8ZrsNHG5-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?G8ZrsNHG5-Page2 :block/uid "2yEG0_6MI"]\n [?G8ZrsNHG5-page3 :node/title "SupportedBy"]\n [?G8ZrsNHG5-Page2 :block/uid ?G8ZrsNHG5-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?G8ZrsNHG5-2yEG0_6MI-uid]\n [?G8ZrsNHG5-Block3 :block/refs ?G8ZrsNHG5-Page2]\n [?G8ZrsNHG5-Context :block/children ?G8ZrsNHG5-Block3]\n [?G8ZrsNHG5-Context :block/children ?G8ZrsNHG5-Block2]\n [?G8ZrsNHG5-Block2 :block/refs ?G8ZrsNHG5-Page]\n [?G8ZrsNHG5-Page :node/title ?G8ZrsNHG5-Page-Title]\n [?G8ZrsNHG5-Page :block/uid ?G8ZrsNHG5-Evidence-uid]\n [?Evidence :block/uid ?G8ZrsNHG5-Evidence-uid]\n [?G8ZrsNHG5-Context :block/refs ?G8ZrsNHG5-page3]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?G8ZrsNHG5-EVD-.*?-.*?$-regex]\n [(re-find ?G8ZrsNHG5-EVD-.*?-.*?$-regex ?G8ZrsNHG5-Page-Title)]\n )\n (and\n [?G8ZrsNHG5-ParentPage :block/uid "2yEG0_6MI"]\n [?G8ZrsNHG5-SPage :node/title "OpposedBy"]\n [?G8ZrsNHG5-ParentPage :block/uid ?G8ZrsNHG5-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?G8ZrsNHG5-2yEG0_6MI-uid]\n [?G8ZrsNHG5-SBlock :block/refs ?G8ZrsNHG5-SPage]\n [?G8ZrsNHG5-SBlock :block/children ?G8ZrsNHG5-Block]\n [?G8ZrsNHG5-Block :block/refs ?G8ZrsNHG5-Page]\n [?G8ZrsNHG5-Page :node/title ?G8ZrsNHG5-Page-Title]\n [?G8ZrsNHG5-Page :block/uid ?G8ZrsNHG5-Evidence-uid]\n [?Evidence :block/uid ?G8ZrsNHG5-Evidence-uid]\n [?G8ZrsNHG5-PBlock :block/refs ?G8ZrsNHG5-ParentPage]\n [?G8ZrsNHG5-PBlock :block/children ?G8ZrsNHG5-SBlock]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?G8ZrsNHG5-EVD-.*?-.*?$-regex]\n [(re-find ?G8ZrsNHG5-EVD-.*?-.*?$-regex ?G8ZrsNHG5-Page-Title)]\n )\n (and\n [?G8ZrsNHG5-Block14 :block/uid "2yEG0_6MI"]\n [?G8ZrsNHG5-Block19 :node/title "consistentWith"]\n [?G8ZrsNHG5-Block14 :block/uid ?G8ZrsNHG5-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?G8ZrsNHG5-2yEG0_6MI-uid]\n [?G8ZrsNHG5-Block24 :block/refs ?G8ZrsNHG5-Block19]\n [?G8ZrsNHG5-Block17 :block/children ?G8ZrsNHG5-Block24]\n [?G8ZrsNHG5-Block24 :block/refs ?G8ZrsNHG5-Block14]\n [?G8ZrsNHG5-Block17 :block/refs ?G8ZrsNHG5-Block16]\n [?G8ZrsNHG5-Block16 :node/title ?G8ZrsNHG5-Block16-Title]\n [?G8ZrsNHG5-Block16 :block/uid ?G8ZrsNHG5-Evidence-uid]\n [?Evidence :block/uid ?G8ZrsNHG5-Evidence-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?G8ZrsNHG5-EVD-.*?-.*?$-regex]\n [(re-find ?G8ZrsNHG5-EVD-.*?-.*?$-regex ?G8ZrsNHG5-Block16-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Evidence [:block/string :node/title :block/uid])\n (pull ?Evidence [:block/uid])\n:where\n (or-join [?aoTq4fMRg-EVD-.*?-.*?$-regex ?aoTq4fMRg-Evidence-uid ?Evidence ?aoTq4fMRg-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?aoTq4fMRg-Page2 :block/uid "2yEG0_6MI"]\n [?aoTq4fMRg-page3 :node/title "SupportedBy"]\n [?aoTq4fMRg-Page2 :block/uid ?aoTq4fMRg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?aoTq4fMRg-2yEG0_6MI-uid]\n [?aoTq4fMRg-Block3 :block/refs ?aoTq4fMRg-Page2]\n [?aoTq4fMRg-Context :block/children ?aoTq4fMRg-Block3]\n [?aoTq4fMRg-Context :block/children ?aoTq4fMRg-Block2]\n [?aoTq4fMRg-Block2 :block/refs ?aoTq4fMRg-Page]\n [?aoTq4fMRg-Page :node/title ?aoTq4fMRg-Page-Title]\n [?aoTq4fMRg-Page :block/uid ?aoTq4fMRg-Evidence-uid]\n [?Evidence :block/uid ?aoTq4fMRg-Evidence-uid]\n [?aoTq4fMRg-Context :block/refs ?aoTq4fMRg-page3]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?aoTq4fMRg-EVD-.*?-.*?$-regex]\n [(re-find ?aoTq4fMRg-EVD-.*?-.*?$-regex ?aoTq4fMRg-Page-Title)]\n )\n (and\n [?aoTq4fMRg-ParentPage :block/uid "2yEG0_6MI"]\n [?aoTq4fMRg-SPage :node/title "OpposedBy"]\n [?aoTq4fMRg-ParentPage :block/uid ?aoTq4fMRg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?aoTq4fMRg-2yEG0_6MI-uid]\n [?aoTq4fMRg-SBlock :block/refs ?aoTq4fMRg-SPage]\n [?aoTq4fMRg-SBlock :block/children ?aoTq4fMRg-Block]\n [?aoTq4fMRg-Block :block/refs ?aoTq4fMRg-Page]\n [?aoTq4fMRg-Page :node/title ?aoTq4fMRg-Page-Title]\n [?aoTq4fMRg-Page :block/uid ?aoTq4fMRg-Evidence-uid]\n [?Evidence :block/uid ?aoTq4fMRg-Evidence-uid]\n [?aoTq4fMRg-PBlock :block/refs ?aoTq4fMRg-ParentPage]\n [?aoTq4fMRg-PBlock :block/children ?aoTq4fMRg-SBlock]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?aoTq4fMRg-EVD-.*?-.*?$-regex]\n [(re-find ?aoTq4fMRg-EVD-.*?-.*?$-regex ?aoTq4fMRg-Page-Title)]\n )\n (and\n [?aoTq4fMRg-Block14 :block/uid "2yEG0_6MI"]\n [?aoTq4fMRg-Block19 :node/title "consistentWith"]\n [?aoTq4fMRg-Block14 :block/uid ?aoTq4fMRg-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?aoTq4fMRg-2yEG0_6MI-uid]\n [?aoTq4fMRg-Block24 :block/refs ?aoTq4fMRg-Block19]\n [?aoTq4fMRg-Block17 :block/children ?aoTq4fMRg-Block24]\n [?aoTq4fMRg-Block24 :block/refs ?aoTq4fMRg-Block14]\n [?aoTq4fMRg-Block17 :block/refs ?aoTq4fMRg-Block16]\n [?aoTq4fMRg-Block16 :node/title ?aoTq4fMRg-Block16-Title]\n [?aoTq4fMRg-Block16 :block/uid ?aoTq4fMRg-Evidence-uid]\n [?Evidence :block/uid ?aoTq4fMRg-Evidence-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?aoTq4fMRg-EVD-.*?-.*?$-regex]\n [(re-find ?aoTq4fMRg-EVD-.*?-.*?$-regex ?aoTq4fMRg-Block16-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Evidence [:block/string :node/title :block/uid])\n (pull ?Evidence [:block/uid])\n:where\n (or-join [?WvsNK326e-EVD-.*?-.*?$-regex ?WvsNK326e-Evidence-uid ?Evidence ?WvsNK326e-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?WvsNK326e-Page2 :block/uid "2yEG0_6MI"]\n [?WvsNK326e-page3 :node/title "SupportedBy"]\n [?WvsNK326e-Page2 :block/uid ?WvsNK326e-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?WvsNK326e-2yEG0_6MI-uid]\n [?WvsNK326e-Block3 :block/refs ?WvsNK326e-Page2]\n [?WvsNK326e-Context :block/children ?WvsNK326e-Block3]\n [?WvsNK326e-Context :block/children ?WvsNK326e-Block2]\n [?WvsNK326e-Block2 :block/refs ?WvsNK326e-Page]\n [?WvsNK326e-Page :node/title ?WvsNK326e-Page-Title]\n [?WvsNK326e-Page :block/uid ?WvsNK326e-Evidence-uid]\n [?Evidence :block/uid ?WvsNK326e-Evidence-uid]\n [?WvsNK326e-Context :block/refs ?WvsNK326e-page3]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?WvsNK326e-EVD-.*?-.*?$-regex]\n [(re-find ?WvsNK326e-EVD-.*?-.*?$-regex ?WvsNK326e-Page-Title)]\n )\n (and\n [?WvsNK326e-ParentPage :block/uid "2yEG0_6MI"]\n [?WvsNK326e-SPage :node/title "OpposedBy"]\n [?WvsNK326e-ParentPage :block/uid ?WvsNK326e-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?WvsNK326e-2yEG0_6MI-uid]\n [?WvsNK326e-SBlock :block/refs ?WvsNK326e-SPage]\n [?WvsNK326e-SBlock :block/children ?WvsNK326e-Block]\n [?WvsNK326e-Block :block/refs ?WvsNK326e-Page]\n [?WvsNK326e-Page :node/title ?WvsNK326e-Page-Title]\n [?WvsNK326e-Page :block/uid ?WvsNK326e-Evidence-uid]\n [?Evidence :block/uid ?WvsNK326e-Evidence-uid]\n [?WvsNK326e-PBlock :block/refs ?WvsNK326e-ParentPage]\n [?WvsNK326e-PBlock :block/children ?WvsNK326e-SBlock]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?WvsNK326e-EVD-.*?-.*?$-regex]\n [(re-find ?WvsNK326e-EVD-.*?-.*?$-regex ?WvsNK326e-Page-Title)]\n )\n (and\n [?WvsNK326e-Block14 :block/uid "2yEG0_6MI"]\n [?WvsNK326e-Block19 :node/title "consistentWith"]\n [?WvsNK326e-Block14 :block/uid ?WvsNK326e-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?WvsNK326e-2yEG0_6MI-uid]\n [?WvsNK326e-Block24 :block/refs ?WvsNK326e-Block19]\n [?WvsNK326e-Block17 :block/children ?WvsNK326e-Block24]\n [?WvsNK326e-Block24 :block/refs ?WvsNK326e-Block14]\n [?WvsNK326e-Block17 :block/refs ?WvsNK326e-Block16]\n [?WvsNK326e-Block16 :node/title ?WvsNK326e-Block16-Title]\n [?WvsNK326e-Block16 :block/uid ?WvsNK326e-Evidence-uid]\n [?Evidence :block/uid ?WvsNK326e-Evidence-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?WvsNK326e-EVD-.*?-.*?$-regex]\n [(re-find ?WvsNK326e-EVD-.*?-.*?$-regex ?WvsNK326e-Block16-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Evidence [:block/string :node/title :block/uid])\n (pull ?Evidence [:block/uid])\n:where\n (or-join [?dp9dsZ2A8-EVD-.*?-.*?$-regex ?dp9dsZ2A8-Evidence-uid ?Evidence ?dp9dsZ2A8-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?dp9dsZ2A8-Page2 :block/uid "2yEG0_6MI"]\n [?dp9dsZ2A8-page3 :node/title "SupportedBy"]\n [?dp9dsZ2A8-Page2 :block/uid ?dp9dsZ2A8-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?dp9dsZ2A8-2yEG0_6MI-uid]\n [?dp9dsZ2A8-Block3 :block/refs ?dp9dsZ2A8-Page2]\n [?dp9dsZ2A8-Context :block/children ?dp9dsZ2A8-Block3]\n [?dp9dsZ2A8-Context :block/children ?dp9dsZ2A8-Block2]\n [?dp9dsZ2A8-Block2 :block/refs ?dp9dsZ2A8-Page]\n [?dp9dsZ2A8-Page :node/title ?dp9dsZ2A8-Page-Title]\n [?dp9dsZ2A8-Page :block/uid ?dp9dsZ2A8-Evidence-uid]\n [?Evidence :block/uid ?dp9dsZ2A8-Evidence-uid]\n [?dp9dsZ2A8-Context :block/refs ?dp9dsZ2A8-page3]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?dp9dsZ2A8-EVD-.*?-.*?$-regex]\n [(re-find ?dp9dsZ2A8-EVD-.*?-.*?$-regex ?dp9dsZ2A8-Page-Title)]\n )\n (and\n [?dp9dsZ2A8-ParentPage :block/uid "2yEG0_6MI"]\n [?dp9dsZ2A8-SPage :node/title "OpposedBy"]\n [?dp9dsZ2A8-ParentPage :block/uid ?dp9dsZ2A8-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?dp9dsZ2A8-2yEG0_6MI-uid]\n [?dp9dsZ2A8-SBlock :block/refs ?dp9dsZ2A8-SPage]\n [?dp9dsZ2A8-SBlock :block/children ?dp9dsZ2A8-Block]\n [?dp9dsZ2A8-Block :block/refs ?dp9dsZ2A8-Page]\n [?dp9dsZ2A8-Page :node/title ?dp9dsZ2A8-Page-Title]\n [?dp9dsZ2A8-Page :block/uid ?dp9dsZ2A8-Evidence-uid]\n [?Evidence :block/uid ?dp9dsZ2A8-Evidence-uid]\n [?dp9dsZ2A8-PBlock :block/refs ?dp9dsZ2A8-ParentPage]\n [?dp9dsZ2A8-PBlock :block/children ?dp9dsZ2A8-SBlock]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?dp9dsZ2A8-EVD-.*?-.*?$-regex]\n [(re-find ?dp9dsZ2A8-EVD-.*?-.*?$-regex ?dp9dsZ2A8-Page-Title)]\n )\n (and\n [?dp9dsZ2A8-Block14 :block/uid "2yEG0_6MI"]\n [?dp9dsZ2A8-Block19 :node/title "consistentWith"]\n [?dp9dsZ2A8-Block14 :block/uid ?dp9dsZ2A8-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?dp9dsZ2A8-2yEG0_6MI-uid]\n [?dp9dsZ2A8-Block24 :block/refs ?dp9dsZ2A8-Block19]\n [?dp9dsZ2A8-Block17 :block/children ?dp9dsZ2A8-Block24]\n [?dp9dsZ2A8-Block24 :block/refs ?dp9dsZ2A8-Block14]\n [?dp9dsZ2A8-Block17 :block/refs ?dp9dsZ2A8-Block16]\n [?dp9dsZ2A8-Block16 :node/title ?dp9dsZ2A8-Block16-Title]\n [?dp9dsZ2A8-Block16 :block/uid ?dp9dsZ2A8-Evidence-uid]\n [?Evidence :block/uid ?dp9dsZ2A8-Evidence-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?dp9dsZ2A8-EVD-.*?-.*?$-regex]\n [(re-find ?dp9dsZ2A8-EVD-.*?-.*?$-regex ?dp9dsZ2A8-Block16-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Evidence [:block/string :node/title :block/uid])\n (pull ?Evidence [:block/uid])\n:where\n (or-join [?vBuUeTwkn-EVD-.*?-.*?$-regex ?vBuUeTwkn-Evidence-uid ?Evidence ?vBuUeTwkn-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?vBuUeTwkn-Page2 :block/uid "2yEG0_6MI"]\n [?vBuUeTwkn-page3 :node/title "SupportedBy"]\n [?vBuUeTwkn-Page2 :block/uid ?vBuUeTwkn-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?vBuUeTwkn-2yEG0_6MI-uid]\n [?vBuUeTwkn-Block3 :block/refs ?vBuUeTwkn-Page2]\n [?vBuUeTwkn-Context :block/children ?vBuUeTwkn-Block3]\n [?vBuUeTwkn-Context :block/children ?vBuUeTwkn-Block2]\n [?vBuUeTwkn-Block2 :block/refs ?vBuUeTwkn-Page]\n [?vBuUeTwkn-Page :node/title ?vBuUeTwkn-Page-Title]\n [?vBuUeTwkn-Page :block/uid ?vBuUeTwkn-Evidence-uid]\n [?Evidence :block/uid ?vBuUeTwkn-Evidence-uid]\n [?vBuUeTwkn-Context :block/refs ?vBuUeTwkn-page3]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?vBuUeTwkn-EVD-.*?-.*?$-regex]\n [(re-find ?vBuUeTwkn-EVD-.*?-.*?$-regex ?vBuUeTwkn-Page-Title)]\n )\n (and\n [?vBuUeTwkn-ParentPage :block/uid "2yEG0_6MI"]\n [?vBuUeTwkn-SPage :node/title "OpposedBy"]\n [?vBuUeTwkn-ParentPage :block/uid ?vBuUeTwkn-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?vBuUeTwkn-2yEG0_6MI-uid]\n [?vBuUeTwkn-SBlock :block/refs ?vBuUeTwkn-SPage]\n [?vBuUeTwkn-SBlock :block/children ?vBuUeTwkn-Block]\n [?vBuUeTwkn-Block :block/refs ?vBuUeTwkn-Page]\n [?vBuUeTwkn-Page :node/title ?vBuUeTwkn-Page-Title]\n [?vBuUeTwkn-Page :block/uid ?vBuUeTwkn-Evidence-uid]\n [?Evidence :block/uid ?vBuUeTwkn-Evidence-uid]\n [?vBuUeTwkn-PBlock :block/refs ?vBuUeTwkn-ParentPage]\n [?vBuUeTwkn-PBlock :block/children ?vBuUeTwkn-SBlock]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?vBuUeTwkn-EVD-.*?-.*?$-regex]\n [(re-find ?vBuUeTwkn-EVD-.*?-.*?$-regex ?vBuUeTwkn-Page-Title)]\n )\n (and\n [?vBuUeTwkn-Block14 :block/uid "2yEG0_6MI"]\n [?vBuUeTwkn-Block19 :node/title "consistentWith"]\n [?vBuUeTwkn-Block14 :block/uid ?vBuUeTwkn-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?vBuUeTwkn-2yEG0_6MI-uid]\n [?vBuUeTwkn-Block24 :block/refs ?vBuUeTwkn-Block19]\n [?vBuUeTwkn-Block17 :block/children ?vBuUeTwkn-Block24]\n [?vBuUeTwkn-Block24 :block/refs ?vBuUeTwkn-Block14]\n [?vBuUeTwkn-Block17 :block/refs ?vBuUeTwkn-Block16]\n [?vBuUeTwkn-Block16 :node/title ?vBuUeTwkn-Block16-Title]\n [?vBuUeTwkn-Block16 :block/uid ?vBuUeTwkn-Evidence-uid]\n [?Evidence :block/uid ?vBuUeTwkn-Evidence-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[EVD\\\\\\\\]\\\\\\\\] - (.*?) - (.*?)$") ?vBuUeTwkn-EVD-.*?-.*?$-regex]\n [(re-find ?vBuUeTwkn-EVD-.*?-.*?$-regex ?vBuUeTwkn-Block16-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Theory [:block/string :node/title :block/uid])\n (pull ?Theory [:block/uid])\n:where\n (or-join [?C8tvGUCmQ-SrcPage ?C8tvGUCmQ-DstPage ?C8tvGUCmQ-DstPage-Title ?C8tvGUCmQ-THE-.*?$-regex ?C8tvGUCmQ-Theory-uid ?Theory ?C8tvGUCmQ-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?C8tvGUCmQ-SrcPage :block/uid "2yEG0_6MI"]\n [?C8tvGUCmQ-SrcPage :block/uid ?C8tvGUCmQ-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?C8tvGUCmQ-2yEG0_6MI-uid]\n [?C8tvGUCmQ-Context :block/refs ?C8tvGUCmQ-SrcPage]\n [?C8tvGUCmQ-Context :block/page ?C8tvGUCmQ-DstPage]\n [?C8tvGUCmQ-DstPage :node/title ?C8tvGUCmQ-DstPage-Title]\n [?C8tvGUCmQ-DstPage :block/uid ?C8tvGUCmQ-Theory-uid]\n [?Theory :block/uid ?C8tvGUCmQ-Theory-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[THE\\\\\\\\]\\\\\\\\] - (.*?)$") ?C8tvGUCmQ-THE-.*?$-regex]\n [(re-find ?C8tvGUCmQ-THE-.*?$-regex ?C8tvGUCmQ-DstPage-Title)]\n )\n (and\n [?C8tvGUCmQ-SrcPage :block/uid "2yEG0_6MI"]\n [?C8tvGUCmQ-LinkPage :node/title "Informs"]\n [?C8tvGUCmQ-SrcPage :block/uid ?C8tvGUCmQ-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?C8tvGUCmQ-2yEG0_6MI-uid]\n [?C8tvGUCmQ-SrcBlock :block/refs ?C8tvGUCmQ-SrcPage]\n [?C8tvGUCmQ-SrcBlock :block/refs ?C8tvGUCmQ-LinkPage]\n [?C8tvGUCmQ-SrcBlock :block/parents ?C8tvGUCmQ-DstBlock]\n [?C8tvGUCmQ-DstBlock :block/refs ?C8tvGUCmQ-DstPage]\n [?C8tvGUCmQ-DstPage :node/title ?C8tvGUCmQ-DstPage-Title]\n [?C8tvGUCmQ-DstPage :block/uid ?C8tvGUCmQ-Theory-uid]\n [?Theory :block/uid ?C8tvGUCmQ-Theory-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[THE\\\\\\\\]\\\\\\\\] - (.*?)$") ?C8tvGUCmQ-THE-.*?$-regex]\n [(re-find ?C8tvGUCmQ-THE-.*?$-regex ?C8tvGUCmQ-DstPage-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Theory [:block/string :node/title :block/uid])\n (pull ?Theory [:block/uid])\n:where\n (or-join [?QAPh6BK2J-SrcPage ?QAPh6BK2J-DstPage ?QAPh6BK2J-DstPage-Title ?QAPh6BK2J-THE-.*?$-regex ?QAPh6BK2J-Theory-uid ?Theory ?QAPh6BK2J-2yEG0_6MI-uid ?2yEG0_6MI]\n (and\n [?QAPh6BK2J-SrcPage :block/uid "2yEG0_6MI"]\n [?QAPh6BK2J-SrcPage :block/uid ?QAPh6BK2J-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?QAPh6BK2J-2yEG0_6MI-uid]\n [?QAPh6BK2J-Context :block/refs ?QAPh6BK2J-SrcPage]\n [?QAPh6BK2J-Context :block/page ?QAPh6BK2J-DstPage]\n [?QAPh6BK2J-DstPage :node/title ?QAPh6BK2J-DstPage-Title]\n [?QAPh6BK2J-DstPage :block/uid ?QAPh6BK2J-Theory-uid]\n [?Theory :block/uid ?QAPh6BK2J-Theory-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[THE\\\\\\\\]\\\\\\\\] - (.*?)$") ?QAPh6BK2J-THE-.*?$-regex]\n [(re-find ?QAPh6BK2J-THE-.*?$-regex ?QAPh6BK2J-DstPage-Title)]\n )\n (and\n [?QAPh6BK2J-SrcPage :block/uid "2yEG0_6MI"]\n [?QAPh6BK2J-LinkPage :node/title "Informs"]\n [?QAPh6BK2J-SrcPage :block/uid ?QAPh6BK2J-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?QAPh6BK2J-2yEG0_6MI-uid]\n [?QAPh6BK2J-SrcBlock :block/refs ?QAPh6BK2J-SrcPage]\n [?QAPh6BK2J-SrcBlock :block/refs ?QAPh6BK2J-LinkPage]\n [?QAPh6BK2J-SrcBlock :block/parents ?QAPh6BK2J-DstBlock]\n [?QAPh6BK2J-DstBlock :block/refs ?QAPh6BK2J-DstPage]\n [?QAPh6BK2J-DstPage :node/title ?QAPh6BK2J-DstPage-Title]\n [?QAPh6BK2J-DstPage :block/uid ?QAPh6BK2J-Theory-uid]\n [?Theory :block/uid ?QAPh6BK2J-Theory-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[THE\\\\\\\\]\\\\\\\\] - (.*?)$") ?QAPh6BK2J-THE-.*?$-regex]\n [(re-find ?QAPh6BK2J-THE-.*?$-regex ?QAPh6BK2J-DstPage-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Pattern [:block/string :node/title :block/uid])\n (pull ?Pattern [:block/uid])\n:where\n (or-join [?ynzrtjX0R-SrcPage ?ynzrtjX0R-DstPage ?ynzrtjX0R-DstPage-Title ?ynzrtjX0R-PTN-.*?$-regex ?ynzrtjX0R-Pattern-uid ?Pattern ?ynzrtjX0R-2yEG0_6MI-uid ?2yEG0_6MI ?ynzrtjX0R-SrcBlock]\n (and\n [?ynzrtjX0R-SrcPage :block/uid "2yEG0_6MI"]\n [?ynzrtjX0R-SrcPage :block/uid ?ynzrtjX0R-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?ynzrtjX0R-2yEG0_6MI-uid]\n [?ynzrtjX0R-SrcBlock :block/refs ?ynzrtjX0R-SrcPage]\n [?ynzrtjX0R-SrcBlock :block/page ?ynzrtjX0R-DstPage]\n [?ynzrtjX0R-DstPage :node/title ?ynzrtjX0R-DstPage-Title]\n [?ynzrtjX0R-DstPage :block/uid ?ynzrtjX0R-Pattern-uid]\n [?Pattern :block/uid ?ynzrtjX0R-Pattern-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[PTN\\\\\\\\]\\\\\\\\] - (.*?)$") ?ynzrtjX0R-PTN-.*?$-regex]\n [(re-find ?ynzrtjX0R-PTN-.*?$-regex ?ynzrtjX0R-DstPage-Title)]\n )\n (and\n [?ynzrtjX0R-SrcPage :block/uid "2yEG0_6MI"]\n [?ynzrtjX0R-LinkPage :node/title "Informs"]\n [?ynzrtjX0R-SrcPage :block/uid ?ynzrtjX0R-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?ynzrtjX0R-2yEG0_6MI-uid]\n [?ynzrtjX0R-SrcBlock :block/refs ?ynzrtjX0R-SrcPage]\n [?ynzrtjX0R-SrcBlock :block/refs ?ynzrtjX0R-LinkPage]\n [?ynzrtjX0R-SrcBlock :block/parents ?ynzrtjX0R-DstBlock]\n [?ynzrtjX0R-DstBlock :block/refs ?ynzrtjX0R-DstPage]\n [?ynzrtjX0R-DstPage :node/title ?ynzrtjX0R-DstPage-Title]\n [?ynzrtjX0R-DstPage :block/uid ?ynzrtjX0R-Pattern-uid]\n [?Pattern :block/uid ?ynzrtjX0R-Pattern-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[PTN\\\\\\\\]\\\\\\\\] - (.*?)$") ?ynzrtjX0R-PTN-.*?$-regex]\n [(re-find ?ynzrtjX0R-PTN-.*?$-regex ?ynzrtjX0R-DstPage-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Pattern [:block/string :node/title :block/uid])\n (pull ?Pattern [:block/uid])\n:where\n (or-join [?CyVCUmKob-SrcPage ?CyVCUmKob-DstPage ?CyVCUmKob-DstPage-Title ?CyVCUmKob-PTN-.*?$-regex ?CyVCUmKob-Pattern-uid ?Pattern ?CyVCUmKob-2yEG0_6MI-uid ?2yEG0_6MI ?CyVCUmKob-SrcBlock]\n (and\n [?CyVCUmKob-SrcPage :block/uid "2yEG0_6MI"]\n [?CyVCUmKob-SrcPage :block/uid ?CyVCUmKob-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?CyVCUmKob-2yEG0_6MI-uid]\n [?CyVCUmKob-SrcBlock :block/refs ?CyVCUmKob-SrcPage]\n [?CyVCUmKob-SrcBlock :block/page ?CyVCUmKob-DstPage]\n [?CyVCUmKob-DstPage :node/title ?CyVCUmKob-DstPage-Title]\n [?CyVCUmKob-DstPage :block/uid ?CyVCUmKob-Pattern-uid]\n [?Pattern :block/uid ?CyVCUmKob-Pattern-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[PTN\\\\\\\\]\\\\\\\\] - (.*?)$") ?CyVCUmKob-PTN-.*?$-regex]\n [(re-find ?CyVCUmKob-PTN-.*?$-regex ?CyVCUmKob-DstPage-Title)]\n )\n (and\n [?CyVCUmKob-SrcPage :block/uid "2yEG0_6MI"]\n [?CyVCUmKob-LinkPage :node/title "Informs"]\n [?CyVCUmKob-SrcPage :block/uid ?CyVCUmKob-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?CyVCUmKob-2yEG0_6MI-uid]\n [?CyVCUmKob-SrcBlock :block/refs ?CyVCUmKob-SrcPage]\n [?CyVCUmKob-SrcBlock :block/refs ?CyVCUmKob-LinkPage]\n [?CyVCUmKob-SrcBlock :block/parents ?CyVCUmKob-DstBlock]\n [?CyVCUmKob-DstBlock :block/refs ?CyVCUmKob-DstPage]\n [?CyVCUmKob-DstPage :node/title ?CyVCUmKob-DstPage-Title]\n [?CyVCUmKob-DstPage :block/uid ?CyVCUmKob-Pattern-uid]\n [?Pattern :block/uid ?CyVCUmKob-Pattern-uid]\n [(re-pattern "^\\\\\\\\[\\\\\\\\[PTN\\\\\\\\]\\\\\\\\] - (.*?)$") ?CyVCUmKob-PTN-.*?$-regex]\n [(re-find ?CyVCUmKob-PTN-.*?$-regex ?CyVCUmKob-DstPage-Title)]\n ))\n]', + }, + { + query: + '[:find\n (pull ?Source [:block/string :node/title :block/uid])\n (pull ?Source [:block/uid])\n:where\n [?pBaJ_1ymC-Page2 :block/uid "2yEG0_6MI"]\n [?pBaJ_1ymC-Page2 :block/uid ?pBaJ_1ymC-2yEG0_6MI-uid]\n [?2yEG0_6MI :block/uid ?pBaJ_1ymC-2yEG0_6MI-uid]\n [?pBaJ_1ymC-Page2 :block/refs ?pBaJ_1ymC-Page]\n [?pBaJ_1ymC-Page :node/title ?pBaJ_1ymC-Page-Title]\n [?pBaJ_1ymC-Page :block/uid ?pBaJ_1ymC-Source-uid]\n [?Source :block/uid ?pBaJ_1ymC-Source-uid]\n [(re-pattern "^@(.*?)$") ?pBaJ_1ymC-.*?$-regex]\n [(re-find ?pBaJ_1ymC-.*?$-regex ?pBaJ_1ymC-Page-Title)]\n]', + }, +];