snapchat.research.gbml.graph_schema_pb2#
@generated by mypy-protobuf. Do not edit manually! isort:skip_file
Attributes#
Classes#
| Abstract base class for protocol messages. | |
| Abstract base class for protocol messages. | |
| Represents a graph; usually used to represent a rooted k-hop subgraph for a bigger graph | |
| Stores metadata that helps map the created graph samples back to original graph | |
| Abstract base class for protocol messages. | 
Module Contents#
- class snapchat.research.gbml.graph_schema_pb2.Edge(*, src_node_id=..., dst_node_id=..., condensed_edge_type=..., feature_values=...)[source]#
- Bases: - google.protobuf.message.Message- Abstract base class for protocol messages. - Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. - Parameters:
- src_node_id (int) 
- dst_node_id (int) 
- condensed_edge_type (int | None) 
- feature_values (collections.abc.Iterable[float] | None) 
 
 - ClearField(field_name)[source]#
- Clears the contents of a given field. - Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group, - ValueErroris raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Raises:
- ValueError – if the field_name is not a member of this message. 
- Return type:
- None 
 
 - HasField(field_name)[source]#
- Checks if a certain field is set for the message. - For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, - ValueErrorwill be raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Returns:
- Whether a value has been set for the named field. 
- Return type:
- bool 
- Raises:
- ValueError – if the field_name is not a member of this message. 
 
 - WhichOneof(oneof_group)[source]#
- Returns the name of the field that is set inside a oneof group. - If no field is set, returns None. - Parameters:
- oneof_group (str) – the name of the oneof group to check. 
- Returns:
- The name of the group that is set, or None. 
- Return type:
- str or None 
- Raises:
- ValueError – no group with the given name exists 
 
 - condensed_edge_type: int[source]#
- Graph is assumed homogeneous if condensed_edge_type is not provided We store condensed representation here instead of EdgeType to optimize on storage space. Otherwise we would be storing atleast 3*32bytes of information : ( - src_node_type: string, dst_node_type: string, edge_type: string - ) See GraphMetadata for mapping 
 
- class snapchat.research.gbml.graph_schema_pb2.EdgeType(*, relation=..., src_node_type=..., dst_node_type=...)[source]#
- Bases: - google.protobuf.message.Message- Abstract base class for protocol messages. - Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. - Parameters:
- relation (str) 
- src_node_type (str) 
- dst_node_type (str) 
 
 - ClearField(field_name)[source]#
- Clears the contents of a given field. - Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group, - ValueErroris raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Raises:
- ValueError – if the field_name is not a member of this message. 
- Return type:
- None 
 
 
- class snapchat.research.gbml.graph_schema_pb2.Graph(*, nodes=..., edges=...)[source]#
- Bases: - google.protobuf.message.Message- Represents a graph; usually used to represent a rooted k-hop subgraph for a bigger graph - Parameters:
- nodes (collections.abc.Iterable[global___Node] | None) 
- edges (collections.abc.Iterable[global___Edge] | None) 
 
 - ClearField(field_name)[source]#
- Clears the contents of a given field. - Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group, - ValueErroris raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Raises:
- ValueError – if the field_name is not a member of this message. 
- Return type:
- None 
 
 
- class snapchat.research.gbml.graph_schema_pb2.GraphMetadata(*, node_types=..., edge_types=..., condensed_edge_type_map=..., condensed_node_type_map=...)[source]#
- Bases: - google.protobuf.message.Message- Stores metadata that helps map the created graph samples back to original graph - Parameters:
- node_types (collections.abc.Iterable[str] | None) 
- edge_types (collections.abc.Iterable[global___EdgeType] | None) 
- condensed_edge_type_map (collections.abc.Mapping[int, global___EdgeType] | None) 
- condensed_node_type_map (collections.abc.Mapping[int, str] | None) 
 
 - class CondensedEdgeTypeMapEntry(*, key=..., value=...)[source]#
- Bases: - google.protobuf.message.Message- Abstract base class for protocol messages. - Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. - Parameters:
- key (int) 
- value (global___EdgeType | None) 
 
 - ClearField(field_name)[source]#
- Clears the contents of a given field. - Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group, - ValueErroris raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Raises:
- ValueError – if the field_name is not a member of this message. 
- Return type:
- None 
 
 - HasField(field_name)[source]#
- Checks if a certain field is set for the message. - For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, - ValueErrorwill be raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Returns:
- Whether a value has been set for the named field. 
- Return type:
- bool 
- Raises:
- ValueError – if the field_name is not a member of this message. 
 
 
 - class CondensedNodeTypeMapEntry(*, key=..., value=...)[source]#
- Bases: - google.protobuf.message.Message- Abstract base class for protocol messages. - Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. - Parameters:
- key (int) 
- value (str) 
 
 - ClearField(field_name)[source]#
- Clears the contents of a given field. - Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group, - ValueErroris raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Raises:
- ValueError – if the field_name is not a member of this message. 
- Return type:
- None 
 
 
 - ClearField(field_name)[source]#
- Clears the contents of a given field. - Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group, - ValueErroris raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Raises:
- ValueError – if the field_name is not a member of this message. 
- Return type:
- None 
 
 - property condensed_edge_type_map: google.protobuf.internal.containers.MessageMap[int, global___EdgeType][source]#
- EdgeType; 1:1 mapping We use unit32 instead of EdgeType to save space when storing graph information - Type:
- Maps condensed_edge_type 
- Type:
- uint32 to edge_type 
- Return type:
- google.protobuf.internal.containers.MessageMap[int, global___EdgeType] 
 
 - property condensed_node_type_map: google.protobuf.internal.containers.ScalarMap[int, str][source]#
- string; 1:1 mapping We use unit32 instead of string to save space when storing graph information - Type:
- Maps condensed_node_type 
- Type:
- uint32 to node_type 
- Return type:
- google.protobuf.internal.containers.ScalarMap[int, str] 
 
 
- class snapchat.research.gbml.graph_schema_pb2.Node(*, node_id=..., condensed_node_type=..., feature_values=...)[source]#
- Bases: - google.protobuf.message.Message- Abstract base class for protocol messages. - Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. - Parameters:
- node_id (int) 
- condensed_node_type (int | None) 
- feature_values (collections.abc.Iterable[float] | None) 
 
 - ClearField(field_name)[source]#
- Clears the contents of a given field. - Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group, - ValueErroris raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Raises:
- ValueError – if the field_name is not a member of this message. 
- Return type:
- None 
 
 - HasField(field_name)[source]#
- Checks if a certain field is set for the message. - For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, - ValueErrorwill be raised.- Parameters:
- field_name (str) – The name of the field to check for presence. 
- Returns:
- Whether a value has been set for the named field. 
- Return type:
- bool 
- Raises:
- ValueError – if the field_name is not a member of this message. 
 
 - WhichOneof(oneof_group)[source]#
- Returns the name of the field that is set inside a oneof group. - If no field is set, returns None. - Parameters:
- oneof_group (str) – the name of the oneof group to check. 
- Returns:
- The name of the group that is set, or None. 
- Return type:
- str or None 
- Raises:
- ValueError – no group with the given name exists 
 
 - condensed_node_type: int[source]#
- string See GraphMetadata for mapping. If not provided, assumed homogeneous. - Type:
- condensed_node_type are integer values that correspond 1 
- Type:
- 1 to a node_type 
 
 
