mtranter / cyphernet Goto Github PK
View Code? Open in Web Editor NEWA .Net API for the Neo4j HTTP Transactional Endpoint
License: Microsoft Public License
A .Net API for the Neo4j HTTP Transactional Endpoint
License: Microsoft Public License
A feature to get hold of the last query that the querybilder (CypherEndPoint) have created. For simpler debuging.
(Nice library BTW. :))
Hi.
I think i've found something wrong in cyphernet. here is the scenario:
I have a person class like this:
public class Person
{
private int age;
private string famil;
private string name;
public String Name
{
get { return name; }
set { name = value; }
}
public String Famil
{
get { return famil; }
set { famil = value; }
}
public int Age
{
get { return age; }
set { age = value; }
}
}
If i want to create a node like the code below, every thing is OK.
neo4JClient = Fluently.Configure("http://localhost:7474/db/data/").CreateSessionFactory().Create();
person = new Person()
{
Name = "hooman",
Famil = "rouhani",
Age = 31,
};
neo4JClient.CreateNode(person, "Person");
But
If i only don't set Age property like the code below i will give an error.
neo4JClient = Fluently.Configure("http://localhost:7474/db/data/").CreateSessionFactory().Create();
person = new Person()
{
Name = "hooman",
Famil = "rouhani"
};
neo4JClient.CreateNode(person, "Person");
Debug Trace:
Info: Executing: {"statements":[{"statement":"CREATE (NewNode:Person {"Name":"hooman","Famil":"rouhani","Age":0}) RETURN NewNode as NewNode, id(NewNode) as NewNode__Id, labels(NewNode) as NewNode__Labels;","parameters":{}}]}
Info: Response: {"results":[],"errors":[{"code":"Neo.ClientError.Statement.InvalidSyntax","message":"Invalid input '"': expected whitespace, an identifier, '}' or UnsignedInteger (line 1, column 25)\n"CREATE (NewNode:Person {"Name":"hooman","Famil":"rouhani","Age":0}) RETURN NewNode as NewNode, id(NewNode) as NewNode__Id, labels(NewNode) as NewNode__Labels;"\n ^"}]}
Test method Neo4jCypherNetPractice.Neo4jCypherNetTest.TestDelete threw exception:
Newtonsoft.Json.JsonReaderException: Error reading string. Unexpected token: StartObject. Path 'errors[0]', line 1, position 25.
at Newtonsoft.Json.JsonReader.ReadAsStringInternal()
at Newtonsoft.Json.JsonTextReader.ReadAsString()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader)
at CypherNet.Serialization.DefaultJsonSerializer.Deserialize(String json)
at CypherNet.Transaction.NonTransactionalCypherClient.ExecuteQuery(String cypherQuery)
at CypherNet.Transaction.CypherSession.CreateNode(Object properties, String label)
at Neo4jCypherNetPractice.Neo4jCypherNetTest.TestDelete()
From Neo4J docs:
Create a full path
When you use CREATE and a pattern, all parts of the pattern that are not already in scope at this time will be created.
Query
CREATE p =(andres { name:'Andres' })-[:WORKS_AT]->(neo)<-[:WORKS_AT]-(michael { name:'Michael' })
RETURN p
This query creates three nodes and two relationships in one go, assigns it to a path identifier, and returns it.
http://neo4j.com/docs/milestone/query-create.html#create-create-a-full-path
It's possible with CypherNet this query?
Where do we check that the Neo server is available and running at the supplied URL??
Probably my noobness but this query should return only nodes labeled "Movie" right? It actually return all nodes in the database.
var nodes = cypherEndpoint
.BeginQuery(p => new {Movie = p.Node})
.Match(ctx => ctx.Node(ctx.Vars.Movie))
.Return(ctx => new {Movie = ctx.Vars.Movie})
.Fetch();
The code generates:
MATCH (Movie) RETURN Movie as Movie, id(Movie) as Movie__Id, labels(Movie) as Movie__Labels
But should generate:
MATCH (Movie:Movie) RETURN Movie as Movie, id(Movie) as Movie__Id, labels(Movie) as Movie__Labels
Am I missing something here in my code? :)
Should we provide entity tracking? Probably not difficult.. Entity Cache in the Session object and some INotifyPropertyChanged type hoo haa in GraphEntity???
help me with .where clause, please. i try something like "match a,b where NOT a-->b return b", but couldn't found how i can do this in cyphernet
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.