Skip to content
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

Import from Roam Research #865

Closed
6 of 7 tasks
raineorshine opened this issue Sep 14, 2020 · 4 comments · Fixed by #888
Closed
6 of 7 tasks

Import from Roam Research #865

raineorshine opened this issue Sep 14, 2020 · 4 comments · Fixed by #888
Assignees
Labels
feature New feature or request

Comments

@raineorshine
Copy link
Contributor

raineorshine commented Sep 14, 2020

Part I

  • Import thoughts from Roam's JSON format (see below)
  • Convert to Blocks JSON format then use importJSON

Part II

  • Save create-time as created property
  • Save edit-time as lastUpdated property
  • Save create-email as =create-email subthought
  • Save edit-email as =edit-email subthought

Part III

  • Autodetect Roam JSON in importText

JSON:

[
{
    "title": "September 4th, 2020",
    "children": [
    {
        "string": "A",
        "create-email": "[email protected]",
        "create-time": 1600111381583,
        "children": [
        {
            "string": "B",
            "create-email": "[email protected]",
            "create-time": 1600111383054,
            "children": [
            {
                "string": "C",
                "create-email": "[email protected]",
                "create-time": 1600111383911,
                "uid": "HMN_YQtZZ",
                "edit-time": 1600111385719,
                "edit-email": "[email protected]"
            }],
            "uid": "JBXKlMcxh",
            "edit-time": 1600111383918,
            "edit-email": "[email protected]"
        }],
        "uid": "0VQBPmUiy",
        "edit-time": 1600111383064,
        "edit-email": "[email protected]"
    }],
    "edit-time": 1599270696877,
    "edit-email": "[email protected]"
},
{
    "title": "September 5th, 2020",
    "children": [
    {
        "string": "X",
        "create-email": "[email protected]",
        "create-time": 1600111456859,
        "children": [
        {
            "string": "Y",
            "create-email": "[email protected]",
            "create-time": 1600111457621,
            "children": [
            {
                "string": "[[September 4th, 2020]]",
                "create-email": "[email protected]",
                "create-time": 1600111458385,
                "uid": "Wt5NR3b56",
                "edit-time": 1600111478479,
                "edit-email": "[email protected]"
            }],
            "uid": "obXRTMWqJ",
            "edit-time": 1600111458396,
            "edit-email": "[email protected]"
        }],
        "uid": "Pu444IoIi",
        "edit-time": 1600111457625,
        "edit-email": "[email protected]"
    }],
    "edit-time": 1599290307051,
    "edit-email": "[email protected]"
}

Thought structure:

  • September 4th, 2020
    • A
      • B
        • C
  • September 5th, 2020
    • X
      • Y
        • [[September 4th, 2020]]
@raineorshine raineorshine added the feature New feature or request label Sep 14, 2020
@anmolarora1 anmolarora1 self-assigned this Oct 29, 2020
@anmolarora1
Copy link
Contributor

@raineorshine I'm not quite sure about this part

  • Save create-email as =create-email subthought
  • Save edit-email as =edit-email subthought

Can you please look at the example below, and confirm if this is what we're expecting?

JSON -

const testData = [
  {
    title: 'Fruits',
    children: [
      {
        string: 'Apple',
        'create-email': '[email protected]',
        'create-time': 1600111381583,
        'edit-time': 1600111381580,
        uid: 'UK11200',
      },
      {
        string: 'Orange',
        'create-email': '[email protected]',
        'create-time': 1600111383054,
        'edit-time': 1600111383050,
        uid: 'UK11233',
      }
    ],
  },
  {
    title: 'Veggies',
    children: [
      {
        string: 'Broccoli',
        'create-email': '[email protected]',
        'create-time': 1600111381600,
        'edit-time': 1600111381599,
        uid: 'BK11200',
      },
      {
        string: 'Spinach',
        'create-email': '[email protected]',
        'create-time': 1600111389054,
        'edit-time': 1600111389050,
        uid: 'BK11233',
      }
    ],
  }
]

Thought Structure

  • Fruits
    • Apple
      • =create-email
    • Orange
      • =create-email
  • Veggies
    • Broccoli
      • =create-email
    • Spinach
      • =create-email

@raineorshine
Copy link
Contributor Author

Thought Structure

@anmolarora1
Copy link
Contributor

@raineorshine
I'm currently working on Autodetect Roam JSON in importText and came across this library that seems pretty useful for validating object schema/structure. Though the code for the Roam validation is pretty straightforward, this library could be potentially valuable for other use cases as well.
What are your thoughts?

@raineorshine
Copy link
Contributor Author

Looks cool, but too heavy for our current needs. If we end up having more validation requirements we can refactor and pull it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants