Skip to main content

Hello, it’s kind of easy to get all edges via rest api, but how i can filter them by start node? It’s not clear from documentation how to create such filter. Or any other approach using rest api will help me.

{
"instanceType": "edge",
"limit": 1
"filter: {
"property": y],
"value": "value"
}
}

My filter is not correct here, but what I want is to filter all edges where “startNode”: {“space”: “name-space”, “externalId”: “some-id”}

@Sergei Sementchouk 

I’m not sure if this answers your question.  If you want to list all edges in a space, your request to the models/instances/list endpoint could look like:

{
"includeTyping": true,
"instanceType": "edge",
"filter": {
"equals": {
"property": y
"edge",
"space"
],
"value": "<ENTER SPACE NAME>"
}
}
}

This gets you all instances of edges in a space.  

If you know the space and id, you can use the model/instances/byids endpoint

 

Jason
 


Here is a concrete example for the Movie Database:
 

{
"instanceType": "edge",
"limit": 1000,
"sources": ],
"filter": {
"equals": {
"property":
"edge",
"type"
],
"value":
"oo-movie",
"Movie.actors"
]
}
}
}


where oo-movie is your namespace and Movie.actors is where the edge starts. This will list all Movie.actor edges.

Assume you want to list all edges that start from the movie called Walking Life instead, then:

{
"instanceType": "edge",
"limit": 1000,
"sources": ],
"filter": {
"equals": {
"property":
"edge",
"startNode"
],
"value":
"oo-movie",
"Waking Life"
]
}
}
}

 


Hi @Sergei Sementchouk,

I hope Jason’s and Simon’s reply was helpful. As of now, I will close this thread. Please let us know if you have more questions.

Best regards,
Dilini


Reply