Class GraphAPI
- java.lang.Object
-
- co.arago.hiro.client.connection.AbstractAPIHandler
-
- co.arago.hiro.client.rest.AuthenticatedAPIHandler
-
- co.arago.hiro.client.rest.GraphAPI
-
public class GraphAPI extends AuthenticatedAPIHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGraphAPI.Builderstatic classGraphAPI.Conf<T extends GraphAPI.Conf<T>>classGraphAPI.CreateEntityCommandcreate vertex entity using ogit/_type.classGraphAPI.DeleteEntityCommanddelete entity by ogit/_id (vertex or edge).classGraphAPI.GetBlobCommandget a binary blob / content / attachment from the graphclassGraphAPI.GetEntityCommandget entity by ogit/_id (vertex or edge)classGraphAPI.GetHistoryCommandget the history of an entity (vertex / edge)classGraphAPI.GetTimeseriesCommandget timeseries of an entity (vertex / edge)classGraphAPI.GetTimeseriesHistoryCommandget timeseries history of an entity (vertex / edge)classGraphAPI.PostBlobCommandpost a binary blob / content / attachment to the graphclassGraphAPI.PostTimeseriesCommandpost timeseries to an entityclassGraphAPI.PostVerbCommandconnect two vertices via an edge named verb.protected static classGraphAPI.QueryBodyConf<T extends GraphAPI.QueryBodyConf<T,R>,R>A config class that contains common parameters for all Graph Queries.classGraphAPI.QueryByIdsCommandquery by idsclassGraphAPI.QueryByXidCommandquery by xidclassGraphAPI.QueryGremlinCommandquery gremlinclassGraphAPI.QueryTimeseriesCommandquery timeseries valuesclassGraphAPI.QueryVerticesCommandquery verticesclassGraphAPI.UpdateEntityCommandupdate vertex entity by ogit/_id.-
Nested classes/interfaces inherited from class co.arago.hiro.client.rest.AuthenticatedAPIHandler
AuthenticatedAPIHandler.APIRequestConf<T extends AuthenticatedAPIHandler.APIRequestConf<T,R>,R>, AuthenticatedAPIHandler.SendBodyAPIRequestConf<T extends AuthenticatedAPIHandler.SendBodyAPIRequestConf<T,R>,R>, AuthenticatedAPIHandler.SendStreamAPIRequestConf<T extends AuthenticatedAPIHandler.SendStreamAPIRequestConf<T,R>,R>
-
-
Field Summary
-
Fields inherited from class co.arago.hiro.client.rest.AuthenticatedAPIHandler
apiName, apiPath, apiURI, tokenAPIHandler
-
Fields inherited from class co.arago.hiro.client.connection.AbstractAPIHandler
httpClientHandler, httpRequestTimeout, maxRetries, rootApiURI, title, userAgent, version, webSocketURI
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGraphAPI(GraphAPI.Conf<?> builder)Create this APIHandler by using its Builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphAPI.PostVerbCommandconnectVerticesCommand(java.lang.String fromNodeId, java.lang.String verb, java.lang.String toNodeId)connect two vertices via an edge named verb.java.lang.StringcreateEdgeOgitId(java.lang.String fromNodeId, java.lang.String verb, java.lang.String toNodeId)GraphAPI.CreateEntityCommandcreateVertexCommand(java.lang.String ogitType)create vertex entity using ogit/_type.GraphAPI.CreateEntityCommandcreateVertexCommand(java.util.Map<java.lang.String,java.lang.Object> attributes)create vertex entity using ogit/_type.GraphAPI.DeleteEntityCommanddeleteVertexCommand(java.lang.String ogitId)delete entity by ogit/_id (vertex).GraphAPI.DeleteEntityCommanddisconnectVertices(java.lang.String fromNodeId, java.lang.String verb, java.lang.String toNodeId)delete entity by ogit/_id (edge).GraphAPI.GetBlobCommandgetAttachmentCommand(java.lang.String ogitId)get content / blob / attachment of vertexGraphAPI.GetEntityCommandgetEdgeCommand(java.lang.String fromNodeId, java.lang.String verb, java.lang.String toNodeId)get entity by ogit/_id (edge)GraphAPI.GetHistoryCommandgetHistoryCommand(java.lang.String ogitId)get the history of an entity (vertex / edge)GraphAPI.GetTimeseriesCommandgetTimeseriesCommand(java.lang.String ogitId)get timeseries of an entity (vertex / edge)GraphAPI.GetTimeseriesHistoryCommandgetTimeseriesHistoryCommand(java.lang.String ogitId, long timestamp)get timeseries history of an entity (vertex / edge)GraphAPI.GetEntityCommandgetVertexCommand(java.lang.String ogitId)get entity by ogit/_id (vertex)static GraphAPI.Conf<?>newBuilder(TokenAPIHandler tokenAPIHandler)GraphAPI.PostBlobCommandpostAttachmentCommand(java.lang.String ogitId, StreamContainer streamContainer)post a binary blob / content / attachment to the graphGraphAPI.PostBlobCommandpostAttachmentCommand(java.lang.String ogitId, java.io.InputStream inputStream)post a binary blob / content / attachment to the graphGraphAPI.PostTimeseriesCommandpostTimeseriesCommand(java.lang.String ogitId)post timeseries of an entity (vertex / edge)GraphAPI.QueryByIdsCommandqueryByIdsCommand(java.lang.String ids)query by idsGraphAPI.QueryByXidCommandqueryByXidCommand(java.lang.String xid)query by xidGraphAPI.QueryGremlinCommandqueryGremlinCommand(java.lang.String ogitId, java.lang.String query)query gremlinGraphAPI.QueryTimeseriesCommandqueryTimeseriesCommand(java.lang.String query)query timeseries valuesGraphAPI.QueryVerticesCommandqueryVerticesCommand(java.lang.String query)query verticesGraphAPI.UpdateEntityCommandupdateVertexCommand(java.lang.String ogitId)update vertex entity by ogit/_id.GraphAPI.UpdateEntityCommandupdateVertexCommand(java.util.Map<java.lang.String,java.lang.Object> attributes)update vertex entity by ogit/_id.-
Methods inherited from class co.arago.hiro.client.rest.AuthenticatedAPIHandler
addToHeaders, checkResponse, getEndpointURI
-
Methods inherited from class co.arago.hiro.client.connection.AbstractAPIHandler
addQueryFragmentAndNormalize, buildApiURI, buildEndpointURI, buildURI, buildWebSocketURI, delete, executeAsyncWithStreamBody, executeAsyncWithStringBody, executeBinary, executeWithStreamBody, executeWithStringBody, get, getBinary, getConf, getHttpLogger, getHttpRequestTimeout, getMaxRetries, getOrBuildClient, getRequestBuilder, getRootApiURI, getUserAgent, getWebSocketURI, patch, patchBinary, post, postBinary, put, putBinary, send, sendAsync
-
-
-
-
Constructor Detail
-
GraphAPI
protected GraphAPI(GraphAPI.Conf<?> builder)
Create this APIHandler by using its Builder.- Parameters:
builder- The builder to use.
-
-
Method Detail
-
newBuilder
public static GraphAPI.Conf<?> newBuilder(TokenAPIHandler tokenAPIHandler)
-
createEdgeOgitId
public java.lang.String createEdgeOgitId(java.lang.String fromNodeId, java.lang.String verb, java.lang.String toNodeId)- Parameters:
fromNodeId- Source vertex of the edge.verb- Verb/Name of the edge.toNodeId- Destination vertex of the edge.- Returns:
- The ogitId for the edge.
-
queryVerticesCommand
public GraphAPI.QueryVerticesCommand queryVerticesCommand(java.lang.String query)
query verticesAPI POST /api/graph/[version]/query/vertices
- Parameters:
query- The query string, e.g. ogit\/_type: ogit\/Question.- Returns:
- New instance of the request
- See Also:
- API Documentation, ElasticSearch query syntax
-
queryGremlinCommand
public GraphAPI.QueryGremlinCommand queryGremlinCommand(java.lang.String ogitId, java.lang.String query)
query gremlinAPI POST /api/graph/[version]/query/gremlin
- Parameters:
ogitId- The root ogitId to start the query from.query- The query string, e.g. ogit\/_type: ogit\/Question.- Returns:
- New instance of the request
- See Also:
- API Documentation, Gremlin query syntax
-
queryByIdsCommand
public GraphAPI.QueryByIdsCommand queryByIdsCommand(java.lang.String ids)
query by idsAPI POST /api/graph/[version]/query/ids
- Parameters:
ids- The comma separated list of ids, e.g. id1,id2,id3- Returns:
- New instance of the request
- See Also:
- API Documentation
-
queryByXidCommand
public GraphAPI.QueryByXidCommand queryByXidCommand(java.lang.String xid)
query by xidAPI POST /api/graph/[version]/query/xid
- Parameters:
xid- The xid- Returns:
- New instance of the request
- See Also:
- API Documentation
-
queryTimeseriesCommand
public GraphAPI.QueryTimeseriesCommand queryTimeseriesCommand(java.lang.String query)
query timeseries valuesAPI POST /api/graph/[version]/query/values
- Parameters:
query- The query- Returns:
- New instance of the request
- See Also:
- API Documentation
-
getVertexCommand
public GraphAPI.GetEntityCommand getVertexCommand(java.lang.String ogitId)
get entity by ogit/_id (vertex)API GET /api/graph/[version]/{ogit/_id}
- Parameters:
ogitId- ogit/_id of the vertex.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
getEdgeCommand
public GraphAPI.GetEntityCommand getEdgeCommand(java.lang.String fromNodeId, java.lang.String verb, java.lang.String toNodeId)
get entity by ogit/_id (edge)API GET /api/graph/[version]/{ogit/_id}
- Parameters:
fromNodeId- Source vertex of the edge.verb- Verb/Name of the edge.toNodeId- Destination vertex of the edge.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
updateVertexCommand
public GraphAPI.UpdateEntityCommand updateVertexCommand(java.lang.String ogitId)
update vertex entity by ogit/_id.API POST /api/graph/[version]/{ogit/_id}
- Parameters:
ogitId- ogit/_id of the vertex.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
updateVertexCommand
public GraphAPI.UpdateEntityCommand updateVertexCommand(java.util.Map<java.lang.String,java.lang.Object> attributes)
update vertex entity by ogit/_id.API POST /api/graph/[version]/{ogit/_id}
- Parameters:
attributes- The complete entity data. Map 'attributes' needs to contain a key "ogit/_id" with a non-blank value.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
deleteVertexCommand
public GraphAPI.DeleteEntityCommand deleteVertexCommand(java.lang.String ogitId)
delete entity by ogit/_id (vertex).API DELETE /api/graph/[version]/{ogit/_id}
- Parameters:
ogitId- ogit/_id of the vertex.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
disconnectVertices
public GraphAPI.DeleteEntityCommand disconnectVertices(java.lang.String fromNodeId, java.lang.String verb, java.lang.String toNodeId)
delete entity by ogit/_id (edge).API DELETE /api/graph/[version]/{ogit/_id}
- Parameters:
fromNodeId- Source vertex of the edge.verb- Verb/Name of the edge.toNodeId- Destination vertex of the edge.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
createVertexCommand
public GraphAPI.CreateEntityCommand createVertexCommand(java.lang.String ogitType)
create vertex entity using ogit/_type.If defined in OGIT for entity type one may set in content ogit/isPermanent = true to make entity immutable
API POST /api/graph/[version]/new/{ogit/_type}
- Parameters:
ogitType- ogit/_type of the vertex.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
createVertexCommand
public GraphAPI.CreateEntityCommand createVertexCommand(java.util.Map<java.lang.String,java.lang.Object> attributes)
create vertex entity using ogit/_type.If defined in OGIT for entity type one may set in content ogit/isPermanent = true to make entity immutable
API POST /api/graph/[version]/new/{ogit/_type}
- Parameters:
attributes- The complete entity data. Map 'attributes' needs to contain a key "ogit/_type" with a non-blank value.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
connectVerticesCommand
public GraphAPI.PostVerbCommand connectVerticesCommand(java.lang.String fromNodeId, java.lang.String verb, java.lang.String toNodeId)
connect two vertices via an edge named verb.API POST /api/graph/[version]/connect/{ogit/_type}
- Parameters:
fromNodeId- Source vertex of the edge.verb- Verb/Name of the edge.toNodeId- Destination vertex of the edge.- Returns:
- New instance of the request
- See Also:
- API Documentation
-
getAttachmentCommand
public GraphAPI.GetBlobCommand getAttachmentCommand(java.lang.String ogitId)
get content / blob / attachment of vertexAPI GET /api/graph/[version]/{ogit/_id}/content
- Parameters:
ogitId- ogit/_id of the vertex.- Returns:
- New instance of the command. Use method "execute()" after all parameters have been set to run the command.
- See Also:
- API Documentation
-
postAttachmentCommand
public GraphAPI.PostBlobCommand postAttachmentCommand(java.lang.String ogitId, StreamContainer streamContainer)
post a binary blob / content / attachment to the graphAPI POST /api/graph/[version]/{ogit/_id}/content
- Parameters:
ogitId- ogit/_id of the vertex.streamContainer- Container with the data stream.- Returns:
- New instance of the command. Use method "execute()" after all parameters have been set to run the command.
- See Also:
- API Documentation
-
postAttachmentCommand
public GraphAPI.PostBlobCommand postAttachmentCommand(java.lang.String ogitId, java.io.InputStream inputStream)
post a binary blob / content / attachment to the graphAPI POST /api/graph/[version]/{ogit/_id}/content
- Parameters:
ogitId- ogit/_id of the vertex.inputStream- InputStream with the data.- Returns:
- New instance of the command. Use method "execute()" after all parameters have been set to run the command.
- See Also:
- API Documentation
-
getHistoryCommand
public GraphAPI.GetHistoryCommand getHistoryCommand(java.lang.String ogitId)
get the history of an entity (vertex / edge)API GET /api/graph/[version]/{ogit/_id}/history
- Parameters:
ogitId- ogit/_id of the vertex.- Returns:
- New instance of the command. Use method "execute()" after all parameters have been set to run the command.
- See Also:
- API Documentation
-
getTimeseriesCommand
public GraphAPI.GetTimeseriesCommand getTimeseriesCommand(java.lang.String ogitId)
get timeseries of an entity (vertex / edge)API GET /api/graph/[version]/{ogit/_id}/values
- Parameters:
ogitId- ogit/_id of the vertex.- Returns:
- New instance of the command. Use method "execute()" after all parameters have been set to run the command.
- See Also:
- API Documentation
-
getTimeseriesHistoryCommand
public GraphAPI.GetTimeseriesHistoryCommand getTimeseriesHistoryCommand(java.lang.String ogitId, long timestamp)
get timeseries history of an entity (vertex / edge)API GET /api/graph/[version]/{ogit/_id}/values/history
- Parameters:
ogitId- ogit/_id of the vertex.timestamp- Timestamp in ms.- Returns:
- New instance of the command. Use method "execute()" after all parameters have been set to run the command.
- See Also:
- API Documentation
-
postTimeseriesCommand
public GraphAPI.PostTimeseriesCommand postTimeseriesCommand(java.lang.String ogitId)
post timeseries of an entity (vertex / edge)API POST /api/graph/[version]/{ogit/_id}/values
- Parameters:
ogitId- ogit/_id of the vertex.- Returns:
- New instance of the command. Use method "execute()" after all parameters have been set to run the command.
- See Also:
- API Documentation
-
-