mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Structured data 2 (#645)
* Structured data refactor - multi-index tables, remove need for manual mods to the Cassandra tables * Tech spec updated to track implementation
This commit is contained in:
parent
5ffad92345
commit
1809c1f56d
87 changed files with 5233 additions and 3235 deletions
|
|
@ -1,6 +1,6 @@
|
|||
type: object
|
||||
description: |
|
||||
Objects query request - GraphQL query over knowledge graph.
|
||||
Rows query request - GraphQL query over structured data.
|
||||
required:
|
||||
- query
|
||||
properties:
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
type: object
|
||||
description: Objects query response (GraphQL format)
|
||||
description: Rows query response (GraphQL format)
|
||||
properties:
|
||||
data:
|
||||
description: GraphQL response data (JSON object or null)
|
||||
|
|
@ -121,8 +121,8 @@ paths:
|
|||
$ref: './paths/flow/mcp-tool.yaml'
|
||||
/api/v1/flow/{flow}/service/triples:
|
||||
$ref: './paths/flow/triples.yaml'
|
||||
/api/v1/flow/{flow}/service/objects:
|
||||
$ref: './paths/flow/objects.yaml'
|
||||
/api/v1/flow/{flow}/service/rows:
|
||||
$ref: './paths/flow/rows.yaml'
|
||||
/api/v1/flow/{flow}/service/nlp-query:
|
||||
$ref: './paths/flow/nlp-query.yaml'
|
||||
/api/v1/flow/{flow}/service/structured-query:
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ post:
|
|||
```
|
||||
1. User asks: "Who does Alice know?"
|
||||
2. NLP Query generates GraphQL
|
||||
3. Execute via /api/v1/flow/{flow}/service/objects
|
||||
3. Execute via /api/v1/flow/{flow}/service/rows
|
||||
4. Return results to user
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
post:
|
||||
tags:
|
||||
- Flow Services
|
||||
summary: Objects query - GraphQL over knowledge graph
|
||||
summary: Rows query - GraphQL over structured data
|
||||
description: |
|
||||
Query knowledge graph using GraphQL for object-oriented data access.
|
||||
Query structured data using GraphQL for row-oriented data access.
|
||||
|
||||
## Objects Query Overview
|
||||
## Rows Query Overview
|
||||
|
||||
GraphQL interface to knowledge graph:
|
||||
GraphQL interface to structured data:
|
||||
- **Schema-driven**: Predefined types and relationships
|
||||
- **Flexible queries**: Request exactly what you need
|
||||
- **Nested data**: Traverse relationships in single query
|
||||
- **Type-safe**: Strong typing with introspection
|
||||
|
||||
Abstracts RDF triples into familiar object model.
|
||||
Abstracts structured rows into familiar object model.
|
||||
|
||||
## GraphQL Benefits
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ post:
|
|||
Schema defines available types via config service.
|
||||
Use introspection query to discover schema.
|
||||
|
||||
operationId: objectsQueryService
|
||||
operationId: rowsQueryService
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
|
|
@ -77,7 +77,7 @@ post:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../../components/schemas/query/ObjectsQueryRequest.yaml'
|
||||
$ref: '../../components/schemas/query/RowsQueryRequest.yaml'
|
||||
examples:
|
||||
simpleQuery:
|
||||
summary: Simple query
|
||||
|
|
@ -129,7 +129,7 @@ post:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../../components/schemas/query/ObjectsQueryResponse.yaml'
|
||||
$ref: '../../components/schemas/query/RowsQueryResponse.yaml'
|
||||
examples:
|
||||
successfulQuery:
|
||||
summary: Successful query
|
||||
|
|
@ -9,7 +9,7 @@ post:
|
|||
|
||||
Combines two operations in one call:
|
||||
1. **NLP Query**: Generate GraphQL from question
|
||||
2. **Objects Query**: Execute generated query
|
||||
2. **Rows Query**: Execute generated query
|
||||
3. **Return Results**: Direct answer data
|
||||
|
||||
Simplest way to query knowledge graph with natural language.
|
||||
|
|
@ -21,7 +21,7 @@ post:
|
|||
- **Output**: Query results (data)
|
||||
- **Use when**: Want simple, direct answers
|
||||
|
||||
### NLP Query + Objects Query (separate calls)
|
||||
### NLP Query + Rows Query (separate calls)
|
||||
- **Step 1**: Convert question → GraphQL
|
||||
- **Step 2**: Execute GraphQL → results
|
||||
- **Use when**: Need to inspect/modify query before execution
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ payload:
|
|||
- $ref: './requests/EmbeddingsRequest.yaml'
|
||||
- $ref: './requests/McpToolRequest.yaml'
|
||||
- $ref: './requests/TriplesRequest.yaml'
|
||||
- $ref: './requests/ObjectsRequest.yaml'
|
||||
- $ref: './requests/RowsRequest.yaml'
|
||||
- $ref: './requests/NlpQueryRequest.yaml'
|
||||
- $ref: './requests/StructuredQueryRequest.yaml'
|
||||
- $ref: './requests/StructuredDiagRequest.yaml'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
type: object
|
||||
description: WebSocket request for objects service (flow-hosted service)
|
||||
description: WebSocket request for rows service (flow-hosted service)
|
||||
required:
|
||||
- id
|
||||
- service
|
||||
|
|
@ -11,16 +11,16 @@ properties:
|
|||
description: Unique request identifier
|
||||
service:
|
||||
type: string
|
||||
const: objects
|
||||
description: Service identifier for objects service
|
||||
const: rows
|
||||
description: Service identifier for rows service
|
||||
flow:
|
||||
type: string
|
||||
description: Flow ID
|
||||
request:
|
||||
$ref: '../../../../api/components/schemas/query/ObjectsQueryRequest.yaml'
|
||||
$ref: '../../../../api/components/schemas/query/RowsQueryRequest.yaml'
|
||||
examples:
|
||||
- id: req-1
|
||||
service: objects
|
||||
service: rows
|
||||
flow: my-flow
|
||||
request:
|
||||
query: "{ entity(id: \"https://example.com/entity1\") { properties { key value } } }"
|
||||
Loading…
Add table
Add a link
Reference in a new issue