graphscope.declare#

graphscope.declare(graphscope_type, variable)[source]#

Declare a GraphScope data type.

Parameters:
  • graphscope_type (graphscope.analytical.udf.GraphScopeType) – Valid options are graphscope.Vertex

  • variable – Python variable.

Examples

>>> @pie(vd_type="string", md_type="string")
>>> class MyAlgorithm(AppAssets):
>>>     @staticmethod
>>>     def Init(frag, context):
>>>         graphscope.declare(graphscope.Vertex, source)
>>>         # means `Vertex source;` in c++ code
>>>     @staticmethod
>>>     def PEval(frag, context):
>>>         pass
>>>     @staticmethod
>>>     def IncEval(frag, context):
>>>         pass