Solved

Filter all the edges with known start node.

  • 17 April 2023
  • 3 replies
  • 74 views

Badge

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”}

icon

Best answer by Dilini Fernando 12 May 2023, 09:12

View original

3 replies

Badge

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

 

Userlevel 4
Badge

@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
 

Userlevel 4
Badge +2

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