Struct py_raphtory::vertex::PyVertex
source · pub struct PyVertex { /* private fields */ }Expand description
A vertex (or node) in the graph.
Implementations§
source§impl PyVertex
impl PyVertex
Defines the Vertex, which represents a vertex in the graph.
A vertex is a node in the graph, and can have properties and edges.
It can also be used to navigate the graph.
sourcepub fn id(&self) -> u64
pub fn id(&self) -> u64
Returns the id of the vertex. This is a unique identifier for the vertex.
Returns: The id of the vertex as an integer.
sourcepub fn name(&self) -> String
pub fn name(&self) -> String
Returns the name of the vertex.
Returns: The name of the vertex as a string.
sourcepub fn earliest_time(&self) -> Option<i64>
pub fn earliest_time(&self) -> Option<i64>
Returns the earliest time that the vertex exists.
Arguments: None
Returns: The earliest time that the vertex exists as an integer.
sourcepub fn earliest_date_time(&self) -> Option<NaiveDateTime>
pub fn earliest_date_time(&self) -> Option<NaiveDateTime>
Returns the earliest datetime that the vertex exists.
Arguments: None
Returns: The earliest datetime that the vertex exists as an integer.
sourcepub fn latest_time(&self) -> Option<i64>
pub fn latest_time(&self) -> Option<i64>
Returns the latest time that the vertex exists.
Returns: The latest time that the vertex exists as an integer.
sourcepub fn latest_date_time(&self) -> Option<NaiveDateTime>
pub fn latest_date_time(&self) -> Option<NaiveDateTime>
Returns the latest datetime that the vertex exists.
Arguments: None
Returns: The latest datetime that the vertex exists as an integer.
sourcepub fn property(
&self,
name: String,
include_static: Option<bool>
) -> Option<Prop>
pub fn property( &self, name: String, include_static: Option<bool> ) -> Option<Prop>
Gets the property value of this vertex given the name of the property.
Arguments: name: The name of the property. include_static: Whether to include static properties. Defaults to true.
Returns:
The property value as a Prop object.
sourcepub fn property_history(&self, name: String) -> Vec<(i64, Prop)>
pub fn property_history(&self, name: String) -> Vec<(i64, Prop)>
Returns the history of a property value of a vertex at all times
Arguments: name: The name of the property.
Returns:
A list of tuples of the form (time, value) where time is an integer and value is a Prop object.
sourcepub fn properties(&self, include_static: Option<bool>) -> HashMap<String, Prop>
pub fn properties(&self, include_static: Option<bool>) -> HashMap<String, Prop>
Returns all the properties of the vertex as a dictionary.
Arguments: include_static: Whether to include static properties. Defaults to true.
Returns:
A dictionary of the form {name: value} where name is a string and value is a Prop object.
sourcepub fn property_histories(&self) -> HashMap<String, Vec<(i64, Prop)>>
pub fn property_histories(&self) -> HashMap<String, Vec<(i64, Prop)>>
Returns all the properties of the vertex as a dictionary including the history of each property.
Arguments: include_static: Whether to include static properties. Defaults to true.
Returns:
A dictionary of the form {name: [(time, value)]} where name is a string, time is an integer, and value is a Prop object.
sourcepub fn property_names(&self, include_static: Option<bool>) -> Vec<String>
pub fn property_names(&self, include_static: Option<bool>) -> Vec<String>
Returns the names of all the properties of the vertex.
Arguments: include_static: Whether to include static properties. Defaults to true.
Returns: A list of strings of propert names.
sourcepub fn has_property(&self, name: String, include_static: Option<bool>) -> bool
pub fn has_property(&self, name: String, include_static: Option<bool>) -> bool
Checks if a property exists on this vertex.
Arguments: name: The name of the property. include_static: Whether to include static properties. Defaults to true.
Returns: True if the property exists, false otherwise.
sourcepub fn has_static_property(&self, name: String) -> bool
pub fn has_static_property(&self, name: String) -> bool
Checks if a static property exists on this vertex.
Arguments: name: The name of the property.
Returns: True if the property exists, false otherwise.
sourcepub fn static_property(&self, name: String) -> Option<Prop>
pub fn static_property(&self, name: String) -> Option<Prop>
Returns the static property value of this vertex given the name of the property.
Arguments: name: The name of the property.
Returns:
The property value as a Prop object or None if the property does not exist.
sourcepub fn degree(&self) -> usize
pub fn degree(&self) -> usize
Get the degree of this vertex (i.e., the number of edges that are incident to it).
Returns The degree of this vertex.
sourcepub fn in_degree(&self) -> usize
pub fn in_degree(&self) -> usize
Get the in-degree of this vertex (i.e., the number of edges that are incident to it from other vertices).
Returns: The in-degree of this vertex.
sourcepub fn out_degree(&self) -> usize
pub fn out_degree(&self) -> usize
Get the out-degree of this vertex (i.e., the number of edges that are incident to it from this vertex).
Returns: The out-degree of this vertex.
sourcepub fn edges(&self) -> PyEdges
pub fn edges(&self) -> PyEdges
Get the edges that are pointing to or from this vertex.
Returns:
A list of Edge objects.
sourcepub fn in_edges(&self) -> PyEdges
pub fn in_edges(&self) -> PyEdges
Get the edges that are pointing to this vertex.
Returns:
A list of Edge objects.
sourcepub fn out_edges(&self) -> PyEdges
pub fn out_edges(&self) -> PyEdges
Get the edges that are pointing from this vertex.
Returns:
A list of Edge objects.
sourcepub fn neighbours(&self) -> PyPathFromVertex
pub fn neighbours(&self) -> PyPathFromVertex
Get the neighbours of this vertex.
Returns:
A list of Vertex objects.
sourcepub fn in_neighbours(&self) -> PyPathFromVertex
pub fn in_neighbours(&self) -> PyPathFromVertex
Get the neighbours of this vertex that are pointing to it.
Returns:
A list of Vertex objects.
sourcepub fn out_neighbours(&self) -> PyPathFromVertex
pub fn out_neighbours(&self) -> PyPathFromVertex
Get the neighbours of this vertex that are pointing from it.
Returns:
A list of Vertex objects.
sourcepub fn start(&self) -> Option<i64>
pub fn start(&self) -> Option<i64>
Gets the earliest time that this vertex is valid.
Returns: The earliest time that this vertex is valid or None if the vertex is valid for all times.
sourcepub fn start_date_time(&self) -> Option<NaiveDateTime>
pub fn start_date_time(&self) -> Option<NaiveDateTime>
Gets the earliest datetime that this vertex is valid
Returns: The earliest datetime that this vertex is valid or None if the vertex is valid for all times.
sourcepub fn end(&self) -> Option<i64>
pub fn end(&self) -> Option<i64>
Gets the latest time that this vertex is valid.
Returns: The latest time that this vertex is valid or None if the vertex is valid for all times.
sourcepub fn end_date_time(&self) -> Option<NaiveDateTime>
pub fn end_date_time(&self) -> Option<NaiveDateTime>
Gets the latest datetime that this vertex is valid
Returns: The latest datetime that this vertex is valid or None if the vertex is valid for all times.
sourcepub fn window(
&self,
t_start: Option<&PyAny>,
t_end: Option<&PyAny>
) -> PyResult<PyVertex>
pub fn window( &self, t_start: Option<&PyAny>, t_end: Option<&PyAny> ) -> PyResult<PyVertex>
Create a view of the vertex including all events between t_start (inclusive) and t_end (exclusive)
Arguments: t_start (int): The start time of the window. Defaults to the start time of the vertex. t_end (int): The end time of the window. Defaults to the end time of the vertex.
Returns:
A PyVertex object.
sourcepub fn at(&self, end: &PyAny) -> PyResult<PyVertex>
pub fn at(&self, end: &PyAny) -> PyResult<PyVertex>
Create a view of the vertex including all events at t.
Arguments: end (int): The time of the window.
Returns:
A PyVertex object.
sourcepub fn default_layer(&self) -> PyVertex
pub fn default_layer(&self) -> PyVertex
Create a view including all the edges in the default layer
Returns: a view including all the edges in the default layer
sourcepub fn layer(&self, name: &str) -> Option<PyVertex>
pub fn layer(&self, name: &str) -> Option<PyVertex>
Create a view including all the edges in the layer name
Arguments: name (str) : the name of the layer
Returns:
a view including all the edges in the layer name
sourcepub fn history(&self) -> Vec<i64>
pub fn history(&self) -> Vec<i64>
Returns the history of a vertex, including vertex additions and changes made to vertex.
Returns: A list of timestamps of the event history of vertex.
pub fn __getitem__(&self, name: String) -> Option<Prop>
Trait Implementations§
source§impl<G: GraphViewOps + IntoDynamic> From<VertexView<G>> for PyVertex
impl<G: GraphViewOps + IntoDynamic> From<VertexView<G>> for PyVertex
source§fn from(value: VertexView<G>) -> Self
fn from(value: VertexView<G>) -> Self
source§impl PyClassImpl for PyVertex
impl PyClassImpl for PyVertex
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type ThreadChecker = ThreadCheckerStub<PyVertex>
type ThreadChecker = ThreadCheckerStub<PyVertex>
type Inventory = Pyo3MethodsInventoryForPyVertex
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl PyTypeInfo for PyVertex
impl PyTypeInfo for PyVertex
§type AsRefTarget = PyCell<PyVertex>
type AsRefTarget = PyCell<PyVertex>
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
object is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
object is an instance of this type.