Class GraphAPI

    • Constructor Detail

      • GraphAPI

        protected GraphAPI​(GraphAPI.Conf<?> builder)
        Create this APIHandler by using its Builder.
        Parameters:
        builder - The builder to use.
    • Method Detail

      • 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.
      • queryGremlinCommand

        public GraphAPI.QueryGremlinCommand queryGremlinCommand​(java.lang.String ogitId,
                                                                java.lang.String query)
        query gremlin

        API 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 ids

        API 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 xid

        API 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 values

        API 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 vertex

        API 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 graph

        API 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 graph

        API 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