Giter VIP home page Giter VIP logo

neo4j.berries.ogm's People

Contributors

berrybeat avatar farhadnowzari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kaivnit

neo4j.berries.ogm's Issues

Define ILogger integration

Is your feature request related to a problem? Please describe.
At the moment the library, doesn't log any information. It is needed to know for example, if the connection is successful, log the query being sent to the database if the option is enabled and so on. This should be fined how we do the logging and which log levels. Also it should be documented how they can configure with ILogger to disable the logging or change the logging level for this specific library.

Add WithoutRelation

Is your feature request related to a problem? Please describe.
At the moment on querying, we can query a node which must have a relation, but sometimes we want to get a node when it does not have a specific relation.

Describe the solution you'd like
Add WithoutRelation method.

Query relations with hops

Is your feature request related to a problem? Please describe.
In neo4j it is possible to hop from one node to another through an edge (relation) multiple times and current we only support one hop. Querying a path including hops needs to be considered in the library

Nodes with DateTime cannot be deserialized

Describe the bug
It is possible to save a node with DateTime data type in it as properties but on reading the same node from neo4j, it throws an exception that it cannot deserialize the DateTime.

To Reproduce
Just create a node which has a DateTime property in it. Then try to query that node. It will throw an exception.

Expected behavior
No exception should be thrown and the datetime value must be deserialized correctly.

Add ConnectAndMerge

Is your feature request related to a problem? Please describe.
At the moment, when connecting to a target node, if the node doesn't exist, nothing will happen, but sometimes just like on creation we may need to create a shadow node on an update.

Describe the solution you'd like
Add a new method which merges the target node and takes the prop maps based on the merge config.

Return different parts of a path

Is your feature request related to a problem? Please describe.
On querying a path it is possible in neo4j to return specific objects of this path or project them into new objects. This should be supported and defined how can be done by the library

Describe the solution you'd like
Since in csharp, Select method is mostly known for projection, a Select must be implemented on returning a path so we can have more data to be returned than just the first matched node.

Documentation

The following changes has to get documented:

  • Merge and MergeRange methods
  • Identifiers in fluent configuration
  • EnforceIdentifiers config
  • GraphContext.Anonymous, no longer gets the NodeConfigurationBuilder directly.
  • It is possible now to build the NodeConfigurations with the assemblies too
  • The release note must mention that the cyphers are better optimized now

Execute the known functions inside the WhereClause expression

Is your feature request related to a problem? Please describe.
At the moment, if on comparison, it is needed to do Where(x => x.Name.ToLower(), "john"), the library will not recognize the expression because of the .ToLower. It should be possible to translate specific csharp functions to neo4j functions on translating to cypher.

Common classes as groups

Is your feature request related to a problem? Please describe.
In neo4j it is possible to have multiple labels on a node. This feature can be used to group different nodes with a label. For example we can group a Person node with Actor and Director label, but the grouping is not always this easy. Consider a case that the group needs it's own properties and it simply in C# object gonna have a members list. Since we are in C# we cannot accumulate this list with different object types. All those object types should extend a common class. On mapping the data back, we have to map the extensions to their parent class.

Describe the solution you'd like
The solution is to be defined with the design, when the task is picked. This task doesn't seem to be complicated, but should have in mind not to put the libraries logic inside the node classes.

Modify nodes without C# types

Is your feature request related to a problem? Please describe.
It is not at the moment possible to create a node in neo4j without having a C# object type and there are cases in which it is needed to create a generic node without explicitly knowing the type.

Describe the solution you'd like
The library should expose the create and match methods which it uses at the end after translating the objects to nodes

Additional context
Some refactorings are needed

Plugin interface

Is your feature request related to a problem? Please describe.
It should be possible to add a middleware to the library and perform different actions from outside. For example another library can add a plugin which gets triggered when the mutations is being done against the database, to for example auto inject a new node, create a new node and so on. Another plugin may integrate telemetry to the system. These concepts should not be implemented directly in the library, but the library should expose an API to let other libraries to control some data flow.

Add merge to the NodeSet

Is your feature request related to a problem? Please describe.
at the moment on creating a new node, only the target nodes are having a merge, but the root node and the relations must also have a merge to implement upsert.

Describe the solution you'd like
To implement this, it is important to have:

  • A merge method directly under the NodeSet, which merges everything, from relations to target nodes
  • Also these merges need an identifier. The identifier must be passed through the fluent configuration and there won't be any automatic detection like ef-core

Session and AsyncSession should be accessible by developers

Is your feature request related to a problem? Please describe.
At the moment, in case a project needs to execute a cypher query against the database, it needs to create a session from the public driver and it is easy to mistake and directly run a command using the driver and run the cypher against the default database. It should be possible to access the sessions with readonly access.

Describe the solution you'd like
expose the DatabaseContext.Session and DatabseContext.AsyncSession with private set;

The config should be built manually too, beside the assemblies

Is your feature request related to a problem? Please describe.
Currently, the AddNeo4j method accepts a list of assemblies to search for INodeConfiguration implementations and compute their configs and store them in the Neo4jSingletonContext. This method should be optional and it should be possible to pass the configurations manually.

Optimize the creation

Is your feature request related to a problem? Please describe.
At the moment on creation, a new CREATE statement is added per item. For large data this leads to an issue with neo4j, where the query will either takes too long or neo4j throws Not enough stack size exception.

Describe the solution you'd like
The solution would be to optimize the Create string builder with UNWIND command, to push the objects as an input and do the loop inside neo4j.

Add new config for enforcing Identifier validation

Is your feature request related to a problem? Please describe.
At the moment, the MERGE ignores an empty list of identifiers and this may lead to duplication.

Describe the solution you'd like
In Neo4jSingletonContext a new option is needed to enforce the identifiers, so it will be up to the developer to have identifiers or not. This change, will affect the DependencyInjection method.

the INodeConfiguraion should not be mandatory

Describe the bug
At the moment, if a service needs to create shadow nodes, it must specify INodeConfiguration, otherwise an exception will be thrown.

To Reproduce
Create a node type and try putting it as a connection under a domain node. If there is config for the target node, an exception is thrown that the " is not presented in dictionary"

Expected behavior
It is expected that if the config is not available use all properties for mapping.

Neo4j relation properties object map

Is your feature request related to a problem? Please describe.

At the moment, the OGM library creates a relation between two nodes with just knowing about the relation's label. In Neo4j it is possible to define properties on relations and query with those properties

Describe the solution you'd like
We need to define perhaps in the NodeConfig, how does the relation look like. Which interface it needs to implement as the relation, or which relation implementation it should take. This option better be optional, since not all relations will need to have properties.

The challenge to solve here is, when we define a properties class/interface on a relation, how do we integrate it in creation or queries? How will the design and class diagram looks like. We should have in mind to keep the node classes as lean as possible and don't include any of the library logic inside them, this way the developers can change their tech easier when they need to and the node classes are reusable easier.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.