File size: 3,781 Bytes
9b44a02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
### Document 2: Unified Command Logic for AGDB

# Unified Command Logic for AGDB

This document details the command structure for interacting with AGDB, covering CRUD operations, querying, managing synthetic relationships, setting policies, and more. Each command is structured in a noun-verb format, following PowerShell-style syntax.

## Command Categories

1. **Graph Management Commands**
2. **Node and Relationship Management**
3. **Attribute and Domain Commands**
4. **Query and Retrieval Commands**
5. **Policy Management**

---

### 1. Graph Management Commands

#### `create-graph`
- **Description**: Initializes a new graph, specifying the type and metadata.
- **Usage**: `create-graph -name "financial_time_series" -type "AGDB"`
- **Example**:
  ```plaintext
  create-graph -name "financial_time_series" -type "AGDB" -attributes ["Open", "Close", "Volume"]
  ```

#### `load-graph`
- **Description**: Loads an existing graph from JSON or CSV.
- **Usage**: `load-graph -file "path/to/graph.json"`
- **Example**:
  ```plaintext
  load-graph -file "graphs/trading_data.json"
  ```

---

### 2. Node and Relationship Management

#### `create-node`
- **Description**: Adds a node to the graph, defining its type, domain, and attributes.
- **Usage**: `create-node -id "node_001" -type "TimeSeriesNode" -domain "TradingData"`
- **Example**:
  ```plaintext
  create-node -id "node_001" -attributes {"open": 50, "close": 55, "volume": 5000}
  ```

#### `create-relationship`
- **Description**: Establishes a relationship between two nodes.
- **Usage**: `create-relationship -from "node_001" -to "node_002" -type "temporal_sequence"`
- **Example**:
  ```plaintext
  create-relationship -from "node_001" -to "node_002" -type "next"
  ```

---

### 3.

 Attribute and Domain Commands

#### `set-attribute`
- **Description**: Modifies or sets attributes for a node.
- **Usage**: `set-attribute -node "node_001" -attributes {"volume": 6000}`
- **Example**:
  ```plaintext
  set-attribute -node "node_001" -attributes {"open": 52, "high": 60}
  ```

#### `set-domain`
- **Description**: Assigns a domain to a node or graph.
- **Usage**: `set-domain -graph "financial_time_series" -name "Trading"`
- **Example**:
  ```plaintext
  set-domain -node "node_001" -name "Finance"
  ```

---

### 4. Query and Retrieval Commands

#### `get-node`
- **Description**: Retrieves data for a specific node.
- **Usage**: `get-node -id "node_001"`
- **Example**:
  ```plaintext
  get-node -id "node_001" -attributes ["open", "close"]
  ```

#### `get-relationship`
- **Description**: Retrieves relationships for a node.
- **Usage**: `get-relationship -node "node_001" -type "temporal_sequence"`
- **Example**:
  ```plaintext
  get-relationship -node "node_001" -direction "outgoing"
  ```

---

### 5. Policy Management

#### `set-policy`
- **Description**: Defines or updates a policy for relationship inferences.
- **Usage**: `set-policy -name "trading_inference" -rules {"time_series_trend": {...}}`
- **Example**:
  ```plaintext
  set-policy -name "trading_inference" -rules {"volatility_correlation": {"weight_threshold": 0.5}}
  ```

#### `apply-policy`
- **Description**: Executes a policy-based query.
- **Usage**: `apply-policy -name "trading_inference" -target "node_001"`
- **Example**:
  ```plaintext
  apply-policy -name "similar_patterns" -target "node_001"
  ```

---

### Summary

This unified command structure allows for robust interaction with AGDB, enabling users to perform a wide range of operations from graph creation and management to complex query and retrieval operations. By using a straightforward noun-verb syntax, the command logic is accessible and scalable across various data structures, making AGDB a powerful tool for data-driven insights across multiple domains.