Neo4j.NET Client Executing Cypher String Queries

Is it possible to execute CYPHER queries as plain old strings using Neo4j.NET Client or any other module?

For example, if I want to add some nodes to my graph database and have already compiled the statements, is there a way to execute the line:

CREATE (n:Edit {name:"L-1154LX"});

I want the package to process the list of CREATE CYPHER requests that have already been created.

+4
source share
2 answers

Officially registered at https://github.com/Readify/Neo4jClient/wiki/cypher#manual-queries-highly-discouraged

However, it will be bad for performance and dangerous for security.

, . , , https://github.com/Readify/Neo4jClient/wiki/cypher-examples#create-a-user , , , .

, .

, , , , . .

+5

.NET-, Excel, neo4j (. / ).

neo4j neo4jclient, , ; , . https://github.com/Readify/Neo4jClient/wiki/cypher-examples , ; . ? ? ( , ).

 public class Node
        {
            public string NodeType = "";
            public List<Attribute> Attributes;
            public List<Relationship> ParentRelationships;
            public List<Relationship> ChildRelationships;
            public Node(string nodeType)
            {
                NodeType = nodeType;
                Attributes = new List<Attribute>();
                ParentRelationships = new List<Relationship>();
                ChildRelationships = new List<Relationship>();
            }

            public void AddAttribute(Attribute attribute)
            {
                //We are not allowing empty attributes
                if(attribute.GetValue() != "")
                    this.Attributes.Add(attribute);
            }

            public string GetIdentifier()
            {
                foreach (Attribute a in Attributes)
                {
                    if (a.IsIdentifier)
                        return a.GetValue();
                }
                return null;
            }

            public void AddParentRelationship(Relationship pr)
            {
                ParentRelationships.Add(pr);
            }

            public void AddChildRelationship(Relationship cr)
            {
                ChildRelationships.Add(cr);
            }

  public class Attribute
        {
            private string Name;
            private string Value;
            public bool IsIdentifier;

            public Attribute(string name, string value, bool isIdentifier)
            {
                SetName(name);
                SetValue(value);
                IsIdentifier = isIdentifier;
            }

            public void SetName(string name)
            {
                Name = name.Trim();
            }
            public void SetValue(string value)
            {
                Value = value.Trim();
            }
            public string GetName()
            {
                return Name;
            }
            public string GetValue()
            {
                return Value;
            }

        }
+1

All Articles