MCPcopy Create free account
hub / github.com/alibaba/GraphScope / g

Method g

python/graphscope/client/session.py:1104–1156  ·  view source on GitHub ↗

Construct a GraphScope graph object on the default session. It will launch and set a session to default when there is no default session found. See params detail in :class:`graphscope.framework.graph.GraphDAGNode` Returns: :class:`graphscope.framework.graph.Gra

(
        self,
        incoming_data=None,
        oid_type="int64",
        vid_type="uint64",
        directed=True,
        generate_eid=True,
        retain_oid=True,
        vertex_map="global",
        compact_edges=False,
        use_perfect_hash=False,
    )

Source from the content-addressed store, hash-verified

1102 return self._vineyard_object_mapping_table
1103
1104 def g(
1105 self,
1106 incoming_data=None,
1107 oid_type="int64",
1108 vid_type="uint64",
1109 directed=True,
1110 generate_eid=True,
1111 retain_oid=True,
1112 vertex_map="global",
1113 compact_edges=False,
1114 use_perfect_hash=False,
1115 ) -> Union[Graph, GraphDAGNode]:
1116 """Construct a GraphScope graph object on the default session.
1117
1118 It will launch and set a session to default when there is no default session found.
1119
1120 See params detail in :class:`graphscope.framework.graph.GraphDAGNode`
1121
1122 Returns:
1123 :class:`graphscope.framework.graph.GraphDAGNode`: Evaluated in eager mode.
1124
1125 Examples:
1126
1127 .. code:: python
1128
1129 >>> import graphscope
1130 >>> g = graphscope.g()
1131
1132 >>> import graphscope
1133 >>> sess = graphscope.session()
1134 >>> g = sess.g() # creating graph on the session "sess"
1135 """
1136 if (
1137 isinstance(incoming_data, vineyard.ObjectID)
1138 and repr(incoming_data) in self._vineyard_object_mapping_table
1139 ):
1140 graph_vineyard_id = self._vineyard_object_mapping_table[repr(incoming_data)]
1141 logger.info("Restore graph from original graph: %s", graph_vineyard_id)
1142 incoming_data = vineyard.ObjectID(graph_vineyard_id)
1143 return self._wrapper(
1144 GraphDAGNode(
1145 self,
1146 incoming_data,
1147 oid_type,
1148 vid_type,
1149 directed,
1150 generate_eid,
1151 retain_oid,
1152 vertex_map,
1153 compact_edges,
1154 use_perfect_hash,
1155 )
1156 )
1157
1158 def load_from(self, *args, **kwargs):
1159 """Load a graph within the session.

Callers 15

gFunction · 0.45
load_fromFunction · 0.45
load_ppiFunction · 0.45
load_ogbn_arxivFunction · 0.45
load_modern_graphFunction · 0.45
load_p2p_networkFunction · 0.45
load_ogbl_ddiFunction · 0.45
load_ogbl_collabFunction · 0.45
load_coraFunction · 0.45
load_ogbn_proteinsFunction · 0.45
load_u2iFunction · 0.45
load_ogbn_magFunction · 0.45

Calls 3

_wrapperMethod · 0.95
GraphDAGNodeClass · 0.90
infoMethod · 0.45