mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 11:11:03 +02:00
Rework schema
This commit is contained in:
parent
6e31d24fb1
commit
0a95fc1263
1 changed files with 77 additions and 14 deletions
|
|
@ -6,16 +6,52 @@ from . types import Error
|
||||||
from . metadata import Metadata
|
from . metadata import Metadata
|
||||||
from . documents import Document, TextDocument
|
from . documents import Document, TextDocument
|
||||||
|
|
||||||
# add
|
# add-document
|
||||||
# -> (id, document)
|
# -> (document_id, document_metadata, content)
|
||||||
# <- ()
|
# <- ()
|
||||||
# <- (error)
|
# <- (error)
|
||||||
|
|
||||||
# list
|
# remove-document
|
||||||
# -> (user, collection?)
|
# -> (document_id)
|
||||||
# <- (info)
|
# <- ()
|
||||||
# <- (error)
|
# <- (error)
|
||||||
|
|
||||||
|
# update-document
|
||||||
|
# -> (document_id, document_metadata)
|
||||||
|
# <- ()
|
||||||
|
# <- (error)
|
||||||
|
|
||||||
|
# get-document-metadata
|
||||||
|
# -> (document_id)
|
||||||
|
# <- (document_metadata)
|
||||||
|
# <- (error)
|
||||||
|
|
||||||
|
# get-document-content
|
||||||
|
# -> (document_id)
|
||||||
|
# <- (content)
|
||||||
|
# <- (error)
|
||||||
|
|
||||||
|
# add-processing
|
||||||
|
# -> (processing_id, processing_metadata)
|
||||||
|
# <- ()
|
||||||
|
# <- (error)
|
||||||
|
|
||||||
|
# remove-processing
|
||||||
|
# -> (processing_id)
|
||||||
|
# <- ()
|
||||||
|
# <- (error)
|
||||||
|
|
||||||
|
# list-documents
|
||||||
|
# -> (user, collection?)
|
||||||
|
# <- (document_metadata[])
|
||||||
|
# <- (error)
|
||||||
|
|
||||||
|
# list-processing
|
||||||
|
# -> (user, collection?)
|
||||||
|
# <- (processing_metadata[])
|
||||||
|
# <- (error)
|
||||||
|
|
||||||
|
# OLD:
|
||||||
# add(Metadata, Bytes) : error?
|
# add(Metadata, Bytes) : error?
|
||||||
# copy(id, user, collection)
|
# copy(id, user, collection)
|
||||||
# move(id, user, collection)
|
# move(id, user, collection)
|
||||||
|
|
@ -26,17 +62,21 @@ from . documents import Document, TextDocument
|
||||||
# info(id[]) : DocumentInfo[]
|
# info(id[]) : DocumentInfo[]
|
||||||
# search(<key,op,value>[]) : id[]
|
# search(<key,op,value>[]) : id[]
|
||||||
|
|
||||||
class DocumentPackage(Record):
|
class DocumentMetadata(Record):
|
||||||
id = String()
|
id = String()
|
||||||
flow = String()
|
time = Long()
|
||||||
document = Bytes()
|
|
||||||
kind = String()
|
kind = String()
|
||||||
user = String()
|
|
||||||
collection = String()
|
|
||||||
title = String()
|
title = String()
|
||||||
comments = String()
|
comments = String()
|
||||||
time = Long()
|
|
||||||
metadata = Array(Triple())
|
metadata = Array(Triple())
|
||||||
|
tags = Array(String())
|
||||||
|
|
||||||
|
class ProcessingMetadata(Record):
|
||||||
|
document_id = String()
|
||||||
|
time = Long()
|
||||||
|
flow = String()
|
||||||
|
user = String()
|
||||||
|
collection = String()
|
||||||
|
|
||||||
class DocumentInfo(Record):
|
class DocumentInfo(Record):
|
||||||
id = String()
|
id = String()
|
||||||
|
|
@ -55,12 +95,35 @@ class Criteria(Record):
|
||||||
operator = String()
|
operator = String()
|
||||||
|
|
||||||
class LibrarianRequest(Record):
|
class LibrarianRequest(Record):
|
||||||
|
|
||||||
|
# add-document, remove-document, update-document, get-document-metadata,
|
||||||
|
# get-document-content, add-processing, remove-processing, list-documents,
|
||||||
|
# list-processing
|
||||||
operation = String()
|
operation = String()
|
||||||
id = String()
|
|
||||||
flow = String()
|
# add-document, remove-document, update-document, get-document-metadata,
|
||||||
document = DocumentPackage()
|
# get-document-content
|
||||||
|
document_id = String()
|
||||||
|
|
||||||
|
# add-processing, remove-processing
|
||||||
|
processing_id = String()
|
||||||
|
|
||||||
|
# add-document, update-document
|
||||||
|
document_metadata = DocumentMetadata()
|
||||||
|
|
||||||
|
# add-processing
|
||||||
|
processing_metadata = ProcessingMetadata()
|
||||||
|
|
||||||
|
# add-document
|
||||||
|
content = Bytes()
|
||||||
|
|
||||||
|
# list-documents, list-processing
|
||||||
user = String()
|
user = String()
|
||||||
|
|
||||||
|
# list-documents?, list-processing?
|
||||||
collection = String()
|
collection = String()
|
||||||
|
|
||||||
|
#
|
||||||
criteria = Array(Criteria())
|
criteria = Array(Criteria())
|
||||||
|
|
||||||
class LibrarianResponse(Record):
|
class LibrarianResponse(Record):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue