This module provide a set of concepts to add properties to graph elements

class core.graph.property_graph.PropertyGraph(graph=None)[source]

Bases: core.graph.interface.property_graph.IPropertyGraph, core.graph.graph.Graph

simple implementation of IPropertyGraph using dict as properties and two dictionaries to maintain these properties

add_edge_property(property_name)[source]

add a new map between eid and a data do not fill this property for any edge

add_vertex_property(property_name)[source]

add a new map between vid and a data do not fill this property for any vertex

clear()[source]

remove all vertices and edges don't change references to objects

clear_edges()[source]

remove all the edges of the graph don't change references to objects

edge_property(property_name)[source]

return a map between eid and data for all edges where property_name is defined

Return type:dict of {eid:data}
edge_property_names()[source]

iter on names of all property maps defined on edge return iter of keys

extend(graph)[source]

add the specified graph to self, create new vid and eid

Parameters:graph (Graph) -- the graph to add
Returns:two dictionnary specifying correspondence between graph id and self id
Return type:({vid:vid},{eid:eid})
remove_edge(eid)[source]

remove a specified edge from the graph

Parameters:eid (eid) -- id of the edge to remove
remove_edge_property(property_name)[source]

remove the map called property_name from the graph

remove_vertex(vid)[source]

remove a specified vertex of the graph remove all the edges attached to it

Parameters:vid (vid) -- the id of the vertex to remove
remove_vertex_property(property_name)[source]

remove the map called property_name from the graph

vertex_property(property_name)[source]

return a map between vid and data for all vertices where property_name is defined

Return type:dict of {vid:data}
vertex_property_names()[source]

iter on names of all property maps defined on vertices return iter of keys

Previous topic

<no title>

Next topic

core.interpreter package

This Page