예제 #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));
 }