ExtractId
See javadoc - uk.gov.gchq.gaffer.data.element.function.ExtractId
Available since Gaffer version 1.4.0
Extracts an identifier from an element
Examples
Extract source from edge
The function will simply extract the value of the provided Id, for a given Element. This Id can either be an IdentifierType, or a String representation, eg "SOURCE".
Java
JSON
Full JSON
Python
final ExtractId function = new ExtractId(IdentifierType.SOURCE);
{
"class" : "ExtractId",
"id" : "SOURCE"
}
{
"class" : "uk.gov.gchq.gaffer.data.element.function.ExtractId",
"id" : "SOURCE"
}
g.ExtractId(
id="SOURCE"
)
Input type:
uk.gov.gchq.gaffer.data.element.Element
Example inputs:
Input Type | Input | Result Type | Result |
---|---|---|---|
uk.gov.gchq.gaffer.data.element.Edge | Edge[source=src,destination=dest,directed=true,group=edge,properties=Properties[]] | java.lang.String | src |
uk.gov.gchq.gaffer.data.element.Edge | Edge[source=13.2,destination=15.642,directed=true,group=otherEdge,properties=Properties[]] | java.lang.Double | 13.2 |
Extract vertex from entity
This example simply demonstrates the same functionality but on an Entity.
Java
JSON
Full JSON
Python
final ExtractId function = new ExtractId(IdentifierType.VERTEX);
{
"class" : "ExtractId",
"id" : "VERTEX"
}
{
"class" : "uk.gov.gchq.gaffer.data.element.function.ExtractId",
"id" : "VERTEX"
}
g.ExtractId(
id="VERTEX"
)
Input type:
uk.gov.gchq.gaffer.data.element.Element
Example inputs:
Input Type | Input | Result Type | Result |
---|---|---|---|
uk.gov.gchq.gaffer.data.element.Entity | Entity[vertex=v1,group=entity,properties=Properties[]] | java.lang.String | v1 |