public static Relationship GetRelationship(long relationshipId, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { if (relationshipStore == null) { relationshipStore = new RestRelationshipStore(); } if (connection == null) { connection = DefaultConnection; } return(relationshipStore.GetRelationship(connection, relationshipId)); }
public static Relationship AddToIndex(Relationship relationship, string indexName, string key, object value, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { if (relationshipStore == null) { relationshipStore = new RestRelationshipStore(); } if (connection == null) { connection = DefaultConnection; } return(relationshipStore.AddToIndex(connection, relationship, indexName, key, value)); }
public static Relationship AddToIndex(Relationship relationship, Enum indexName, Enum key, object value, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { return(AddToIndex(relationship, indexName.ToString(), key.ToString(), value, relationshipStore, connection)); }
public Relationship(IRelationshipStore relationshipStore, Properties properties = null) { _properties = properties ?? new Properties(); _relationshipGraphStore = relationshipStore; }
public static List <Path> ParseJson(JArray jsonPaths, IRelationshipStore relationshipGraphStore) { return(ParseJson(jsonPaths, new RestNodeStore(), relationshipGraphStore)); }
public static List<Path> ParseJson(JArray jsonPaths, IRelationshipStore relationshipGraphStore) { return ParseJson(jsonPaths, new RestNodeStore(), relationshipGraphStore); }
private Path(JObject path, INodeStore nodeGraphStore, IRelationshipStore relationshipGraphStore) { JToken startNode; if (!path.TryGetValue("start", out startNode)) { throw new Exception("Invalid path json"); } switch (startNode.Type) { case JTokenType.String: StartNode = nodeGraphStore.Initilize(startNode.Value<string>(), null); break; //case JTokenType.Object: // StartNode = nodeGraphStore.CreateNodeFromJson((JObject)startNode); // break; default: throw new Exception("Invalid path json"); } JToken endNode; if (!path.TryGetValue("end", out endNode)) { throw new Exception("Invalid path json"); } switch (endNode.Type) { case JTokenType.String: EndNode = nodeGraphStore.Initilize(endNode.Value<string>(), null); break; //case JTokenType.Object: // EndNode = nodeGraphStore.CreateNodeFromJson((JObject)endNode); // break; default: throw new Exception("Invalid path json"); } Nodes = new List<Node>(); JToken nodes; if (!path.TryGetValue("nodes", out nodes) || nodes.Type != JTokenType.Array) { throw new Exception("Invalid path json"); } foreach (JToken node in nodes) { switch (node.Type) { case JTokenType.String: Nodes.Add(nodeGraphStore.Initilize(node.Value<string>(), null)); break; //case JTokenType.Object: // Nodes.Add(nodeGraphStore.CreateNodeFromJson((JObject)node)); // break; default: throw new Exception("Invalid path json"); } } Relationships = new List<Relationship>(); JToken relationships; if (!path.TryGetValue("relationships", out relationships) || relationships.Type != JTokenType.Array) { throw new Exception("Invalid path json"); } foreach (JToken relationship in relationships) { switch (relationship.Type) { case JTokenType.String: Relationships.Add(relationshipGraphStore.Initilize(relationship.Value<string>(), null)); break; //case JTokenType.Object: // Relationships.Add(relationshipGraphStore.CreateRelationshipFromJson((JObject)relationship)); // break; default: throw new Exception("Invalid path json"); } } OriginalPathJson = path.ToString(Formatting.None); }
public static Relationship CreateRelationship(Node startNode, Node endNode, Enum name, Properties properties = null, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { return(CreateRelationship(startNode, endNode, name.ToString(), properties, relationshipStore, connection)); }
private Relationship(Properties properties = null) { _properties = properties ?? new Properties(); _relationshipGraphStore = new RestRelationshipStore(); }
public static Relationship CreateUniqueRelationship(Node startNode, Node endNode, string name, string indexName, string key, object value, IndexUniqueness uniqueness, Properties properties = null, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { if (properties == null) { properties = new Properties(); } if (relationshipStore == null) { relationshipStore = new RestRelationshipStore(); } if (connection == null) { connection = DefaultConnection; } return(relationshipStore.CreateUniqueRelationship(connection, startNode, endNode, name, properties, indexName, key, value, uniqueness)); }
public static Relationship GetRelationship(EncryptId relationshipId, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { return(GetRelationship((long)relationshipId, relationshipStore, connection)); }
public static Relationship CreateUniqueRelationship(Node startNode, Node endNode, Enum name, Enum indexName, Enum key, object value, IndexUniqueness uniqueness, Properties properties = null, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { return(CreateUniqueRelationship(startNode, endNode, name.ToString(), indexName.ToString(), key.ToString(), value, uniqueness, properties, relationshipStore, connection)); }
private Path(JObject path, INodeStore nodeGraphStore, IRelationshipStore relationshipGraphStore) { JToken startNode; if (!path.TryGetValue("start", out startNode)) { throw new Exception("Invalid path json"); } switch (startNode.Type) { case JTokenType.String: StartNode = nodeGraphStore.Initilize(startNode.Value <string>(), null); break; //case JTokenType.Object: // StartNode = nodeGraphStore.CreateNodeFromJson((JObject)startNode); // break; default: throw new Exception("Invalid path json"); } JToken endNode; if (!path.TryGetValue("end", out endNode)) { throw new Exception("Invalid path json"); } switch (endNode.Type) { case JTokenType.String: EndNode = nodeGraphStore.Initilize(endNode.Value <string>(), null); break; //case JTokenType.Object: // EndNode = nodeGraphStore.CreateNodeFromJson((JObject)endNode); // break; default: throw new Exception("Invalid path json"); } Nodes = new List <Node>(); JToken nodes; if (!path.TryGetValue("nodes", out nodes) || nodes.Type != JTokenType.Array) { throw new Exception("Invalid path json"); } foreach (JToken node in nodes) { switch (node.Type) { case JTokenType.String: Nodes.Add(nodeGraphStore.Initilize(node.Value <string>(), null)); break; //case JTokenType.Object: // Nodes.Add(nodeGraphStore.CreateNodeFromJson((JObject)node)); // break; default: throw new Exception("Invalid path json"); } } Relationships = new List <Relationship>(); JToken relationships; if (!path.TryGetValue("relationships", out relationships) || relationships.Type != JTokenType.Array) { throw new Exception("Invalid path json"); } foreach (JToken relationship in relationships) { switch (relationship.Type) { case JTokenType.String: Relationships.Add(relationshipGraphStore.Initilize(relationship.Value <string>(), null)); break; //case JTokenType.Object: // Relationships.Add(relationshipGraphStore.CreateRelationshipFromJson((JObject)relationship)); // break; default: throw new Exception("Invalid path json"); } } OriginalPathJson = path.ToString(Formatting.None); }
public static List <Path> ParseJson(JArray jsonPaths, INodeStore nodeGraphStore, IRelationshipStore relationshipGraphStore) { if (jsonPaths == null) { return(null); } var jaPaths = jsonPaths; return((from JObject joPath in jaPaths select new Path(joPath, nodeGraphStore, relationshipGraphStore)).ToList()); }
public static bool RemoveFromIndex(Relationship relationship, Enum indexName, Enum key = null, object value = null, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { return(RemoveFromIndex(relationship, indexName.ToString(), key == null ? null : key.ToString(), value, relationshipStore, connection)); }
public static IEnumerable <Relationship> GetRelationship(Enum indexName, Enum key, object value, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { return(GetRelationship(indexName.ToString(), key.ToString(), value, relationshipStore, connection)); }
public static bool RemoveFromIndex(Relationship relationship, string indexName, string key = null, object value = null, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { if (relationshipStore == null) { relationshipStore = new RestRelationshipStore(); } if (connection == null) { connection = DefaultConnection; } return(key == null? relationshipStore.RemoveFromIndex(connection, relationship, indexName) : value == null? relationshipStore.RemoveFromIndex(connection, relationship, indexName, key) : relationshipStore.RemoveFromIndex(connection, relationship, indexName, key, value)); }
public static IEnumerable <Relationship> GetRelationship(string indexName, string key, object value, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { if (relationshipStore == null) { relationshipStore = new RestRelationshipStore(); } if (connection == null) { connection = DefaultConnection; } return(relationshipStore.GetRelationship(connection, indexName, key, value)); }
public static Relationship CreateRelationship(Node startNode, Node endNode, string name, Properties properties = null, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { if (properties == null) { properties = new Properties(); } if (relationshipStore == null) { relationshipStore = new RestRelationshipStore(); } if (connection == null) { connection = DefaultConnection; } return(relationshipStore.CreateRelationship(connection, startNode, endNode, name, properties)); }
public static IEnumerable <Relationship> GetRelationship(Enum indexName, string searchQuery, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { return(GetRelationship(indexName.ToString(), searchQuery, relationshipStore, connection)); }
public static List<Path> ParseJson(string jsonPaths, INodeStore nodeGraphStore, IRelationshipStore relationshipGraphStore) { if (String.IsNullOrEmpty(jsonPaths)) { return null; } var jaPaths = JArray.Parse(jsonPaths); return ParseJson(jaPaths); }
public static IEnumerable <Relationship> GetRelationship(string indexName, string searchQuery, IRelationshipStore relationshipStore = null, ConnectionElement connection = null) { if (relationshipStore == null) { relationshipStore = new RestRelationshipStore(); } if (connection == null) { connection = DefaultConnection; } return(relationshipStore.GetRelationship(connection, indexName, searchQuery)); }
public static List<Path> ParseJson(JArray jsonPaths, INodeStore nodeGraphStore, IRelationshipStore relationshipGraphStore) { if (jsonPaths == null) { return null; } var jaPaths = jsonPaths; return (from JObject joPath in jaPaths select new Path(joPath, nodeGraphStore, relationshipGraphStore)).ToList(); }
public static List <Path> ParseJson(string jsonPaths, INodeStore nodeGraphStore, IRelationshipStore relationshipGraphStore) { if (String.IsNullOrEmpty(jsonPaths)) { return(null); } var jaPaths = JArray.Parse(jsonPaths); return(ParseJson(jaPaths)); }