Skip to content

Instantly share code, notes, and snippets.

@jdrain
Last active April 12, 2018 13:51
Show Gist options
  • Save jdrain/e9db3f1338a6677ce9f64d9843c23320 to your computer and use it in GitHub Desktop.
Save jdrain/e9db3f1338a6677ce9f64d9843c23320 to your computer and use it in GitHub Desktop.
Newly proposed data model for neo4j to return

Note: For some reason, neo4j may return ids as objects with values { low: <int>, high: <int> }. The pertinent value is stored in the low attribute.

{
    title: <string>,
    isbn: [<string>],
    date: <int>,
    id: <int>,
    authors: [
        {
            name: <string>,
            id: <int>
        },
        ...
    ],
    publishers: [
        {
            name: <string>,
            id: <int>
        },
        ...
    ],
    places: [
        {
            name: <string>,
            id: <int>
        },
        ...
    ],
    relationships: {
        wrote: [
            [ <origin_id>, <terminal_id> ],
            ...
        ],
        published: [
            [ <origin_id>, <terminal_id> ],
            ...
        ],
        publishes_in: [
            [ <origin_id>, <terminal_id> ],
            ...
        ]
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment