Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Support custom syntax for Neo4j OGM #172

Closed
fbiville opened this issue Feb 28, 2017 · 2 comments
Closed

Support custom syntax for Neo4j OGM #172

fbiville opened this issue Feb 28, 2017 · 2 comments

Comments

@fbiville
Copy link
Collaborator

fbiville commented Feb 28, 2017

Neo4j OGM and Spring Data Neo4j lets developers think in terms of their business domain rather than nodes and relationships.

The idea would be to provide a custom XML schema that allows to express migrations in terms of entities, rather than raw Cypher queries.

For instance, we could imagine something like:

<changelog [...]>
   <changeset [...]>
      <insert entity="com.foo.Movie">
          <property name="title">Matrix</property>
      </insert>
      <remove entity="com.foo.Actor">
          <where>
             <property name="firstName">Ronald</property>
          </where>
      </insert>
   </changeset>
</changelog>

This is just a rough idea of what it could be like.
In the long term, we need to think about:

  • creating relationship entities as well (maybe have a <insertNode> and <insertRelationship><from /><to />
  • supporting comparisons other than strict equality (>, >=, <, <=, ...)?
  • making it work alongside usual XML changesets (we should be able to mix both)
@fbiville
Copy link
Collaborator Author

And that custom schema... should much probably be GraphML!
I received an email the other day complaining about something related:

Hi,
The support package [of nosqlunit-neo4j] is removed from Spring Data Neo4j 4 so IndexingNodeTypeRepresentationStrategy is not present there due to which following graph is not being converted to POJO.

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
 http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
	<graph id="G" edgedefault="directed">
		<key id="__type__" for="node" attr.name="__type__" attr.type="string"></key>
		<key id="productId" for="node" attr.name="productId" attr.type="string"></key>

		<node id="3">
			<data key="__type__">com.etilize.burraq.datasource.Product</data>
			<data key="productId">100001235</data>
			<index name="__types__" key="className">com.etilize.burraq.datasource.Product
			</index>
		</node>
	</graph>
</graphml>

Can you please let me know any alternative as it's a blocker in using nosqlunit-neo4j with Spring data neo4j 4. Thank you.

Even though the email is about nosqlunit-neo4j, the XML above is a good example of something Liquigraph for Neo4j OGM should support.

@fbiville fbiville changed the title Implement a custom XML schema for Neo4j OGM Support custom syntax for Neo4j OGM Dec 29, 2017
@fbiville
Copy link
Collaborator Author

After a discussion some time ago, let's stick to the basic schema we have.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant