.. _otherAPI: ########### Other API ########### .. _Record: Record ============= .. autoclass:: graphdbapi.BoltStatementResult :show-inheritance: .. py:method:: get(key, default=None) :rtype: :class:`Any` .. py:method:: index(key) 返回键对应的索引 :rtype: :class:`int` .. py:method:: value(key=0, default=None) 若key为int类型则通过key获取其index,然后取对应的值 :param key: :type key: :class:`str` or :class:`int` :rtype: :class:`int` .. py:method:: keys() 获取所有的key :rtype: :class:`List` [:class:`str`] .. py:method:: values(*keys) 当keys不为空时获取指定数据,否则获取全部数据 :rtype: :class:`List` [:class:`Any`] .. py:method:: items(*keys) 当keys不为空时获取指定数据,否则获取全部数据 :rtype: :class:`List` [:class:`Tuple` [:class:`str`, :class:`Any`]] .. py:method:: data(*keys) 当keys不为空时获取指定数据,否则获取全部数据 :rtype: :class:`Dict` [:class:`str`, :class:`Any`] .. _BoltStatementResult: BoltStatementResult =========================== .. autoclass:: graphdbapi.BoltStatementResult :show-inheritance: :noindex: .. py:method:: consume() 消耗结果中的剩余部分 .. py:method:: data(*items) :noindex: 以list嵌套dict的形式返回结果的剩余部分 :param itmes: 为剩余的 :ref:`Record` 返回的字段 :rtype: :class:`List` [:class:`Dict` [:class:`str`, :class:`Any`]] .. py:method:: values(*items) :noindex: 以list嵌套list的形式返回结果的剩余部分 :param itmes: 为剩余的 :ref:`Record` 返回的字段 :rtype: :class:`List` [:class:`List` [:class:`Any`]] .. py:method:: value(item=0, default=None) :noindex: 以值列表的形式返回结果的剩余部分 :param itme: :ref:`Record` 需要返回的字段 :param default: 字段不存在时返回default :rtype: :class:`List` [:class:`Any`] .. automethod:: __iter__ .. py:method:: records :noindex: 返回用于从结果中获取数据的生成器 :yields: :ref:`Record` Node ======================= .. autoclass:: graphdbapi.Node :show-inheritance: .. describe:: node == other 比较节点是否相等 .. describe:: hash(self) 计算hash值 .. describe:: len(self) 节点属性数量 .. describe:: iter(self) 遍历节点上的所有属性。 .. describe:: self[key] 按key返回属性。 Raises :exc:`KeyError` 如果key不存在 .. py:attribute:: id 节点id .. py:attribute:: label 节点类型 .. py:method:: get(name, default=None) 按名称获取属性值,可选择使用默认值 :param name: 属性名称 :type name: str :param default: :type default: object :returns: 属性值,当属性不存在时返回 ``default`` :rtype: object .. py:method:: keys 返回所有属性名称的可迭代对象 :rtype: ``Iter[str]`` .. py:method:: values 返回所有属性值的可迭代对象。 :rtype: ``Iter[object]`` .. py:method:: items 返回所有属性名称-值对的可迭代对象。 :rtype: ``Iter[(str, object)...]`` Relationship ======================= .. autoclass:: graphdbapi.Relationship :show-inheritance: .. describe:: relationship == other 比较relationship是否相等 .. describe:: hash(self) 计算hash值 .. describe:: len(self) 属性数量 .. describe:: iter(self) 遍历关系上的所有属性。 .. describe:: self[key] 按key返回属性。 Raises :exc:`KeyError` 如果key不存在 .. py:attribute:: id 关系id .. py:attribute:: type 关系类型 .. py:attribute:: start_node 起点 :rtype: :class:`Node` .. py:attribute:: end_node 终点 :rtype: :class:`Node` Path ======================= .. autoclass:: graphdbapi.Path :show-inheritance: .. describe:: relationship == other 比较路径是否相等 .. describe:: hash(self) 计算hash值 .. describe:: len(self) 路径长度(关系数量) .. describe:: iter(self) 遍历所有关系。 .. py:attribute:: nodes 节点列表 :rtype: :class:`list` [:class:`Node`] .. py:attribute:: relationships 关系列表 :rtype: :class:`list` [:class:`Relationship`] .. py:attribute:: start_node 起点 :rtype: :class:`Node` .. py:attribute:: end_node 终点 :rtype: :class:`Node` .. _APIVertex: Vertex ======================= .. autoclass:: graphdbapi.Vertex :show-inheritance: .. automethod:: get_id .. automethod:: get_type .. automethod:: has_property .. automethod:: get_property .. automethod:: get_property_keys .. automethod:: get_all_properties .. _APIEdge: Edge ======================= .. autoclass:: graphdbapi.Edge :show-inheritance: .. automethod:: get_id .. automethod:: get_type .. automethod:: get_from_vertex_id .. automethod:: get_from_vertex .. automethod:: get_to_vertex_id .. automethod:: get_to_vertex .. automethod:: has_property .. automethod:: get_property .. automethod:: get_property_keys .. automethod:: get_all_properties .. _MetricInfo: MetricInfo ======================= .. autoclass:: graphdbapi.MetricInfo :show-inheritance: .. automethod:: get_id 节点id .. automethod:: get_node_start_time 启动时间 .. automethod:: get_addresses 节点地址 .. automethod:: get_host_name 节点主机名 .. automethod:: get_heap_init 节点id .. automethod:: get_heap_used 节点id .. automethod:: get_heap_committed heap Committed .. automethod:: get_heap_max heap Max .. automethod:: get_heap_total heap Total .. automethod:: get_last_update_time .. automethod:: get_thread_cnt .. automethod:: get_daemon_thread_cnt .. automethod:: get_peak_thread_cnt .. automethod:: get_started_thread_cnt .. automethod:: get_graph_metrics .. _CypherQuery: CypherQuery ======================= .. autoclass:: graphdbapi.v1.CypherQuery :show-inheritance: .. automethod:: get_task_id .. automethod:: get_cypher .. automethod:: get_graph_name .. automethod:: get_user_name .. automethod:: get_start_time .. _SearchOrder: SearchOrder ==================== .. autoclass:: graphdbapi.v1.SearchOrder :show-inheritance: .. describe:: prop 属性 :rtype: str .. describe:: order_by 排序方式 :rtype: :ref:`OrderBy` .. _SearchPredicate: SearchPredicate ======================= .. autoclass:: graphdbapi.v1.SearchPredicate :show-inheritance: .. automethod:: init_contains_predicate .. automethod:: init_prefix_predicate .. automethod:: init_suffix_predicate .. automethod:: init_less_than_predicate .. automethod:: init_greater_than_predicate .. automethod:: init_range_number_predicate .. automethod:: init_equal_predicate .. _CombinedEdgeType: CombinedEdgeType ======================= .. autoclass:: graphdbapi.v1.graph.CombinedEdgeType :show-inheritance: .. py:classmethod:: init_combined_edge_type(from_type: str, to_type: str) :param from_type: 起始点类型 :type from_type: str :param to_type: 终止点类型 :type to_type: str :rtype: :class:`CombinedEdgeType` .. _EdgeInfo: EdgeInfo ======================= .. autoclass:: graphdbapi.v1.graph.EdgeInfo :show-inheritance: .. automethod:: init_edge_info :param edge_id: 边id :type edge_id: str :param property: 边属性 :type property: :class:`Optional` [:class:`Dict` [str, :class:`Any`]] :param is_merge: 为 ``True`` 时集合属性追加,为 ``False`` 属性覆盖 :type is_merge: bool .. _EdgeInfoByVertexId: EdgeInfoByVertexId ======================= .. autoclass:: graphdbapi.v1.graph.EdgeInfoByVertexId :show-inheritance: .. automethod:: init_edge_info_by_vertex_id :param from_id: 起始点id :type from_id: int :param to_id: 终止点id :type to_id: int :param type: 边类型 :type type: str :param property: 边属性 :type property: :class:`Optional` [:class:`Dict` [str, :class:`Any`]] :param is_merge: 为 ``True`` 时集合属性追加,为 ``False`` 属性覆盖 :type is_merge: bool .. _EdgeInfoByVertexPk: EdgeInfoByVertexPk ======================= .. autoclass:: graphdbapi.v1.graph.EdgeInfoByVertexPk :show-inheritance: .. automethod:: init_edge_info_by_vertex_pk :rtype: :class:`EdgeInfoByVertexPk` .. automethod:: init_edge_info_by_vertex_pk_with_create :rtype: :class:`EdgeInfoByVertexPk` .. _ResponseItem: ResponseItem ======================= .. autoclass:: graphdbapi.v1.graph.ResponseItem :show-inheritance: .. automethod:: is_error 执行是否出错 .. automethod:: message :return: 错误信息 :rtype: str .. automethod:: data .. _VertexInfoById: VertexInfoById ======================= .. autoclass:: graphdbapi.v1.graph.VertexInfoById :show-inheritance: .. automethod:: init_vertex_info_by_id :param id: 点id :type id: int :param property: 点属性 :type property: :class:`Optional` [:class:`Dict` [str, :class:`Any`]] :param is_merge: 为 ``True`` 时集合属性追加,为 ``False`` 属性覆盖 :type is_merge: bool :rtype: :class:`VertexInfoById` .. _VertexInfoByPk: VertexInfoByPk ======================= .. autoclass:: graphdbapi.v1.graph.VertexInfoByPk :show-inheritance: .. automethod:: init_vertex_info_by_pk :param pk: 点pk :type pk: str :param type: 点类型 :type type: str :param is_merge: 为 ``True`` 时集合属性追加,为 ``False`` 属性覆盖 :type is_merge: bool :rtype: :class:`VertexInfoByPk` .. automethod:: init_vertex_info_by_pk_and_property :param pk: 点pk :type pk: str :param type: 点类型 :type type: str :param property: 点属性 :type property: :class:`Optional` [:class:`Dict` [str, :class:`Any`]] :param is_merge: 为 ``True`` 时集合属性追加,为 ``False`` 属性覆盖 :type is_merge: bool :rtype: :class:`VertexInfoByPk` .. _EdgeDegreeInfo: EdgeDegreeInfo ======================= .. autoclass:: graphdbapi.v1.graph.query.EdgeDegreeInfo :show-inheritance: .. automethod:: get_degree_info key是边类型,value是对应类型的总degree数量 .. automethod:: get_degree 边的总度数值 .. _ResponseElementInfo: ResponseElementInfo ======================= .. autoclass:: graphdbapi.v1.graph.query.ResponseElementInfo :show-inheritance: .. automethod:: get_element_id 元素id .. automethod:: get_pk 元素为点时,对应的主键值 .. automethod:: get_type 元素对应的类型(点类型 or 边类型) .. automethod:: get_from_id 元素为边时,对应的起始点ID .. automethod:: get_to_id 元素为边时,对应的终止点ID .. automethod:: get_direct 元素为边时,对应边方向 .. automethod:: get_edge_property_map 元素为边时,对应的边属性 .. _QueryResult: QueryResult ======================= .. autoclass:: graphdbapi.v1.graph.query.bfs.QueryResult :show-inheritance: .. automethod:: get_vertex_set :return: 点集合 :rtype: :class:`Dict` [int, :ref:`ResponseElementInfo`] .. automethod:: get_edge_set :return: 边集合 :rtype: :class:`Dict` [str, :ref:`ResponseElementInfo`] .. automethod:: get_vertex_count 点总数 .. automethod:: get_edge_count 边总数 .. _PropertyFilter: PropertyFilter ======================= .. autoclass:: graphdbapi.v1.graph.query.condition.PropertyFilter :show-inheritance: .. automethod:: init_Property_filter :rtype: :class:`PropertyFilter` .. automethod:: add_filter_by_property_filter_info .. automethod:: add_filter_by_params .. _PropertyFilterInfo: PropertyFilterInfo ======================= .. autoclass:: graphdbapi.v1.graph.query.condition.PropertyFilterInfo :show-inheritance: .. automethod:: init_property_filter_info .. _VisitCondition: VisitCondition ======================= .. autoclass:: graphdbapi.v1.graph.query.condition.VisitCondition 条件过滤基类 .. _VisitConditionByProperty: VisitConditionByProperty ================================ .. autoclass:: graphdbapi.v1.graph.query.condition.VisitConditionByProperty :show-inheritance: .. automethod:: init_visit_condition_by_property .. _VisitConditionByType: VisitConditionByType ================================ .. autoclass:: graphdbapi.v1.graph.query.condition.VisitConditionByType :show-inheritance: .. automethod:: init_visit_condition_by_type .. _VisitConditionComposite: VisitConditionComposite ================================ .. autoclass:: graphdbapi.v1.graph.query.condition.VisitConditionComposite :show-inheritance: .. automethod:: init_visit_condition_composite .. _VisitConditionCompositeOr: VisitConditionCompositeOr ================================ .. autoclass:: graphdbapi.v1.graph.query.condition.VisitConditionCompositeOr :show-inheritance: .. automethod:: init_visit_condition_composite_or .. _BfsParam: BfsParam ===================== .. autoclass:: graphdbapi.v1.graph.query.bfs.BfsParam 由 :class:`BfsParamBuilder` 构建 :show-inheritance: .. _BfsParamBuilder: BfsParamBuilder ================================ .. autoclass:: graphdbapi.v1.graph.query.bfs.BfsParamBuilder BfsParam构建类 :show-inheritance: .. automethod:: builder .. automethod:: init_by_id .. automethod:: init_by_pk .. automethod:: set_limit_neighbor .. automethod:: set_limit_edge .. automethod:: set_hop .. automethod:: set_only_count .. automethod:: set_return_vertex .. automethod:: set_return_edge .. automethod:: set_direction .. automethod:: set_vertex_condition .. automethod:: set_edge_condition .. automethod:: set_edge_type_filter