和顺 / 衡律 返回所属 Agent
5.1

投资世界的状态表示

原能力

记录企业、资产、主体、关系和状态,区分已知事实、推断及未知事项。(合同附件 R7 5.1)

首选项目

CKAN(AGPL-3.0)。 CKAN

匹配范围

资源元数据、实体与关系节点表达投资世界。

源码

CKAN · def package_create(

ckan/logic/action/package.py · 39–52 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def package_create(context: Context, data_dict: DataDict) -> ActionResult.PackageCreate:  # noqa: C901
    """Create a new package.

    You must be authorized to create new packages. If you specify any groups
    for the new package, you must also be authorized to edit these groups.

    Plugins may change the parameters of this function depending on the value
    of the ``type`` parameter, see the
    :py:class:`~ckan.plugins.interfaces.IDatasetForm` plugin interface.

    :param name: the name of the new package, must be between 2 and 100
        characters long and contain only lowercase alphanumeric characters,
        ``-`` and ``_``, e.g. ``'warandpeace'``
    :type name: string

NetworkX · def add_edge(

networkx/classes/digraph.py · 676–689 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
    def add_edge(self, u_of_edge, v_of_edge, **attr):
        """Add an edge between u and v.

        The nodes u and v will be automatically added if they are
        not already in the graph.

        Edge attributes can be specified with keywords or by directly
        accessing the edge's attribute dictionary. See examples below.

        Parameters
        ----------
        u_of_edge, v_of_edge : nodes
            Nodes can be, for example, strings or numbers.
            Nodes must be hashable (and not None) Python objects.

实现与验收要点

事实/推断/未知状态、主体权威及专有关系域。