类文档

class GephiGraphStreamingAPIFormat: (源代码)

在继承层次结构中查看

实现 Gephi 图流 API 格式并返回与 API 中定义的事件相对应的 Python 对象的对象。

方法 get_add_edge_event 生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中添加具有给定源、目标、有向性和属性的边的事件。
方法 get_add_node_event 生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中添加具有给定标识符和属性的节点的事件。
方法 get_change_edge_event 生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中更改某些边属性的事件。给定的属性将合并到现有属性中;使用 C{None} 作为属性值来删除给定属性。
方法 get_change_node_event 生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中更改某些节点属性的事件。给定的属性将合并到现有属性中;使用 C{None} 作为属性值来删除给定属性。
方法 get_delete_edge_event 生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中删除具有给定标识符的边的事件。
方法 get_delete_node_event 生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中删除具有给定标识符的节点的事件。
def get_add_edge_event(self, identifier, source, target, directed, attributes=None): (源代码)

生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中添加具有给定源、目标、有向性和属性的边的事件。

def get_add_node_event(self, identifier, attributes=None): (源代码)

生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中添加具有给定标识符和属性的节点的事件。

示例

>>> api = GephiGraphStreamingAPIFormat()
>>> api.get_add_node_event("spam")
{'an': {'spam': {}}}
>>> api.get_add_node_event("spam", dict(ham="eggs"))
{'an': {'spam': {'ham': 'eggs'}}}
def get_change_edge_event(self, identifier, attributes): (源代码)

生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中更改某些边属性的事件。给定的属性将合并到现有属性中;使用 C{None} 作为属性值来删除给定属性。

示例

>>> api = GephiGraphStreamingAPIFormat()
>>> api.get_change_edge_event("spam", dict(ham="eggs"))
{'ce': {'spam': {'ham': 'eggs'}}}
>>> api.get_change_edge_event("spam", dict(ham=None))
{'ce': {'spam': {'ham': None}}}
def get_change_node_event(self, identifier, attributes): (源代码)

生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中更改某些节点属性的事件。给定的属性将合并到现有属性中;使用 C{None} 作为属性值来删除给定属性。

示例

>>> api = GephiGraphStreamingAPIFormat()
>>> api.get_change_node_event("spam", dict(ham="eggs"))
{'cn': {'spam': {'ham': 'eggs'}}}
>>> api.get_change_node_event("spam", dict(ham=None))
{'cn': {'spam': {'ham': None}}}
def get_delete_edge_event(self, identifier): (源代码)

生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中删除具有给定标识符的边的事件。

示例

>>> api = GephiGraphStreamingAPIFormat()
>>> api.get_delete_edge_event("spam:ham")
{'de': {'spam:ham': {}}}
def get_delete_node_event(self, identifier): (源代码)

生成一个 Python 对象,该对象对应于在 Gephi 图流 API 中删除具有给定标识符的节点的事件。

示例

>>> api = GephiGraphStreamingAPIFormat()
>>> api.get_delete_node_event("spam")
{'dn': {'spam': {}}}