Installation¶
Introduction âšī¸¶
The Euler Graph Database is a knowledge graph viewer that allows users to create, visualize, and manage knowledge graphs. It provides an interactive graphical user interface (GUI) for performing various operations on the knowledge graph such as adding nodes and edges, executing queries, and visualizing the graph.
Installation đģ¶
- Install the Package:
pip install euler-database
Running the Application đ¶
To run the application, use the following command:
eulerdb
User Guide¶
Main Interface¶
The main interface of the application consists of the following components:
- Header: Displays the application name and logo.
- Navbar: Provides options to load, visualize, add nodes, add edges, save the graph, and display help/about information.
- Query Entry: A text area to enter queries.
- Buttons:
- Execute Query
: Executes the entered query.
- Save Query
: Saves the entered queries to a file.
- Load Query
: Loads queries from a file.
- Output Areas:
- Query Output
: Displays the results of executed queries.
- JSON Output
: Displays the JSON representation of the current graph.
Loading a Graph đ¶
- Click on the
Load Graph
button in the navbar. - Select the file containing the graph you want to load.
Visualizing a Graph¶
- After loading a graph, click on the
Visualize Graph
button in the navbar. - The graph will be displayed in the visualization area.
Adding Nodes¶
Adding Edges¶
Saving a Graph¶
- Click on the
Save Graph
button in the navbar. - Choose the location to save the graph file.
Executing Queries¶
- Enter your query in the
Query Entry
area. - Click the
Execute Query
button. - The result of the query will be displayed in the
Query Output
area.
Saving Queries¶
- Enter your queries in the
Query Entry
area. - Click the
Save Query
button. - Choose the location to save the queries file (with
.euler
extension).
Loading Queries¶
- Click the
Load Query
button. - Select the file containing the queries.
- The queries will be loaded into the
Query Entry
area.
Example:¶
from euler.graph_api import KnowledgeGraphAPI
from euler.query_parser import QueryParser
from euler.query_executor import QueryExecutor
# Initialize API and related components
api = KnowledgeGraphAPI()
parser = QueryParser(api.graph)
executor = QueryExecutor(api.graph)
# Add nodes and edges
api.create_node('1', 'Person', {'name': 'Alice'})
api.create_node('2', 'Person', {'name': 'Bob'})
api.create_edge('1', '1', '2', 'knows')
# Query the graph
result = executor.execute_query('FIND (n)-[r]->(m)')
print(result)