-
-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement "import JSON from Roam" #31
Comments
@tangjeff0 I did some exploratory work. I pretty printed the json dump and I did some analysis on the attributes https://gist.github.com/jeroenvandijk/6713bf0af4fe5bc82ebf4a261766537b#file-pretty_print_json_export-edn I think there is more information in the dump than you thought? For instance, in many cases there is a Might take some time to get this right. Maybe we can do a cross reference with your datom export to make sure we are not missing any data. |
Yeah, last I recall |
Making some progress with Meander (gist) It's not there yet, it's still missing some mapping, but slowly getting there. I think/hope it's a matter of understanding Meander better. The expected result is a self-explaining import script. I'm asking for help in the #meander slack channel |
Some more WIP and background here:
Transformation is more or less complete. Next step is getting it in the right shape to transact to Datascript |
@jeroenvandijk @tangjeff0 I have been thinking of this for a while & following along on discord, but I have a couple of ideas here:
Please lmk thoughts on this. I would like to contribute to this area :) |
@palashkaria I think
On the plus, this export seems to export data structures well like the There may be other export issues I'm not aware of. If we can find an interoperable example of each attribute described in Notion, I'm happy to use this method. I don't think Regarding your second point, I love worldbrain. How do we query and pull data from IndexedDB? If we can get it out in datom format, that'd be great! |
@tangjeff0 to get around that, we can use
this will give an array of such objects
Although I think it might be possible to do it in one query too; not quite sure how. (Just trying out a pull inside
|
Wow, great idea using pull syntax. This
Want to begin making the FYI the way to do it one query is:
But this again loses the namespace attributes 😢 but we can still use your JS How about |
@tangjeff0 is this all the data? The prev query was missing some stuff I think; could you test this one out?
|
@tangjeff0 IndexDb is pretty involved, & can look very weird with roam internals exposed an example of db data
|
Also, please test out the query with more kinds of things - I am unable to verify if everything in notion works properly with this - do we have a validator of any kind? Maybe just importing into athens? I'll also figure out the roam-toolkit part if this pans out. |
Please provide the JS necessary to access the IndexedDB data. We can compare What you showed me are not Roam internals. In fact, I believe it is datascript-transit. Athens uses the same thing but with localStorage right now: We can compare data from these two sources. If they are the same, then it is a perfect export. @palashkaria |
(But I’m pretty confident that |
@tangjeff0 ah yes, so that's all there is but no direct schema/datom exports. We can export these transaction dbs using
Note: This will download a lot of files - your browser will probably warn you
|
@tangjeff0 all considered, let's go ahead with You are sure there's no way to get namespaces with attributes in pull-expr? I tried searching for that, but I'm just a beginner at datascript; nothing in the datalog docs around this |
@palashkaria The datalog semantics are correct. The issue is that namespaced keywords are mostly a Clojure ( |
@palashkaria implemented lossless import in #288. Feel free to start on the roam-toolkit plugin! |
I would also understand if you didn't want to put this directly in roam-toolkit, so we could just make this a small script as you also suggested in #31 (comment). But you (and @Stvad) are the main contributors there so I'll let you decide. |
Trying to figure out the status of this feature - is the roam import supported atm? |
Not supported atm @sagarjauhari , waiting for performance improvements before importing this. Many people have large Roam dbs. |
I don't know if you saw, but there is now a "loseless edn export" in Roam. |
Yeah, that makes it even easier @Mayeu. Thanks! |
Hi I am wondering if this is currently being worked on. If not, how can I help? Thanks! |
* feat: readable table query * fix: clearer style for disabled taskbox * improvement: neater query table
Assigned to @jeroenvandijk
This issue covers importing only Roam's JSON export.
Requires generating
:block/uid
s for pages since Roam's export lacks them... 🤷♂️🧐Also, there are some properties in the JSON that may need to be omitted otherwise the datascript transaction throws an exception. Consider using
clojure.spec
,specter
, or something like that to ignore non-essential attributes for now.clojure.spec
can be used to determine the shape of the data: https://github.com/athensresearch/athens/blob/master/src/cljs/athens/db.cljs#L57-L63The text was updated successfully, but these errors were encountered: