Custom function in Neo4j to match datetime string

Hi,

I'm new to Neo4j. I'm currently running a AI project related to Knowledge Graph. In my KG, there are some temporary nodes represented as string (which I extract from text), now I want to query triplets given question from user. The problem is I cannot compare date string and because there are a lot of complicated cases, I need to write a function to return True if the date string of that node "relevant" to the date string in the question of user. Here an example: Q: What happen on April, 2020?. Then in my KG, there are nodes "1st April, 2020" , "on 9th April, 2020", "April, 2020". "at the beginning of April,2020"... and some relations between these nodes with others. I need to extract all of this subgraph. And my cypher query is something like: match (a)-(r)->(b) where is_match(b, given_date_string)=true return a, type(r), b

And does neo4j support custom user function by python?. Is there any tutorial guides how to create custom function?

Thank you.

Custom functions are built using the neo4j Java api.

Custom functions and procedures are deployed by copying a jar to the server’s plugin folder.

I have a simple project you can use as a starting point. It’s a maven project.

I would be willing to write the code if you give me the algorithm, assuming it is fairly straight forward.

I have writer a suite of custom procedures to support my project.

1 Like

That's very nice of you. Can you share your project with me? I need to integrate a simple test to see how it works with my project first.

Sure. You have an email I can send it to?

1 Like

Here is my email: ldngoc2607@gmail.com

I sent you two projects as examples.

Hi, could you please check it again? I haven't received it even in spam box. Thank you

sorry, please check again?

I haven't received anything. Maybe there's a confused character "l" in ldngoc... its a lowercase of L. :(

I had copied the email address you sent and pasted in the "to" field.

I just send a blank test email that did not have the attachments to see if you get it. Maybe something is happening on your end with the zip attachments, as my mailbox shows it was sent.

I can change the extensions from ".zip" to ".txt" in case that is the issue.

I did not see anything! Oh god. Can you try with this email: dinhngoc123@gmail.com . And in this attempt, maybe you should leave some text, just in case.
Sorry for this inconvenient.

I just sent to the new address....No worries about the issue.

Did you use gmail also? I neither received it. Should I use another platform like Microsoft? skyonhand_ckj2607@outlook.com is my email.

Not Gmail. A custom domain. Let me try your latest email

Can you share a Dropbox folder or some other web folder I can copy them to?

Hey, one of the email received your message. please check your email. Thank you so much

1 Like

I tried again. I also sent you links to a shared Dropbox files.