circles-arrows / blueprint41 Goto Github PK
View Code? Open in Web Editor NEWAn Object Graph Mapper for CSharp to connect to Neo4j or Memgraph.
Home Page: http://www.blueprint41.com/
License: MIT License
An Object Graph Mapper for CSharp to connect to Neo4j or Memgraph.
Home Page: http://www.blueprint41.com/
License: MIT License
Hi,
I used PersistenceProvider(v4) advancedConfig parameter customLogger property to enable logging but still the information about the transaction and database connection details are not getting logged. Is there a way to enable logging if we use blueprint41? if somethings goes wrong we need the logs to investigate the issue
var config = new AdvancedConfig() { SimpleLogging = false, CustomLogging= s => logger.Error(s) }; PersistenceProvider.CurrentPersistenceProvider = new Neo4jPersistenceProvider( settings.GraphDatabase.ConnectionString, settings.GraphDatabase.UserName, settings.GraphDatabase.Password, advancedConfig: config);
Reaching out to the rockstars of Neo4j, for your wisdom, and expertise!
When I generate the model based on my dto's, it is generating all my FunctionalId
s based on 'Invoice' instead of the underlying type name.
Using nuget version 1.0.18.
Thx!
Please let us know how to put unique constraints for multiple properties.
I can't see any option other than Add property in Data store to add uniqueness, which holds true for only single property.
For example, in our data structure we have Areas related to our business model which contain many ZipCodes and then each ZIpCode is associated with a City which is associated with a State. I would like to be able to take in a single Area Uid and then return a list of ZipCodes, the City Name it's in, and the state abbreviation.
What I'm looking for it to do something like this:
var zipQuery = Transaction.CompiledQuery.Match(Node.ZipCode.Alias(out var zipCode)
.In.ZIPCODE_LOCATED_IN_CITY.Out.City.Alias(out var city).In.CITY_LOCATED_IN_STATE.Out.State.Alias(out var state))
.Match(Node.ContractorServiceArea.Alias(out var serviceArea).Out.INCLUDES_ZIP.In.ZipCode.Alias(out zipCode))
.Where(serviceArea.Uid == Parameter.New<string>("serviceAreaUid"))
.Return(zipCode.Zip, state.Abbr, city.Name)
.Compile();
Which generates the exact cypher I'd like to be able to run, but cannot figure out a way to run this query which might return the correct anonymous data types. I only see the
.LoadWhere()
queries on the created OGM objects.
I also honestly cannot tell the benfits of putting in multiple values in the .Return
method either. It always seems like the return values are going to be attempted to be parsed into whatever static method you're running the .LoadWhere from.
Am I missing something or is this just a limitation of blueprint41?
When you initialize your provider with:
PersistenceProvider.CurrentPersistenceProvider =
new Neo4JPersistenceProvider(XXX, XXX, XXX , withLogging: true);
The log file never gets created or written to. In Logger.cs this line:
m_LogDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory ?? @"C:\", "TransactionLogs");
needs to be
LogDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory ?? @"C:\", "TransactionLogs");
So the setter get called successfully and the LogFile property gets set.
Hi,
Do you have any plan to release the new package with supports Neo4J V5, the current plugin is breaking in V5.
Thanks
When the program runs to transaction.commit (); throwing wrong:Due to an unexpected state of the neo4j transaction, it seems impossible to insert the Person at this time.
When trying to tap into events for Relationships I am unable to trigger them.
Relations["MY_RELATIONSHIP"].Events.OnRelationCreate += Events_OnRelationCreated;
Will never trigger. When I look at the source code I cannot see anything calling the "RaiseOnRelationCreate" event or any of the other ones. Is this intentional? Is there a way to get around this in the current version of blueprint41?
I'm not sure what exactly the reproduction steps are; it looks like the Neo4j persistence manager blows up trying to read an empty collection (LINQ First
instead of handling a null w/ FirstOrDefault
)
Relevant code: https://gist.github.com/robotgryphon/a8c9a873b8aba5eac917a4198424724d
Database set up:
webadmin
user for management
Hello !
I'm actually creating a node entity in the blueprint datastore, this way :
I want to create a unique constraint on the ID key field, but the SetKey prevent such creation. By removing the setkey, the constraint is successfully created.
When the server is started, the database should contain a constraint when using the SetKey on a unique constrained property.
I am getting an error trying to work through your Getting Started tutorial. All is well until I try to execute the "Run Custom Tool" command. I have attached a doc with screen shots and error text in hopes this will help diagnose my issue.
Ed
Hi, I just tried to Blueprint41 to generate source code.
I first installed the extension and generated a new project.
Everything looks correct except that "Generate.tt" file is missing from the generated project.
Do you know what's going on?
I'm on VS 2022 Community.
Thanks.
Is it possible that there was a breaking change with the last update?
My Generated project stopped compiling today... there were no changes to the model. I noticed it when I tried to build the solution. I also noticed that there was an update to the NuGet package on Feb 20
The error is: CS1503 Argument 1: cannot convert from Blueprint41.Property to Blueprint41.EntityProperty.
Additionally, there are errors saying that Node.EventAction is obsolete.
Finally, there are errors that "EventAction" does not contain a definition for Uid and no accessible extension method 'Uid' accepting a first argument of time 'EventAction' could be found
Both BluePrint41 and Neo4j Driver packages are on the latest version 1.1.0.
Hi,
I am using mac, when i try to run the tt file from VS for Mac it erorring. Is there any way to use this functinality in mac?
I am using the free version of Neo4J and am trying to run through the Getting Started.
When I call model.Execute(true)
I'm getting the following error:
DatabaseException: Unable to create Constraint( type='NODE PROPERTY EXISTENCE', schema=(:Person {Uid}) ):
Property existence constraint requires Neo4j Enterprise Edition
Is there a way to disabled the Enterprise features like Node Property Existence constraints?
Since T4 is not available on all platforms, the code generation should run as part of the build process using inline tasks.
Advantages:
In theory can run on all platforms
No manual triggering of T4 generation needed
Disadvantages:
Potentially slow during build, we should try to hash and see if code generation is really needed.
Can I blueprint41 a neo4j Aura?
missing modeller xml for adventure works
fixed in ce9bf8b
Hello !
I'm actually creating a node entity in the blueprint datastore, this way :
I'm creating 3 unique indexed property, but, when I start the server for the first time, there are no indexes created for those properties. By reading the memgraph documentation, it doesn't works the same way as neo4j (which creates automatically the index on a unique constraint)
To corroborate what the documentation is saying, I ran a Read Query integration test with 66.000 nodes in the database. With the constraint without index, the test takes 30ms. With the constraint and the manually created index, the test takes 6ms.
When the server is started, the database should contain an index for each of my unique constraint
Looking at this library to assess it's viability for a neo4j orm. I'm having some difficulty doing the movies example from the wiki. I find in my program.cs when I run Model.Execute(true);
I get the error Due to an unexpected state of the neo4j transaction, it seems impossible to insert the Genre at this time
I traced this down to Blueprint41.Neo4j.Persistence.Void.Neo4jNodePersistenceProvider.Insert:171; there is a check to see if the result of a transaction is empty; but it appears that the Blueprint41.Neo4j.Persistence.Void.Neo4jTransaction.Run function doesn't actually do anything other than construct an empty Neo4jRawResult object which would always result an in empty result. Am I doing something wrong here?
Hi ,
I am trying to connect to database, when i try to connect with the below code with database parameter it errors. Can you help me to fix it as there was not documentation with this parameter. i used DatabaseName as "test".
I am using neo4j v4.4.15 and blueprint41 v1.0.21, Blueprint41.Neo4jDriver.v4 v1.0.21 and blueprint41-4.0.2.jar file
// using v4
using Blueprint41.Neo4j.Persistence.Driver.v4;
PersistenceProvider.CurrentPersistenceProvider = new Neo4jPersistenceProvider(
settings.GraphDatabase.ConnectionString,
settings.GraphDatabase.UserName, settings.GraphDatabase.Password,
settings.GraphDatabase.DatabaseName);
var model = new Datastore();
model.Execute(true);
I am getting the below exception:
System.AggregateException: One or more errors occurred. (Invalid input ':': expected <init> (line 1, column 1 (offset: 0))
":use test"
^)
---> Neo4j.Driver.ClientException: Invalid input ':': expected <init> (line 1, column 1 (offset: 0))
":use test"
^
at Neo4j.Driver.Internal.MessageHandling.ResponsePipelineError.EnsureThrownIf(Func`2 predicate)
at Neo4j.Driver.Internal.MessageHandling.ResponsePipelineError.EnsureThrown()
at Neo4j.Driver.Internal.Result.ResultCursorBuilder.ConsumeAsync()
at Neo4j.Driver.Internal.AsyncTransaction.DiscardUnconsumed()
at Neo4j.Driver.Internal.AsyncTransaction.RollbackAsync()
at Neo4j.Driver.Internal.AsyncTransaction.RollbackAsync()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Blueprint41.Core.AsyncHelper.WaitEx[T](T task, Boolean recursive)
at Blueprint41.Core.CustomTask.Wait(Boolean recursive)
at Blueprint41.Core.CustomTaskScheduler.RunBlocking(Func`1 work, String description)
at Blueprint41.Neo4j.Persistence.Driver.v4.Neo4jTransaction.RollbackInternal()
at Blueprint41.Transaction.Rollback()
at Blueprint41.Transaction.Cleanup()
at Blueprint41.Core.DisposableScope`1.Dispose()
at Blueprint41.Neo4j.Persistence.Driver.v4.Neo4jPersistenceProvider.get_Driver()
at Blueprint41.Neo4j.Persistence.Driver.v4.Neo4jTransaction.Initialize()
at Blueprint41.Core.DisposableScope`1.Attach()
at Blueprint41.Transaction.Begin(Boolean readWriteMode, OptimizeFor mode)
at Blueprint41.Transaction.Begin(Boolean readWriteMode)
at Blueprint41.DatastoreModel.Execute(Boolean upgradeDatastore, MethodInfo unitTestScript, Predicate`1 predicate, Boolean standAloneScript)
at Blueprint41.DatastoreModel.Execute(Boolean upgradeDatastore, MethodInfo unitTestScript)
at Blueprint41.DatastoreModel.Execute(Boolean upgradeDatastore)
There doesn't appear to be a way to define properties on a relationship. In the movie example there is a property called 'roles' on the relationship between an actor and a movie.
On your wiki it looks like the 'roles' property has become a new node type instead of a property on the relationship itself. Is there a way to have properties on relationships? Defining an extra node to hold properties on a relationship seems like it could become inefficient by adding an extra step in path traversal.
I've been working on a local database using neo4j 3.5.5 and blueprint41 for a few weeks now and decided to spin up an instance for hosting in AWS using the newer version of 4.0.4. Spent a little while trying to get it configured and eventually found that none of the procedures in the blueprint41 jar file are being loaded. I run the following query to see all the procedures and can see all the apoc ones fine but none of the blueprint41 ones:
CALL dbms.procedures() YIELD name
RETURN head(split(name,".")) as package, count(*), collect(name) as procedures;
To test to make sure it is a difference between the versions I went and ran this query against my local graph while running 3.5.5, I did see the blueprint41 procedures in the list, then I upgraded my local version, confirmed the settings are still in place and the plugin is still available, but am still not seeing any of the blueprint41 procedures.
Is the current plugin not available with newer versions of Neo4j?
I am planning to use your library and was checking your code. I am trying to use in web api environment , how do you make your transaction thread safe with shared static Transaction class? Please do let me know so that I can use your library without any worry
Can you please tell me the reason for the lack of an asynchronous API for writing and reading, or simply did not have time to implement it?
p.s. only recently started looking towards graph databases and Neo4j in particular and did not find anything more convenient than your project
Hello !
I was setting up a github action for my dotnet project using blueprint41 and, while trying to run I encountered a problem with the Blueprint41.Build.Json.
Unhandled exception. System.IO.FileNotFoundException: Target folder '/home/runner/work/Astreis/Astreis/packages/back/Entities/Entities.Model/..\Entities.Generated' does not exist. Make sure to have a Blueprint41.Build.json with 'generatePath' set in the model project folder.
at Blueprint41.Build.Generator.ValidatePaths(String modelPath, String generatePath)
at Blueprint41.Build.Generator.Main(String[] args)
Aborted (core dumped)
To fit it, I had to modify the generatePath field from "..\Entities.Generated" -> "..//Entities.Generated". Doing so doesn't cause any problems on windows, where I'm developing.
Currently it deletes all existing files and then rebuilds the ones that are needed.
To reduce TFS spending time to scan for changes between locally updated files and the TFS server:
Some issues emerged due to backward compatibility with earlier Neo4j version.
Issue: The dotnet "decimal" type is currently stored as a fixed-point "long" in Neo4j.
Solution: Add a feature to switch the behavior so decimals can optionally get stored as floating point numbers
Issue: The dotnet "DateTime" type is currently stored as a epoch "long" in Neo4j.
Solution: Add a feature to switch the behavior so DateTime can optionally get stored as "Neo4j DateTime" numbers
Issue: The dotnet "TimeSpan" type is currently unsupported.
Issue: The dotnet "Point" type is currently unsupported.
Issue: How could we change the default (for DateTime for example) without causing trouble for existing databases?
So far most of the functionality I've needed from an ORM seems to be available in blueprint41 but there are times when certain methods aren't available (or not easily found in the documentation).
Off the top of my head I can't figure out ways to do UNWINDs or
WHERE NOT in a relationship ex:
MATCH (p:person) WHERE NOT (p)-[:executes]-(:transaction) RETURN p
We've been able to manage by finding alternative ways to approach these problems but there are some times when just writing some neo4j would be easier. Is there a way to access the bolt driver itself for times when I have to do this? Are there any plans for updates that allow stored procedures to be added into the datastore?
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.