Skip to main content
Solved

Filter all the edges with known start node.


Forum|alt.badge.img

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

Best answer by Dilini Fernando

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

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img
  • Seasoned Practitioner
  • 281 replies
  • April 17, 2023

@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
 


Forum|alt.badge.img

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
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • 670 replies
  • Answer
  • May 12, 2023

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


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings