Graph¶
Abstract base class for client-specific implementations.
- class bulbs.base.graph.Graph(config=None)[source]¶
Abstract base class for the server-specific Graph implementations.
Parameters: config (Config) – Optional Config object. Defaults to the default config.
Variables: - client_class – Client class.
- default_index – Default index class.
- client – Client object.
- config – Config object.
- vertices – VertexProxy object.
- edges – EdgeProxy object.
Example:
>>> from bulbs.neo4jserver import Graph >>> g = Graph() >>> james = g.vertices.create(name="James") >>> julie = g.vertices.create(name="Julie") >>> g.edges.create(james, "knows", julie)
- client_class¶
alias of Client
- default_index¶
alias of Index
- add_proxy(proxy_name, element_class, index_class=None)[source]¶
Adds an element proxy to the Graph object for the element class.
Parameters: - proxy_name (str) – Attribute name to use for the proxy.
- element_class (Element) – Element class managed by this proxy.
- index_class (Index) – Index class for Element’s primary index. Defaults to default_index.
Return type: None
- build_proxy(element_class, index_class=None)[source]¶
Returns an element proxy built to specifications.
Parameters: - element_class (Element) – Element class managed by this proxy.
- index_class (Index) – Optional Index class for Element’s primary index. Defaults to default_index.
Return type: Element proxy
- load_graphml(uri)[source]¶
Loads a GraphML file into the database and returns the response.
Parameters: uri (str) – URI of the GraphML file. Return type: Response