GetElementsInRanges

See javadoc - uk.gov.gchq.gaffer.accumulostore.operation.impl.GetElementsInRanges

Available since Gaffer version 1.0.0

Gets elements that have vertices within a given range

Required fields

No required fields

Examples

Get all elements in the range from entity 1 to entity 4

Java
JSON
Full JSON
Python
final GetElementsInRanges operation = new GetElementsInRanges.Builder()
        .input(new Pair<>(new EntitySeed(1), new EntitySeed(4)))
        .build();
{
  "class" : "GetElementsInRanges",
  "input" : [ {
    "class" : "Pair",
    "first" : {
      "EntitySeed" : {
        "class" : "EntitySeed",
        "vertex" : 1
      }
    },
    "second" : {
      "EntitySeed" : {
        "class" : "EntitySeed",
        "vertex" : 4
      }
    }
  } ]
}
{
  "class" : "uk.gov.gchq.gaffer.accumulostore.operation.impl.GetElementsInRanges",
  "input" : [ {
    "class" : "uk.gov.gchq.gaffer.commonutil.pair.Pair",
    "first" : {
      "uk.gov.gchq.gaffer.operation.data.EntitySeed" : {
        "class" : "uk.gov.gchq.gaffer.operation.data.EntitySeed",
        "vertex" : 1
      }
    },
    "second" : {
      "uk.gov.gchq.gaffer.operation.data.EntitySeed" : {
        "class" : "uk.gov.gchq.gaffer.operation.data.EntitySeed",
        "vertex" : 4
      }
    }
  } ]
}
g.GetElementsInRanges( 
  input=[ 
    g.SeedPair( 
      first=g.EntitySeed( 
        vertex=1 
      ), 
      second=g.EntitySeed( 
        vertex=4 
      ) 
    ) 
  ] 
)


The results are:

Entity[vertex=1,group=entity,properties=Properties[count=<java.lang.Integer>3]]
Edge[source=1,destination=2,directed=true,matchedVertex=SOURCE,group=edge,properties=Properties[count=<java.lang.Integer>3]]
Edge[source=1,destination=4,directed=true,matchedVertex=SOURCE,group=edge,properties=Properties[count=<java.lang.Integer>1]]
Entity[vertex=2,group=entity,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=2,destination=3,directed=true,matchedVertex=SOURCE,group=edge,properties=Properties[count=<java.lang.Integer>2]]
Edge[source=2,destination=4,directed=true,matchedVertex=SOURCE,group=edge,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=2,destination=5,directed=true,matchedVertex=SOURCE,group=edge,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=1,destination=2,directed=true,matchedVertex=DESTINATION,group=edge,properties=Properties[count=<java.lang.Integer>3]]
Entity[vertex=3,group=entity,properties=Properties[count=<java.lang.Integer>2]]
Edge[source=3,destination=4,directed=true,matchedVertex=SOURCE,group=edge,properties=Properties[count=<java.lang.Integer>4]]
Edge[source=2,destination=3,directed=true,matchedVertex=DESTINATION,group=edge,properties=Properties[count=<java.lang.Integer>2]]
Entity[vertex=4,group=entity,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=1,destination=4,directed=true,matchedVertex=DESTINATION,group=edge,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=2,destination=4,directed=true,matchedVertex=DESTINATION,group=edge,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=3,destination=4,directed=true,matchedVertex=DESTINATION,group=edge,properties=Properties[count=<java.lang.Integer>4]]

Get all elements in the range from entity 4 to edge 4_5

Java
JSON
Full JSON
Python
final GetElementsInRanges operation = new GetElementsInRanges.Builder()
        .input(new Pair<>(new EntitySeed(4), new EdgeSeed(4, 5, DirectedType.EITHER)))
        .build();
{
  "class" : "GetElementsInRanges",
  "input" : [ {
    "class" : "Pair",
    "first" : {
      "EntitySeed" : {
        "class" : "EntitySeed",
        "vertex" : 4
      }
    },
    "second" : {
      "EdgeSeed" : {
        "class" : "EdgeSeed",
        "source" : 4,
        "destination" : 5,
        "matchedVertex" : "SOURCE",
        "directedType" : "EITHER"
      }
    }
  } ]
}
{
  "class" : "uk.gov.gchq.gaffer.accumulostore.operation.impl.GetElementsInRanges",
  "input" : [ {
    "class" : "uk.gov.gchq.gaffer.commonutil.pair.Pair",
    "first" : {
      "uk.gov.gchq.gaffer.operation.data.EntitySeed" : {
        "class" : "uk.gov.gchq.gaffer.operation.data.EntitySeed",
        "vertex" : 4
      }
    },
    "second" : {
      "uk.gov.gchq.gaffer.operation.data.EdgeSeed" : {
        "class" : "uk.gov.gchq.gaffer.operation.data.EdgeSeed",
        "source" : 4,
        "destination" : 5,
        "matchedVertex" : "SOURCE",
        "directedType" : "EITHER"
      }
    }
  } ]
}
g.GetElementsInRanges( 
  input=[ 
    g.SeedPair( 
      first=g.EntitySeed( 
        vertex=4 
      ), 
      second=g.EdgeSeed( 
        source=4, 
        destination=5, 
        directed_type="EITHER", 
        matched_vertex="SOURCE" 
      ) 
    ) 
  ] 
)


The results are:

Entity[vertex=4,group=entity,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=1,destination=4,directed=true,matchedVertex=DESTINATION,group=edge,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=2,destination=4,directed=true,matchedVertex=DESTINATION,group=edge,properties=Properties[count=<java.lang.Integer>1]]
Edge[source=3,destination=4,directed=true,matchedVertex=DESTINATION,group=edge,properties=Properties[count=<java.lang.Integer>4]]
Entity[vertex=5,group=entity,properties=Properties[count=<java.lang.Integer>3]]

results matching ""

    No results matching ""