berrybeat / neo4j.berries.ogm Goto Github PK
View Code? Open in Web Editor NEWThis repository adds an OGM functionality for csharp
Home Page: https://berrybeat.com/
License: MIT License
This repository adds an OGM functionality for csharp
Home Page: https://berrybeat.com/
License: MIT License
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.
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.
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
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.
Is your feature request related to a problem? Please describe.
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.
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.
The following changes has to get documented:
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.
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.
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
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.
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:
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;
Is your feature request related to a problem? Please describe.
At the moment the eloquent doesn't support like
clauses, for full text search.
Describe the solution you'd like
We have to let the developers to configure this:
https://neo4j.com/docs/cypher-manual/current/indexes/semantic-indexes/full-text-indexes/
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.
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.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.