Skip to Content
Technical Articles

Advantco Neo4j adapter for SAP PO

Overview

Neo4j is a graph database designed to treat the relationships between data as equally important to the data itself. Neo4j natively supports relationships is able to store, process, and query connections efficiently. While other databases compute relationships at query time through expensive JOIN operations, a graph database stores connections alongside the data in the model.

Cypher is Neo4j’s graph query language that allows users to store and retrieve data from the graph database. Neo4j wanted to make querying graph data easy to learn, understand, and use for everyone, but also incorporate the power and functionality of other standard data access languages.

The Advantco Neo4j adapter makes integration easy with the Neo4j graph database and supports following operations Create, Update, Delete, Merge and Query. The adapter supports Cypher’s syntax to query the graph database.

Source: https://neo4j.com/

Example of Neo4j sender channel using Cypher query.

MATCH (t:Tournament {year: 2019})<-[:PARTICIPATED_IN]-(team) WITH team, [(team)-[:PARTICIPATED_IN]->(other) WHERE other.year < 2019 | other] AS otherTournaments RETURN team.name, size(otherTournaments) AS tournaments

Neo4j receiver channel supports following operations: Create, Update, Delete, Merge, Query

Mapping of XML payload to CREATE an order with multiple lineitems.

<?xml version="1.0" encoding="UTF-8"?>
<multiRequest>
	<request>
		<operation>Create</operation>
		<node>
			<ID>orderID</ID>
			<properties>
				<orderID>12008</orderID>
				<customerID>match (c:Customer {customerID: &quot;WHITC&quot;}) return c.customerID</customerID>
				<shipName>match (c:Customer {customerID: &quot;WHITC&quot;}) return c.companyName</shipName>
				<orderDate>2020-02-17 00:00:00.000</orderDate>
			</properties>
			<LABEL>Order</LABEL>
		</node>
		<edge>
			<START_ID>match (c:Customer {customerID: &quot;WHITC&quot;}) return c</START_ID>
			<END_ID>12008</END_ID>
			<TYPE>PURCHASED</TYPE>
			<properties/>
		</edge>
		<edge>
			<START_ID>12008</START_ID>
			<END_ID>match (p:Product) where p.productID in [&quot;11&quot;] return p</END_ID>
			<TYPE>ORDERS</TYPE>
			<properties>
				<orderID>12008</orderID>
				<quantity>1</quantity>
				<unitPrice>20</unitPrice>
				<productID>11</productID>
			</properties>
		</edge>
	</request>
</multiRequest>

 

We will provide more detailed steps in follow-up blogs.

 

Sources:

https://neo4j.com/

https://advantco.com/products/sap-pi-po-adapters

Be the first to leave a comment
You must be Logged on to comment or reply to a post.