How to import or sync data to Neo4? - postgresql

I have a REST API around a PostgreSQL database, the API was built using the Django REST Framework (python). I have access to the PostgreSQL database and the API, but I'm not allowed to modify the django/python code.
My first approach is to make, kind of, an HTTP POST request via a trigger every time a new record is created in PostgreSQL. I found this but seems like it's not the best way to do what I need.
In the Neo4j side, I'm thinking of a periodic HTTP GET request to the API from within a cypher function, but does not exist such thing.

You should use the APOC procedures for integrating with other DBs via JDBC. PostgreSQL is supported.
You can also use APOC procedures like apoc.periodic.schedule or apoc.periodic.countdown to periodically execute a Cypher query in the background.

Related

Is there any tool to generate sample/mock graph data for Apache AGE?

I have used "Mockaroo" to generate mock table data (in SQL format) for my postgreSQL projects. But now I am experimenting with Apache AGE (a graph database). I wanted to know if there is any website like mockaroo which let you generate mock graph data (in OpenCypher query format).
I didn't know whether this actually answers your question or not but you can try using Neo4j or Neo4j sandbox. Neo4j Sandbox is a web-based platform that allows you to create and experiment with Neo4j graph databases. It comes with several pre-built datasets that you can use to explore different graph use cases. Additionally, you can create your custom datasets using the built-in data generator, which supports generating data in OpenCypher query format.
Here is the GitHub repository. you can also download a desktop application using this link.
There are some tools for generating mock table data for Cypher query language, but they are not like Mockaroo in the sense of just accessing the website and freely creating different kinds of data easily. With these options, you might need to use python or make a new account on a website.
Neo4j Sandbox: Neo4j is a popular graph database management system that supports the Cypher query language. Neo4j provides a free sandbox environment where you can experiment with graph databases and use mock data to test your Cypher queries. https://neo4j.com/sandbox/
Graphgen: Graphgen is an open-source tool that can be used to generate random graph data. It allows you to define a schema and generate data that conforms to that schema using the Cypher query language. https://github.com/idea-iitd/graphgen

Is it possible to use Appery to access data from Neo4J Graph Database?

I have a web application that has to be linked with a graph database (Neo4J). Is it possible to read or write data to Neo4J using Appery?
I have chosen Appery because I am a beginner when it comes to databases and Appery seems to be easy in using REST API, as well as there is a free trial.
Feedback would be highly helpful. Thanks in advance.
Edit: I am aware that Neo4J uses Cypher queries. I would like to know if Appery supports Cypher as well.
Side note: The reason I am asking the question here without trying it out is because I dont have an active DB and my application is private due to my company's security policy
You can do that as long as Neo4J database has a REST API. If it does, then you can make calls to it from an Appery app (from Server Code or API Express). Hope this helps.

Postgresql in Node-red

I use node-red to create an Api from a server. I want to read and send data via http. I use the browser-based programming method. I want to send data from a postgresql database. I installed the package node-red-contrib-postgres-multi. I donĀ“t know how to put data into the database and how to read data from the database, because I cannot find examples.
Does anybody knows, how I can do that?
You can use postgrestor postgrestor package where you can define query or data modification statement directly in node window. It also allows parametrized queries via template engine.
The problem I've encountered is working with more than one db instance in the same flow but if you need only one db instance connection it should work for you.

Query Azure database using API

I host my database on Azure. I would like to search data on the table in that database. I am trying to use B4I and the tech help their said I need to use REST API's. I am pretty sure I need to use ODATA. I have the auth token but I am not sure if this is even possible.
In order to query Azure SQL with an API you need to add a layer between it and the destination. As mentioned in this question, OData is a specification that can be implemented fairly easily as there are plenty of libraries that will take care of the bulk of the code for you.
As far as where to host the API, you have several options within Azure. The most common being App Services, Azure Functions, and Logic Apps.

Neo4j commit callback over REST API?

I came across https://github.com/neo4j/neo4j/blob/master/community/kernel/src/main/java/org/neo4j/graphdb/event/TransactionData.java which allows to capture data that was changed within the course of a transaction.
My application uses two data stores, postgresql and Neo4j. To revert to a consistent state upon crash/failure, I am hoping to maintain data from this event which could be useful to reconcile data between databases.
However, we are using the neo4j server REST api, and this event is available to using neo4j in embedded mode. Is it possible to get a response similar to 'created_nodes' and 'created_relationships' over rest batch commits?
The TransactionData instances are only exposed to a TransactionEventHandler. That is a component to be written in Java (or other JVM language) you can register with your graph database, either in embedded mode or when running as server. TransactionEventHandler are typically used to implement cross cutting concerns.
Access to TransactionData is not available using the REST API.