Пример #1
0
        public IEnumerable <Relationship> GetRelationships(Node node, RelationshipDirection direction, IEnumerable <string> relationshipTypes = null)
        {
            if (IsBatchObject(node))
            {
                throw new BatchGetRelationshipsNotSupportedException();
            }

            var index = _jobs.Count();

            if (relationshipTypes == null || !relationshipTypes.Any())
            {
                _jobs.Add(new BatchJob
                {
                    Method = HttpRest.Method.Get,
                    To     = string.Format("/node/{0}/relationships/{1}", node.Id, direction),
                    Id     = index
                });
            }
            else
            {
                _jobs.Add(new BatchJob
                {
                    Method = HttpRest.Method.Get,
                    To     = string.Format("/node/{0}/relationships/{1}/{2}", node.Id, direction, string.Join("&", relationshipTypes)),
                    Id     = index
                });
            }
            _jobs[index].GraphObject = new BatchRelationshipStore(this).Initilize(null, index, null);

            return(new List <Relationship> {
                (Relationship)_jobs[index].GraphObject
            });
        }
Пример #2
0
        public IEnumerable <Relationship> GetRelationships(RelationshipDirection direction, IEnumerable <string> relationshipTypes)
        {
            string response;
            var    status = Neo4jRestApi.GetRelationshipsOnNode(DbUrl, Id, direction, relationshipTypes, out response);

            if (status != HttpStatusCode.OK)
            {
                throw new Exception(string.Format("Error retrieving relationships on node (node id:{0} http response:{1})", Id, status));
            }

            return(RestRelationshipStore.ParseRelationshipJson(response));
        }
Пример #3
0
 public IEnumerable <Relationship> GetRelationships(RelationshipDirection direction, IEnumerable <string> relationshipTypes)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public TraverseRelationship(string relationshipName, RelationshipDirection direction)
 {
     _relationshipName = relationshipName;
     _direction = direction;
 }
Пример #5
0
        public IEnumerable<Relationship> GetRelationships(RelationshipDirection direction, IEnumerable<string> relationshipTypes)
        {
            string response;
            var status = Neo4jRestApi.GetRelationshipsOnNode(DbUrl, Id, direction, relationshipTypes, out response);
            if (status != HttpStatusCode.OK)
            {
                throw new Exception(string.Format("Error retrieving relationships on node (node id:{0} http response:{1})", Id, status));
            }

            return RestRelationshipStore.ParseRelationshipJson(response);
        }
Пример #6
0
 public IEnumerable <Relationship> GetRelationships(RelationshipDirection direction, IEnumerable <string> relationshipTypes)
 {
     throw new BatchGetRelationshipsNotSupportedException();
 }
Пример #7
0
 public IEnumerable<Relationship> GetRelationships(RelationshipDirection direction, IEnumerable<string> relationshipTypes)
 {
     throw new BatchGetRelationshipsNotSupportedException();
 }
Пример #8
0
        public static HttpStatusCode GetRelationshipsOnNode(string dbUrl, long nodeId, RelationshipDirection direction, IEnumerable<string> relationships, out string response)
        {
            if (direction == null)
            {
                direction = RelationshipDirection.All;
            }

            if (relationships == null || !relationships.Any())
            {
                return
                    HttpRest.Get(
                        string.Concat(Connection.GetServiceRoot(dbUrl).Node, "/", nodeId.ToString(), "/relationships/", direction.ToString()),
                        out response);
            }

            return
                HttpRest.Get(
                    string.Concat(Connection.GetServiceRoot(dbUrl).Node, "/", nodeId.ToString(), "/relationships/", direction.ToString(), "/",
                                  string.Join("&", relationships)), out response);
        }
Пример #9
0
 public IEnumerable <Relationship> GetRelationships(RelationshipDirection direction, IEnumerable <string> names)
 {
     return(_nodeGraphStore.GetRelationships(direction, names));
 }
Пример #10
0
 public IEnumerable <Relationship> GetRelationships(RelationshipDirection direction, Enum name)
 {
     return(GetRelationships(direction, new List <string> {
         name.ToString()
     }));
 }
Пример #11
0
 public IEnumerable <Relationship> GetRelationships(RelationshipDirection direction)
 {
     return(GetRelationships(direction, (IEnumerable <string>)null));
 }