@yottagraph-app/elemental-api-skill 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/index.js +29 -0
- package/package.json +25 -0
- package/skill/SKILL.md +37 -0
- package/skill/articles.md +386 -0
- package/skill/entities.md +360 -0
- package/skill/events.md +145 -0
- package/skill/find.md +279 -0
- package/skill/graph.md +239 -0
- package/skill/llm.md +18 -0
- package/skill/overview.md +51 -0
- package/skill/relationships.md +308 -0
- package/skill/schema.md +351 -0
- package/skill/sentiment.md +93 -0
- package/skill/server.md +186 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# Relationships
|
|
2
|
+
|
|
3
|
+
Relationships (also called "links") represent connections between entities in the Knowledge Graph. These connections are derived from articles.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- You want to find entities connected to a given entity
|
|
8
|
+
- You need to understand how two entities are related
|
|
9
|
+
- You're exploring a network of connections (e.g., "Who is connected to this person?")
|
|
10
|
+
- You need link counts or relationship strength between entities
|
|
11
|
+
|
|
12
|
+
## Key Concepts
|
|
13
|
+
|
|
14
|
+
- **Linked Entities**: Other entities that have a relationship with a given entity
|
|
15
|
+
- **Link Strength**: Represents the significance of the relationship between two entities
|
|
16
|
+
- **Link Counts**: Number of connections between entity pairs, useful for measuring relationship strength
|
|
17
|
+
- **Relationship Types**: Common types include:
|
|
18
|
+
- `competes_with`
|
|
19
|
+
- `compares_to`
|
|
20
|
+
- `customer_of`
|
|
21
|
+
- `partnered_with`
|
|
22
|
+
- `trades_with`
|
|
23
|
+
- `invests_in`
|
|
24
|
+
- `is_related_to`
|
|
25
|
+
- `sues`
|
|
26
|
+
- `provides_support_to`
|
|
27
|
+
|
|
28
|
+
## Tips
|
|
29
|
+
|
|
30
|
+
- Relationships are bidirectional—if A links to B, B links to A
|
|
31
|
+
- High link counts indicate stronger or more frequent connections in the news
|
|
32
|
+
- Use with graph endpoints to visualize relationship networks
|
|
33
|
+
|
|
34
|
+
<!-- BEGIN GENERATED CONTENT -->
|
|
35
|
+
|
|
36
|
+
## Endpoints
|
|
37
|
+
|
|
38
|
+
### Get linked entities
|
|
39
|
+
|
|
40
|
+
`GET /entities/{source_neid}/linked`
|
|
41
|
+
|
|
42
|
+
Get list of entities linked to a source entity, optionally filtered by entity type and link type
|
|
43
|
+
|
|
44
|
+
#### Parameters
|
|
45
|
+
|
|
46
|
+
| Name | Type | Required | Description |
|
|
47
|
+
|------|------|----------|-------------|
|
|
48
|
+
| source_neid | string | yes | Source entity NEID |
|
|
49
|
+
| entity_type | string[] | no | Filter by entity type(s) |
|
|
50
|
+
| link_type | string[] | no | Filter by link type(s) |
|
|
51
|
+
|
|
52
|
+
#### Responses
|
|
53
|
+
|
|
54
|
+
| Status | Description |
|
|
55
|
+
|--------|-------------|
|
|
56
|
+
| 200 | List of linked entity NEIDs (`GetLinkedEntitiesResponse`) |
|
|
57
|
+
| 400 | Invalid parameters (`Error`) |
|
|
58
|
+
| 404 | Source entity not found (`Error`) |
|
|
59
|
+
| 500 | Internal server error (`Error`) |
|
|
60
|
+
|
|
61
|
+
#### Example
|
|
62
|
+
|
|
63
|
+
**Request:**
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
GET /entities/00416400910670863867/linked
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Response:**
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{"entities": ["00416400910670863867"]}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### Get links between entities
|
|
78
|
+
|
|
79
|
+
`GET /entities/{source_neid}/links/{target_neid}`
|
|
80
|
+
|
|
81
|
+
Get list of links between source and target entities, optionally filtered by link type
|
|
82
|
+
|
|
83
|
+
#### Parameters
|
|
84
|
+
|
|
85
|
+
| Name | Type | Required | Description |
|
|
86
|
+
|------|------|----------|-------------|
|
|
87
|
+
| source_neid | string | yes | Source entity NEID |
|
|
88
|
+
| target_neid | string | yes | Target entity NEID |
|
|
89
|
+
| link_type | string[] | no | Filter by link type(s) |
|
|
90
|
+
| include_mentions | boolean | no | Include mention details in response |
|
|
91
|
+
| include_articles | boolean | no | Include article details in response |
|
|
92
|
+
|
|
93
|
+
#### Responses
|
|
94
|
+
|
|
95
|
+
| Status | Description |
|
|
96
|
+
|--------|-------------|
|
|
97
|
+
| 200 | List of entity links (`GetLinksResponse`) |
|
|
98
|
+
| 400 | Invalid parameters (`Error`) |
|
|
99
|
+
| 404 | Source or target entity not found (`Error`) |
|
|
100
|
+
| 500 | Internal server error (`Error`) |
|
|
101
|
+
|
|
102
|
+
#### Example
|
|
103
|
+
|
|
104
|
+
**Request:**
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
GET /entities/00416400910670863867/links/04358848009837283240
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Response:**
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{"links": []}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### Get graph layout
|
|
119
|
+
|
|
120
|
+
`GET /graph/{center_neid}/layout`
|
|
121
|
+
|
|
122
|
+
Get nodes and edges layout data for visualizing a relationship graph. Response is cached for 5 minutes.
|
|
123
|
+
|
|
124
|
+
#### Guidance
|
|
125
|
+
|
|
126
|
+
Only use this endpoint if you care about graph-specific properties. Otherwise it is faster to use /entities/{source_neid}/links/{target_neid}. This should always be called with a non-empty list of neids. A typical pattern is to call /graph/{center_neid}/neighborhood and then use the returned NEIDs to call this endpoint.
|
|
127
|
+
|
|
128
|
+
#### Parameters
|
|
129
|
+
|
|
130
|
+
| Name | Type | Required | Description |
|
|
131
|
+
|------|------|----------|-------------|
|
|
132
|
+
| center_neid | string | yes | Center entity NEID |
|
|
133
|
+
| neid | string[] | no | Additional entity NEIDs to include in layout |
|
|
134
|
+
| borderMinX | number | no | Minimum X border for layout |
|
|
135
|
+
| borderMinY | number | no | Minimum Y border for layout |
|
|
136
|
+
| borderMaxX | number | no | Maximum X border for layout |
|
|
137
|
+
| borderMaxY | number | no | Maximum Y border for layout |
|
|
138
|
+
|
|
139
|
+
#### Responses
|
|
140
|
+
|
|
141
|
+
| Status | Description |
|
|
142
|
+
|--------|-------------|
|
|
143
|
+
| 200 | Graph layout with nodes and edges (`GraphLayoutResponse`) |
|
|
144
|
+
| 400 | Invalid parameters (`Error`) |
|
|
145
|
+
| 500 | Internal server error (`Error`) |
|
|
146
|
+
|
|
147
|
+
#### Example
|
|
148
|
+
|
|
149
|
+
**Request:**
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
GET /graph/00416400910670863867/layout?neid=04358848009837283240
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Response:**
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{"nodes": [{"neid": "00416400910670863867", "label": "organization|Apple|nationality: us...", "isCentralNode": true, "x": -333.33, "y": -200, "width": 666.67, "height": 266.67}], "edges": [{"source": "00416400910670863867", "target": "04358848009837283240", "label": "competes_with", "path": [{"X": 0, "Y": 0}, {"X": 0, "Y": 66.67}], "article_ids": ["02861951941133789623"], "snippets": ["Apple and Google are mentioned as companies..."], "weight": 0.0267}]}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
### Get graph neighborhood
|
|
164
|
+
|
|
165
|
+
`GET /graph/{center_neid}/neighborhood`
|
|
166
|
+
|
|
167
|
+
Get list of neighboring entities in the relationship graph, optionally filtered by entity type. Response is cached for 5 minutes.
|
|
168
|
+
|
|
169
|
+
#### Guidance
|
|
170
|
+
|
|
171
|
+
Only use this endpoint if you care about graph-specific properties. Otherwise it is faster to use /entities/{source_neid}/linked. Response includes the center entity itself in the results with a weight of 1.0. The 'neighbors' and 'weights' arrays are parallel (same indices correspond).
|
|
172
|
+
|
|
173
|
+
#### Parameters
|
|
174
|
+
|
|
175
|
+
| Name | Type | Required | Description |
|
|
176
|
+
|------|------|----------|-------------|
|
|
177
|
+
| center_neid | string | yes | Center entity NEID |
|
|
178
|
+
| size | integer | no | Maximum number of neighbors to return |
|
|
179
|
+
| type | string[] | no | Filter by entity type(s) |
|
|
180
|
+
|
|
181
|
+
#### Responses
|
|
182
|
+
|
|
183
|
+
| Status | Description |
|
|
184
|
+
|--------|-------------|
|
|
185
|
+
| 200 | Neighbors and their weights (`GraphNeighborhoodResponse`) |
|
|
186
|
+
| 400 | Invalid parameters (`Error`) |
|
|
187
|
+
| 404 | Center entity not found (`Error`) |
|
|
188
|
+
| 500 | Internal server error (`Error`) |
|
|
189
|
+
|
|
190
|
+
#### Example
|
|
191
|
+
|
|
192
|
+
**Request:**
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
GET /graph/00416400910670863867/neighborhood?size=5
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Response:**
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
{"neighbors": ["00416400910670863867", "04358848009837283240", "00315863961550087877"], "weights": [1, 0.0267, 0.0167]}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### Get link counts between entities
|
|
207
|
+
|
|
208
|
+
`GET /graph/{source_neid}/links/{target_neid}/counts`
|
|
209
|
+
|
|
210
|
+
Get counts of links between source and target entities over time
|
|
211
|
+
|
|
212
|
+
#### Guidance
|
|
213
|
+
|
|
214
|
+
Only use this endpoint if you care about graph-specific properties. Otherwise it is faster to use /entities/{source_neid}/links/{target_neid}. Returns link_counts object with relationship types as keys. Values are arrays of timestamps in Excel/OLE serial date format (days since 1899-12-30). Example: 46019.64453125 = 2025-12-28 15:28:07 UTC. The count for each relationship type is the array length (number of observations).
|
|
215
|
+
|
|
216
|
+
#### Parameters
|
|
217
|
+
|
|
218
|
+
| Name | Type | Required | Description |
|
|
219
|
+
|------|------|----------|-------------|
|
|
220
|
+
| source_neid | string | yes | Source entity NEID |
|
|
221
|
+
| target_neid | string | yes | Target entity NEID |
|
|
222
|
+
|
|
223
|
+
#### Responses
|
|
224
|
+
|
|
225
|
+
| Status | Description |
|
|
226
|
+
|--------|-------------|
|
|
227
|
+
| 200 | Link counts by type (`GetLinkCountsResponse`) |
|
|
228
|
+
| 400 | Invalid parameters (`Error`) |
|
|
229
|
+
| 500 | Internal server error (`Error`) |
|
|
230
|
+
|
|
231
|
+
#### Example
|
|
232
|
+
|
|
233
|
+
**Request:**
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
GET /graph/00416400910670863867/links/04358848009837283240/counts
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Response:**
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{"link_counts": {"compares_to": [46019.64453125, 45999.3515625], "competes_with": [45847.5625, 45850.60546875], "customer_of": [45836.9296875], "partnered_with": [], "trades_with": []}}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Types
|
|
246
|
+
|
|
247
|
+
### EntityLink
|
|
248
|
+
|
|
249
|
+
A link between two entities
|
|
250
|
+
|
|
251
|
+
| Field | Type | Description |
|
|
252
|
+
|-------|------|-------------|
|
|
253
|
+
| article_ids | string[] | Article IDs where this link was found |
|
|
254
|
+
| recorded_at | string | Time when the link was recorded @Format date-time |
|
|
255
|
+
| source | string | Source entity NEID |
|
|
256
|
+
| target | string | Target entity NEID |
|
|
257
|
+
| type | string | Type of link/relationship |
|
|
258
|
+
|
|
259
|
+
### GetLinkCountsResponse
|
|
260
|
+
|
|
261
|
+
Response containing link counts between entities
|
|
262
|
+
|
|
263
|
+
| Field | Type | Description |
|
|
264
|
+
|-------|------|-------------|
|
|
265
|
+
| link_counts | object | Map of link type to count values |
|
|
266
|
+
|
|
267
|
+
### GetLinkedEntitiesResponse
|
|
268
|
+
|
|
269
|
+
Response containing linked entities
|
|
270
|
+
|
|
271
|
+
| Field | Type | Description |
|
|
272
|
+
|-------|------|-------------|
|
|
273
|
+
| entities | string[] | List of linked entity NEIDs |
|
|
274
|
+
|
|
275
|
+
### GetLinksResponse
|
|
276
|
+
|
|
277
|
+
Response containing links between entities
|
|
278
|
+
|
|
279
|
+
| Field | Type | Description |
|
|
280
|
+
|-------|------|-------------|
|
|
281
|
+
| articles | `ArticleDetail`[] | Articles tied to the returned links (only included when requested) |
|
|
282
|
+
| links | `EntityLink`[] | List of entity links |
|
|
283
|
+
| mentions | `MentionDetail`[] | Mentions tied to the returned links (only included when requested) |
|
|
284
|
+
|
|
285
|
+
### GraphNeighborhoodResponse
|
|
286
|
+
|
|
287
|
+
Response containing neighbors of an entity in the relationship graph
|
|
288
|
+
|
|
289
|
+
| Field | Type | Description |
|
|
290
|
+
|-------|------|-------------|
|
|
291
|
+
| neighbors | string[] | List of neighbor NEIDs |
|
|
292
|
+
| weights | number[] | Weights corresponding to each neighbor (same order as neighbors) |
|
|
293
|
+
|
|
294
|
+
### LinkedExpression
|
|
295
|
+
|
|
296
|
+
| Field | Type | Description |
|
|
297
|
+
|-------|------|-------------|
|
|
298
|
+
| **linked** | `Linked` | |
|
|
299
|
+
|
|
300
|
+
### Linked
|
|
301
|
+
|
|
302
|
+
| Field | Type | Description |
|
|
303
|
+
|-------|------|-------------|
|
|
304
|
+
| **distance** | integer | Maximum relationship distance to traverse |
|
|
305
|
+
| pids | integer[] | Property identifiers defining the relationship types to follow |
|
|
306
|
+
| to_entity | string | Target entity ID for relationship traversal |
|
|
307
|
+
|
|
308
|
+
<!-- END GENERATED CONTENT -->
|
package/skill/schema.md
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
# Schema
|
|
2
|
+
|
|
3
|
+
The schema defines the data model: what **entity types** (flavors) exist and what **properties** they can have. Understanding the schema is essential for constructing queries and interpreting results.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- You need to discover available entity types (flavors) and their IDs (FIDs)
|
|
8
|
+
- You need to discover available properties and their IDs (PIDs)
|
|
9
|
+
- You need human-readable names, units, or domain information for properties
|
|
10
|
+
- You're exploring the data model before constructing a search expression
|
|
11
|
+
|
|
12
|
+
## Key Concepts
|
|
13
|
+
|
|
14
|
+
- **Flavors** = Entity types. Each entity belongs to exactly one flavor.
|
|
15
|
+
- Examples: "ship" (FID 1), "organization" (FID 10), "person" (FID 9)
|
|
16
|
+
- Identified by a Flavor ID (FID) — a small integer
|
|
17
|
+
- **Properties** = Attributes that entities can have. Each property has:
|
|
18
|
+
- A Property ID (PID) — a small integer
|
|
19
|
+
- A name (e.g., "name", "length", "mailing_address", "acquires")
|
|
20
|
+
- A data type (e.g., "data_cat" for text, "data_float" for numbers)
|
|
21
|
+
- Domain flavors — which entity types can have this property
|
|
22
|
+
|
|
23
|
+
## Choosing a Schema Endpoint
|
|
24
|
+
|
|
25
|
+
There are two schema endpoints with different levels of detail:
|
|
26
|
+
|
|
27
|
+
| Endpoint | Flavors include | Properties include |
|
|
28
|
+
|----------|-----------------|-------------------|
|
|
29
|
+
| `GET /schema` | findex, name, singular/plural display names | pid, name, display_name, unit, value_type, domain_findexes, target_findexes |
|
|
30
|
+
| `GET /elemental/metadata/schema` | fid, name only | pid, name, type only |
|
|
31
|
+
|
|
32
|
+
**Use `/schema`** (recommended) when you need:
|
|
33
|
+
- Human-readable display names (e.g., "Ship" vs "ship")
|
|
34
|
+
- Units of measurement (e.g., "m", "kg", "knots")
|
|
35
|
+
- Which flavors a property applies to (`domain_findexes`)
|
|
36
|
+
|
|
37
|
+
**Use `/elemental/metadata/schema`** when you just need basic FID/PID to name mappings.
|
|
38
|
+
|
|
39
|
+
## Tips
|
|
40
|
+
|
|
41
|
+
- Many API responses return only FIDs and PIDs (not names) — use the schema to translate these to human-readable names
|
|
42
|
+
- Cache schema results; the data model changes infrequently
|
|
43
|
+
- Use `/elemental/metadata/properties/{pid}/summary` to understand value distributions before filtering
|
|
44
|
+
|
|
45
|
+
## Common Workflow
|
|
46
|
+
|
|
47
|
+
1. **Get the schema** → `GET /schema` to learn available flavors and properties
|
|
48
|
+
2. **Find entities of a type** → `POST /elemental/find` with `is_type` expression
|
|
49
|
+
3. **Get property values** → `POST /elemental/entities/properties` to fetch values for those entities
|
|
50
|
+
|
|
51
|
+
<!-- BEGIN GENERATED CONTENT -->
|
|
52
|
+
|
|
53
|
+
## Endpoints
|
|
54
|
+
|
|
55
|
+
### Get detailed schema information
|
|
56
|
+
|
|
57
|
+
`GET /schema`
|
|
58
|
+
|
|
59
|
+
Returns detailed schema information including entity types (flavors) with display names and properties with display names, units, and domain/target relationships. This endpoint provides more detail than /elemental/metadata/schema.
|
|
60
|
+
|
|
61
|
+
#### Guidance
|
|
62
|
+
|
|
63
|
+
This endpoint returns richer metadata than /elemental/metadata/schema, including display names, units, and relationship domains. Use this when you need human-readable names or property metadata.
|
|
64
|
+
|
|
65
|
+
#### Responses
|
|
66
|
+
|
|
67
|
+
| Status | Description |
|
|
68
|
+
|--------|-------------|
|
|
69
|
+
| 200 | Schema information (`SchemaResponse`) |
|
|
70
|
+
| 500 | Internal server error (`Error`) |
|
|
71
|
+
|
|
72
|
+
#### Example
|
|
73
|
+
|
|
74
|
+
**Request:**
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
GET /schema
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Response:**
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{"flavors": [{"findex": 1, "name": "ship", "singular_display_name": "Ship", "plural_display_name": "Ships"}, {"findex": 10, "name": "organization", "singular_display_name": "Organization", "plural_display_name": "Organizations"}], "properties": [{"pid": 8, "name": "name", "display_name": "Name", "value_type": "data_cat"}, {"pid": 22, "name": "length", "display_name": "Length", "unit": "m", "value_type": "data_float"}]}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### Find entities by expression
|
|
89
|
+
|
|
90
|
+
`POST /elemental/find`
|
|
91
|
+
|
|
92
|
+
Search for entities using a powerful expression language. The expression parameter supports complex nested queries with logical operators, geographic constraints, property comparisons, and more.
|
|
93
|
+
|
|
94
|
+
#### Guidance
|
|
95
|
+
|
|
96
|
+
CRITICAL: This endpoint REQUIRES Content-Type: application/x-www-form-urlencoded. Sending a JSON body will fail with 400 error. The expression parameter must be URL-encoded form data, not a JSON request body. For the full expression language reference including all expression types, comparison operators, and examples, see find.md.
|
|
97
|
+
|
|
98
|
+
#### Request Body
|
|
99
|
+
|
|
100
|
+
**Content-Type:** `application/x-www-form-urlencoded`
|
|
101
|
+
|
|
102
|
+
| Name | Type | Required | Description |
|
|
103
|
+
|------|------|----------|-------------|
|
|
104
|
+
| expression | string | yes | JSON-encoded expression object defining the search criteria |
|
|
105
|
+
| deadline | any | no | Response deadline in milliseconds or duration format |
|
|
106
|
+
| limit | integer | no | Maximum number of entity IDs to return in first response |
|
|
107
|
+
|
|
108
|
+
#### Responses
|
|
109
|
+
|
|
110
|
+
| Status | Description |
|
|
111
|
+
|--------|-------------|
|
|
112
|
+
| 200 | Find operation successful (`FindResponse`) |
|
|
113
|
+
| 400 | Bad request - invalid parameters or malformed expression (`Error`) |
|
|
114
|
+
| 500 | Internal server error (`Error`) |
|
|
115
|
+
| 501 | Elemental API capability not enabled (`Error`) |
|
|
116
|
+
|
|
117
|
+
#### Example
|
|
118
|
+
|
|
119
|
+
**Request:**
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
POST /elemental/find
|
|
123
|
+
Content-Type: application/x-www-form-urlencoded
|
|
124
|
+
|
|
125
|
+
expression={"type":"is_type","is_type":{"fid":10}}&limit=5
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Response:**
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{"op_id": "98cc54e9-0108-4361-9c96-18ea97cda7a2", "follow_up": true, "eids": ["01601807036815568643", "08115040994665529432", "02045070050429461063"]}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### Get property values for entities
|
|
137
|
+
|
|
138
|
+
`POST /elemental/entities/properties`
|
|
139
|
+
|
|
140
|
+
Retrieves property values for specified entities. Returns the current values of requested properties for each entity.
|
|
141
|
+
|
|
142
|
+
#### Guidance
|
|
143
|
+
|
|
144
|
+
Pass entity IDs as a JSON array in the 'eids' form field (eids and neids are interchangeable terms for entity IDs). Optionally filter to specific properties via 'pids'. If pids is omitted, returns all available properties. Set include_attributes=true to get additional metadata about each property value.
|
|
145
|
+
|
|
146
|
+
#### Request Body
|
|
147
|
+
|
|
148
|
+
**Content-Type:** `application/x-www-form-urlencoded`
|
|
149
|
+
|
|
150
|
+
| Name | Type | Required | Description |
|
|
151
|
+
|------|------|----------|-------------|
|
|
152
|
+
| eids | string | yes | JSON array of entity IDs to get properties for |
|
|
153
|
+
| pids | string | no | JSON array of property IDs to retrieve (optional, omit for all properties) |
|
|
154
|
+
| include_attributes | string | no | Include property attributes in response (true/false) |
|
|
155
|
+
|
|
156
|
+
#### Responses
|
|
157
|
+
|
|
158
|
+
| Status | Description |
|
|
159
|
+
|--------|-------------|
|
|
160
|
+
| 200 | Property values retrieved successfully (`GetPropertyValuesResponse`) |
|
|
161
|
+
| 400 | Bad request - invalid parameters or malformed expression (`Error`) |
|
|
162
|
+
| 500 | Internal server error (`Error`) |
|
|
163
|
+
|
|
164
|
+
#### Example
|
|
165
|
+
|
|
166
|
+
**Request:**
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
POST /elemental/entities/properties
|
|
170
|
+
Content-Type: application/x-www-form-urlencoded
|
|
171
|
+
|
|
172
|
+
eids=["00416400910670863867"]&pids=[8]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Response:**
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{"op_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "follow_up": false, "values": [{"eid": "00416400910670863867", "pid": 8, "value": "Apple", "recorded_at": "2026-01-15T10:30:00Z"}]}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### Get complete schema information
|
|
184
|
+
|
|
185
|
+
`GET /elemental/metadata/schema`
|
|
186
|
+
|
|
187
|
+
Returns comprehensive schema information including all entity types (flavors), properties, and their attributes. This endpoint provides the complete data model available in the system.
|
|
188
|
+
|
|
189
|
+
#### Guidance
|
|
190
|
+
|
|
191
|
+
Response is wrapped in a 'schema' container object. Access flavors and properties via response.schema.flavors and response.schema.properties. Flavors contain: fid (unique identifier), name (e.g., 'ship', 'aircraft'). Properties contain: pid (unique identifier), name (e.g., 'latitude', 'name'), type (e.g., 'data_float', 'data_int', 'data_cat', 'data_nindex').
|
|
192
|
+
|
|
193
|
+
#### Responses
|
|
194
|
+
|
|
195
|
+
| Status | Description |
|
|
196
|
+
|--------|-------------|
|
|
197
|
+
| 200 | Schema information retrieved successfully (`GetSchemaResponse`) |
|
|
198
|
+
| 500 | Internal server error (`Error`) |
|
|
199
|
+
| 501 | Elemental API capability not enabled (`Error`) |
|
|
200
|
+
|
|
201
|
+
#### Example
|
|
202
|
+
|
|
203
|
+
**Request:**
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
GET /elemental/metadata/schema
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Response:**
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{"op_id": "40dc4cd9-f1b2-4b5c-85d0-c7c61256e5d9", "follow_up": false, "schema": {"flavors": [{"fid": 1, "name": "ship"}, {"fid": 2, "name": "handset"}, {"fid": 10, "name": "organization"}], "properties": [{"pid": 1, "name": "mmsi", "type": "data_cat"}, {"pid": 8, "name": "name", "type": "data_cat"}]}}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### Get property value summary
|
|
218
|
+
|
|
219
|
+
`GET /elemental/metadata/properties/{pid}/summary`
|
|
220
|
+
|
|
221
|
+
Returns summary statistics for a specific property including value distribution, ranges for numeric properties, and unique values for categorical properties.
|
|
222
|
+
|
|
223
|
+
#### Parameters
|
|
224
|
+
|
|
225
|
+
| Name | Type | Required | Description |
|
|
226
|
+
|------|------|----------|-------------|
|
|
227
|
+
| pid | integer | yes | Property ID to summarize |
|
|
228
|
+
|
|
229
|
+
#### Responses
|
|
230
|
+
|
|
231
|
+
| Status | Description |
|
|
232
|
+
|--------|-------------|
|
|
233
|
+
| 200 | Property summary retrieved successfully (`SummarizePropertyResponse`) |
|
|
234
|
+
| 400 | Bad request - invalid parameters or malformed expression (`Error`) |
|
|
235
|
+
| 401 | Authentication required or authentication failed (`Error`) |
|
|
236
|
+
| 500 | Internal server error (`Error`) |
|
|
237
|
+
|
|
238
|
+
#### Example
|
|
239
|
+
|
|
240
|
+
**Request:**
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
GET /elemental/metadata/properties/8/summary
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Response:**
|
|
247
|
+
|
|
248
|
+
```json
|
|
249
|
+
{"op_id": "a337cd9c-6483-4472-a30b-e875ba7f2b21", "follow_up": false, "pid": 8, "value_type": "categorical"}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Types
|
|
253
|
+
|
|
254
|
+
### SchemaFlavor
|
|
255
|
+
|
|
256
|
+
Entity type (flavor) with human-readable display names
|
|
257
|
+
|
|
258
|
+
| Field | Type | Description |
|
|
259
|
+
|-------|------|-------------|
|
|
260
|
+
| findex | integer | Unique flavor identifier (same as fid in other endpoints) |
|
|
261
|
+
| name | string | Flavor name (internal identifier) |
|
|
262
|
+
| plural_display_name | string | Human-readable plural name (e.g., "Ships") |
|
|
263
|
+
| singular_display_name | string | Human-readable singular name (e.g., "Ship") |
|
|
264
|
+
|
|
265
|
+
### SchemaProperty
|
|
266
|
+
|
|
267
|
+
Property with display name, unit, and domain information
|
|
268
|
+
|
|
269
|
+
| Field | Type | Description |
|
|
270
|
+
|-------|------|-------------|
|
|
271
|
+
| display_name | string | Human-readable property name |
|
|
272
|
+
| domain_findexes | integer[] | Flavor IDs (findexes) that can have this property |
|
|
273
|
+
| name | string | Property name (internal identifier) |
|
|
274
|
+
| pid | integer | Unique property identifier |
|
|
275
|
+
| target_findexes | integer[] | For relationship properties, the flavor IDs of valid targets |
|
|
276
|
+
| unit | string | Unit of measurement (e.g., "m", "kg", "knots") |
|
|
277
|
+
| value_type | string | Property data type. Possible values: "data_float", "data_int", "data_bool", "data_cat", "data_nindex" |
|
|
278
|
+
|
|
279
|
+
### SchemaResponse
|
|
280
|
+
|
|
281
|
+
Detailed schema response with entity types (flavors) and properties including display names, units, and domains
|
|
282
|
+
|
|
283
|
+
| Field | Type | Description |
|
|
284
|
+
|-------|------|-------------|
|
|
285
|
+
| flavors | `SchemaFlavor`[] | Array of entity types (flavors) with display names |
|
|
286
|
+
| properties | `SchemaProperty`[] | Array of properties with display names, units, and domain information |
|
|
287
|
+
|
|
288
|
+
### FindResponse
|
|
289
|
+
|
|
290
|
+
| Field | Type | Description |
|
|
291
|
+
|-------|------|-------------|
|
|
292
|
+
| find | `FindData` | |
|
|
293
|
+
|
|
294
|
+
### FindData
|
|
295
|
+
|
|
296
|
+
| Field | Type | Description |
|
|
297
|
+
|-------|------|-------------|
|
|
298
|
+
| **eids** | string[] | Array of 20-character entity IDs matching the search expression |
|
|
299
|
+
|
|
300
|
+
### GetPropertyValuesResponse
|
|
301
|
+
|
|
302
|
+
| Field | Type | Description |
|
|
303
|
+
|-------|------|-------------|
|
|
304
|
+
| **values** | `PropertyValue`[] | Array of property values for the requested entities |
|
|
305
|
+
|
|
306
|
+
### PropertyValue
|
|
307
|
+
|
|
308
|
+
| Field | Type | Description |
|
|
309
|
+
|-------|------|-------------|
|
|
310
|
+
| **eid** | string | Entity ID this property value belongs to |
|
|
311
|
+
| **pid** | integer | Property ID |
|
|
312
|
+
| **value** | any | Property value (type varies by property: string, number, boolean, or entity ID) |
|
|
313
|
+
| recorded_at | string (date-time) | Timestamp when this value was recorded |
|
|
314
|
+
| imputed | boolean | Whether this value was imputed (inferred) rather than directly observed |
|
|
315
|
+
| attributes | object | Additional metadata about this property value (when include_attributes=true) |
|
|
316
|
+
|
|
317
|
+
### GetSchemaResponse
|
|
318
|
+
|
|
319
|
+
| Field | Type | Description |
|
|
320
|
+
|-------|------|-------------|
|
|
321
|
+
| **flavors** | `Flavor`[] | Array of entity types (flavors) available in the system |
|
|
322
|
+
| **properties** | `Property`[] | Array of properties available in the system |
|
|
323
|
+
|
|
324
|
+
### Flavor
|
|
325
|
+
|
|
326
|
+
| Field | Type | Description |
|
|
327
|
+
|-------|------|-------------|
|
|
328
|
+
| **fid** | integer | Unique flavor identifier |
|
|
329
|
+
| **name** | string | Flavor name |
|
|
330
|
+
|
|
331
|
+
### Property
|
|
332
|
+
|
|
333
|
+
| Field | Type | Description |
|
|
334
|
+
|-------|------|-------------|
|
|
335
|
+
| **pid** | integer | Unique property identifier |
|
|
336
|
+
| **name** | string | Property name |
|
|
337
|
+
| **type** | string | Property data type. Values: `data_float`, `data_int`, `data_bool`, `data_cat`, `data_nindex` |
|
|
338
|
+
|
|
339
|
+
### SummarizePropertyResponse
|
|
340
|
+
|
|
341
|
+
| Field | Type | Description |
|
|
342
|
+
|-------|------|-------------|
|
|
343
|
+
| **pid** | integer | The property ID that was summarized |
|
|
344
|
+
| **value_type** | string | Type of property values. Values: `numeric`, `categorical` |
|
|
345
|
+
| unique_count | integer | Number of unique values |
|
|
346
|
+
| values | string[] | Array of unique values for categorical properties |
|
|
347
|
+
| numeric_min | number | Minimum value for numeric properties |
|
|
348
|
+
| numeric_max | number | Maximum value for numeric properties |
|
|
349
|
+
| numeric_mean | number | Mean value for numeric properties |
|
|
350
|
+
|
|
351
|
+
<!-- END GENERATED CONTENT -->
|