-
Couldn't load subscription status.
- Fork 7
Feb 7th - Working on Neo4j JS Driver #1118
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
Conversation
addNode( params )This function takes in params, which are of the form <see src/neo4j/graph-data.js>. If it does not yet exist (according to the grounding id, which is: "database name" + ":" + "database id"), create one "Gene" node with the specified parameters. If it does exist already, do nothing Possible edit: instead of doing nothing if it already exists, add the factoidId/UUID to the node in the factoidId field (since we can have node properties that are arrays) |
addEdge( params )This function takes in params, which are of the form <see src/neo4j/graph-data.js>. If it does not yet exist (according to the grounding id which is currently the UUID of that specific interaction [NOT the document UUID]), create one edge with the specified parameters. If it does exist already, do nothing (highly unlikely this will happen if the grounding id is a UUID) |
|
Nice start. Let’s say I’m a person who is using the functions that you’re creating. How would I know what the |
For a node, that would be (in the form of an object with these name-value pairs):
For a relationship/edge, that would be (again in the form of an object):
Ideally all the fields will be given to us via the Document API and the user won't have to do anything to actually create the node/edge themselves (we'll get all the info from the Biofactoid forms they fill out and make it automatically. I think this is what we said in a meeting ~2 weeks ago? I could be wrong though), but right now I just have all these parameters hard-coded. Let me know what you guys think! @jvwong @maxkfranz |
| { | ||
| id1: 'ncbigene:5597', id2: 'ncbigene:207', id3: '01ef22cc-2a8e-46d4-9060-6bf1c273869b', | ||
| type: 'phosphorylation', doi: '10.1126/sciadv.abi6439', pmid: '34767444', | ||
| documentId: 'a896d611-affe-4b45-a5e1-9bc560ffceab', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beware DOI and PMID are not guaranteed to exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, in those cases Neo4j would be fine receiving 'null' or an empty string (I haven't figured out what the Document API does in those cases yet, but we can work around it).
It would complicate the use case of when the user wants to search for a pathway (rather than a gene) unless people search by title, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still useful to store, but you'll have to be careful of null cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that articleTitle could also be null.
| // MAPK6 data | ||
| { | ||
| id: 'ncbigene:5597', factoidId: '598f8bef-f858-4dd0-b1c6-5168a8ae5349', name: 'MAPK6', | ||
| type: 'protein', dbId: '5597', dbName: 'NCBI Gene' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbId is redundant I suppose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with dbName? I can get rid of both of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbName should be the normalised namespace, like ncbi, if we store it at all. We could remove dbId and dbName completely if we're confident we're not going to do queries on dbName, e.g. give me all proteins that are grounded to ncbi rather than uniprot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
OK, so
Node notes:
And
Edge notes:
General notes:
|
|
In short, I'd suggest for now:
|
For nodes, I don't think this is a problem with type |
This is another example of something that, if needed, may be better placed in interaction data (e.g. Let's ignore node You could make the same argument for an edge's
Then we'd have:
|

Ran "npm install --save neo4j-driver" hence the changes to package-lock.json and package.json
Added code to starting-neo4j.js but it doesn't seem to be doing anything as of yet
DO NOT MERGE YET, code does not actually do anything