Skip to content

Commit f9a30b4

Browse files
Update lib to run with feat/db branch and ensure file graph still runs
1 parent 0cb0063 commit f9a30b4

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

nbb.edn

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{org.babashka/cli {:mvn/version "0.6.46"}
33
logseq/graph-parser
44
{:git/url "https://github.com/logseq/logseq"
5-
:git/sha "82cf4d3c65acbf230a3170640fe271dd74095067"
6-
:git/tag "0.9.8"
5+
:git/sha "eed5c8bce43d5235dd1936e72d60fae2b0cd03bb"
76
:deps/root "deps/graph-parser"}
87
#_{:local/root "../logseq/deps/graph-parser"}}}

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"url": "https://github.com/logseq/rdf-export/issues"
1717
},
1818
"homepage": "https://github.com/logseq/rdf-export#readme",
19+
"devDependencies": {
20+
"@logseq/nbb-logseq": "logseq/nbb-logseq#feat-db-v16"
21+
},
1922
"dependencies": {
20-
"@logseq/nbb-logseq": "^1.2.168",
2123
"mldoc": "^1.5.0",
2224
"n3": "^1.16.3",
2325
"turtle-validator": "^1.1.1"

src/logseq/rdf_export.cljs

+12-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All of the above pages can be customized with query config options."
1010
[clojure.edn :as edn]
1111
[clojure.set :as set]
1212
[datascript.core :as d]
13-
[logseq.db.rules :as rules]
13+
[logseq.db.frontend.rules :as rules]
1414
[babashka.cli :as cli]
1515
[logseq.graph-parser.cli :as gp-cli]
1616
[logseq.rdf-export.config :as config]
@@ -23,18 +23,18 @@ All of the above pages can be customized with query config options."
2323
(map
2424
(fn [block]
2525
(let [block-name (or (get-in block [:block/properties :title])
26-
(:block/original-name block)
26+
(:block/title block)
2727
;; Use page name for non-journal pre-blocks
2828
(when-not (get-in block [:block/page :block/journal?])
29-
(get-in block [:block/page :block/original-name])))]
29+
(get-in block [:block/page :block/title])))]
3030
(cond->
3131
(-> (:block/properties block)
3232
;; TODO: Add proper tags support
3333
(dissoc :title :tags)
3434
((fn [x] (apply dissoc x exclude-properties)))
3535
expand-entity-fn)
3636
(some? block-name)
37-
(assoc :block/original-name block-name))))
37+
(assoc :block/title block-name))))
3838
result))
3939

4040
(defn- page-url [page-name config]
@@ -49,8 +49,8 @@ All of the above pages can be customized with query config options."
4949
[m
5050
{:keys [url-property type-property classes-without-ids unique-id-properties] :as config}
5151
property-map]
52-
(if-let [subject (if (:block/original-name m)
53-
(page-url (:block/original-name m) config)
52+
(if-let [subject (if (:block/title m)
53+
(page-url (:block/title m) config)
5454
(some #(when-let [v (m %)]
5555
(if (url? v) v (page-url v config)))
5656
unique-id-properties))]
@@ -75,7 +75,7 @@ All of the above pages can be customized with query config options."
7575
(defn- block->label-triple [block]
7676
[(:url block)
7777
"http://www.w3.org/2000/01/rdf-schema#label"
78-
(:block/original-name block)])
78+
(:block/title block)])
7979

8080
(defn- build-alias-triples
8181
[ents config]
@@ -84,7 +84,7 @@ All of the above pages can be customized with query config options."
8484
(mapcat #(map (fn [alias]
8585
(block->label-triple
8686
{:url (page-url alias config)
87-
:block/original-name (:block/original-name %)}))
87+
:block/title (:block/title %)}))
8888
(:alias %)))))
8989

9090
(defn- add-class-instances [db config property-map {:keys [add-labels]}]
@@ -115,7 +115,7 @@ All of the above pages can be customized with query config options."
115115
(vals rules/query-dsl-rules))
116116
(map first)
117117
(create-entities config))
118-
built-in-properties {:block/original-name
118+
built-in-properties {:block/title
119119
{:url (if add-labels
120120
"http://www.w3.org/2000/01/rdf-schema#label"
121121
"https://schema.org/name")}
@@ -124,7 +124,7 @@ All of the above pages can be customized with query config options."
124124
"http://www.w3.org/2002/07/owl#sameAs"
125125
"https://schema.org/sameAs")}}
126126
property-map (into built-in-properties
127-
(map (juxt (comp keyword :block/original-name) identity)
127+
(map (juxt (comp keyword :block/title) identity)
128128
properties))]
129129
(set
130130
(concat
@@ -134,8 +134,8 @@ All of the above pages can be customized with query config options."
134134
(when add-labels
135135
(map (fn [[k v]]
136136
(block->label-triple
137-
{:url (:url v) :block/original-name (name k)}))
138-
(dissoc built-in-properties :block/original-name)))))))
137+
{:url (:url v) :block/title (name k)}))
138+
(dissoc built-in-properties :block/title)))))))
139139

140140
(defn- add-quads [writer quads]
141141
(doseq [[q1 q2 q3]

src/logseq/rdf_export/config.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
:in $ %
5151
:where
5252
(page-property ?b :type "Class")
53-
[?b :block/original-name ?n]
53+
[?b :block/title ?n]
5454
(page-property ?b2 :type ?n)]
5555
;; Query to fetch additional instances.
5656
;; Useful for instances that aren't fetched by :class-instances-query

test/fixtures/docs-with-labels.ttl

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ d:Rectangle <http://www.w3.org/2000/01/rdf-schema#label> "Whiteboard/Tool/Shape/
210210
d:Search a d:Feature;
211211
<http://www.w3.org/2000/01/rdf-schema#label> "Search";
212212
d:platforms <https://docs.logseq.com/#/page/All%20Platforms>.
213-
d:Settings a <https://docs.logseq.com/#/page/UI%20Element>;
214-
<http://www.w3.org/2000/01/rdf-schema#label> "Settings".
215213
d:Shape <http://www.w3.org/2000/01/rdf-schema#label> "Whiteboard/Tool/Shape".
216214
d:Shapes <http://www.w3.org/2000/01/rdf-schema#label> "Whiteboard/Tool/Shape".
217215
<https://docs.logseq.com/#/page/Snap%20to%20grid> a d:Feature;
@@ -436,6 +434,8 @@ d:sameAs a d:Property;
436434
<http://www.w3.org/2000/01/rdf-schema#label> "sameAs";
437435
d:rangeIncludes d:Uri;
438436
s:url <https://www.w3.org/2002/07/owl#sameAs>.
437+
d:settings a <https://docs.logseq.com/#/page/UI%20Element>;
438+
<http://www.w3.org/2000/01/rdf-schema#label> "settings".
439439
d:slide a d:Feature;
440440
<http://www.w3.org/2000/01/rdf-schema#label> "slide";
441441
<http://www.w3.org/2002/07/owl#sameAs> d:Presentation;

test/fixtures/docs.ttl

+2-2
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,6 @@ d:Query a d:Command;
249249
d:Search a d:Feature;
250250
d:platforms <https://docs.logseq.com/#/page/All%20Platforms>;
251251
s:name "Search".
252-
d:Settings a <https://docs.logseq.com/#/page/UI%20Element>;
253-
s:name "Settings".
254252
<https://docs.logseq.com/#/page/Snap%20to%20grid> a d:Feature;
255253
d:initial-version "0.9.10";
256254
d:platforms <https://docs.logseq.com/#/page/All%20Platforms>;
@@ -501,6 +499,8 @@ d:sameAs a d:Property;
501499
s:description "Indicates that two URIs are equivalent";
502500
s:name "sameAs";
503501
s:url <https://www.w3.org/2002/07/owl#sameAs>.
502+
d:settings a <https://docs.logseq.com/#/page/UI%20Element>;
503+
s:name "settings".
504504
d:slide a d:Feature;
505505
d:platforms <https://docs.logseq.com/#/page/All%20Platforms>;
506506
s:name "slide";

yarn.lock

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
# yarn lockfile v1
33

44

5-
"@logseq/nbb-logseq@^1.2.168":
6-
version "1.2.168"
7-
resolved "https://registry.yarnpkg.com/@logseq/nbb-logseq/-/nbb-logseq-1.2.168.tgz#e4120c4a7eb6c80737473292c1e20919b4453c91"
8-
integrity sha512-lgZuAhck/74+9mT4vr6jVLkPcyRA/RO8ApBizq3d1L6LsPlPjdRp4nIaC2I1/p/AaIIB5vP89pMpqZfVsIHHQg==
5+
"@logseq/nbb-logseq@logseq/nbb-logseq#feat-db-v16":
6+
version "1.2.173-feat-db-v16"
7+
resolved "https://codeload.github.com/logseq/nbb-logseq/tar.gz/5c52c2869da240283db96cd13366e45e532c5d29"
98
dependencies:
109
import-meta-resolve "^2.1.0"
1110

0 commit comments

Comments
 (0)