Skip to main content
Committed ⭐️
Apr 17, 2023 2:08 PM UTC
Solved

Filter all the edges with known start node.

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": [],
"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”}

Dilini Fernando
Expert ⭐️⭐️⭐️⭐️
May 12, 2023 7:12 AM UTC

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

3 replies

Expert ⭐️⭐️⭐️⭐️
Apr 17, 2023 8:17 PM UTC

@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": [
"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
 

Committed ⭐️⭐️⭐️
Apr 18, 2023 8:40 AM UTC

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"
]
}
}
}

 

Dilini Fernando
Expert ⭐️⭐️⭐️⭐️
Expert ⭐️⭐️⭐️⭐️
May 12, 2023 7:12 AM UTC

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