Tag: neo4j

无法使用C#客户端反序列化datetime属性Neo4j

我正在尝试使用C#客户端从Neo4j中获取强类型对象。 这一切都有效,直到我添加DateTime属性。 我已成功将数据插入Neo4j数据库,我可以使用控制台查看它。 我也可以查询数据,但我不能返回任何强类型对象,因为反序列化似乎失败了。 我正在使用参数来插入数据: _graphClient.Cypher .WithParams(new { id = node.Id, createdAt = node.CreatedAt, lastModified = node.LastModified }) .Create(“(c { ” + “Id: {id}, ” + “CreatedAt: {createdAt}, ” + “LastModified: {lastModified} } )”) 我获取数据的查询非常基本: nodes = _graphClient.Cypher .Match(“(n)”) .Return((n) => n.As()).Results.ToList(); 但后来我收到一个错误…… 日志文件说明以下内容: 参数名称:content —> Newtonsoft.Json.JsonReaderException:无法将字符串转换为DateTime:17-9-2015 21:57:14 +00:00。 路径’a’,第1行,第32位。 数据看起来像这样(从日志中输入): “data” : { “Id” […]

如何在Neo4j v2中使用Neo4jClient创建节点?

在Neo4j v1.9.x下,我使用了以下类型的代码。 private Category CreateNodeCategory(Category cat) { var node = client.Create(cat, new IRelationshipAllowingParticipantNode[0], new[] { new IndexEntry(NeoConst.IDX_Category) { { NeoConst.PRP_Name, cat.Name }, { NeoConst.PRP_Guid, cat.Nguid.ToString() } } }); cat.Nid = node.Id; client.Update(node, cat); return cat; } 原因是节点ID是自动生成的,我可以稍后使用它来快速查找,在其他查询中启动位等。如下所示: private Node CategoryGet(long nodeId) { return client.Get((NodeReference)nodeId); } 这使得以下看起来效果很好。 public Category CategoryAdd(Category cat) { cat = CategoryFind(cat); if […]

使用Neo4j中的索引

我一直在浏览Neo4J和Neo4J C#客户端.. neo4jclient wiki帮助我完成了节点crud操作..然而wiki突然终止了..我在源代码中 探索了测试方法并设法了解关系并在线搜索以了解索引是如何工作的。 到目前为止,这是我所拥有的,大致: //create indexing on user and car client.CreateIndex(“User”, new IndexConfiguration() { Provider = IndexProvider.lucene, Type = IndexType.fulltext }, IndexFor.Node); client.CreateIndex(“Car”, new IndexConfiguration() { Provider = IndexProvider.lucene, Type = IndexType.fulltext }, IndexFor.Node); //create user client.Create(new User() { Name = “Dovakiin”, Job = “Dragon Slayer” }); client.Create(new User() { Name = “Ulfric […]

如何在c#中创建嵌入式Neo4j数据库

如何在c#中创建嵌入式Neo4j数据库? 我想在这个嵌入式数据库上执行查询以进行测试,然后将其丢弃。 目前我正在使用neo4jclient对我的系统上运行的数据库(localhost)执行查询,但希望在嵌入式数据库上执行此操作。 我该怎么做? 此function在Java中以下列方式存在: GraphDatabaseFactory graphDbFactory = new GraphDatabaseFactory(); GraphDatabaseService graphDb = graphDbFactory .newEmbeddedDatabase(“data/dbName”); 在c#中查找这些行中的内容。

Neo4J 3.1.3图形数据库远程访问

我是Neo4J 3.0图形数据库的新手。我对neo4j有一些问题。 默认情况下,它适用于localhost,工作正常http:// localhost:7474 / browser / 。 现在我想允许访问每个人。我在远程服务器上安装neo4j,我尝试在选项“dbms.connector.http.listen_address = {MyIpAddress}:7474”中更改服务器配置但不起作用。 #*************************************************************** # Server configuration # # #{settings-reference.url} dbms.directories.import=import # Require (or disable the requirement of) auth to access Neo4j dbms.security.auth_enabled=true # With default configuration Neo4j only accepts local connections. # To accept non-local connections, uncomment this line: #dbms.connectors.default_listen_address=0.0.0.0 # You can also choose a […]

铸造未知类型的节点

在使用Neo4j时,我能够创建带有标签的节点数组,然后在这些节点之间创建关系。 标签基本上是我的POCO的映射(Dog标签与C#中的Dog POCO有关),这些POCO是从一个只包含ID属性的简单基础POCO实现的。 当我知道要检索的节点的类型/标签时,我能够使用node.As 语法在return语句中转换它。 但是,当执行诸如遍历节点之间的路径之类的操作时,我将不知道我正在遍历的节点的类型。 虽然技术上可以将节点作为我的POCO实现的基类型进行转换,但是我会丢失特定于超类的所有属性。 关于如何开始使用这个的任何想法?