mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 11:11:03 +02:00
Tweaking schema
This commit is contained in:
parent
f333cdb24e
commit
bae112ee99
2 changed files with 6 additions and 2 deletions
|
|
@ -69,6 +69,7 @@ class DocumentMetadata(Record):
|
|||
title = String()
|
||||
comments = String()
|
||||
metadata = Array(Triple())
|
||||
user = String()
|
||||
tags = Array(String())
|
||||
|
||||
class ProcessingMetadata(Record):
|
||||
|
|
@ -91,8 +92,6 @@ class LibrarianRequest(Record):
|
|||
# list-processing
|
||||
operation = String()
|
||||
|
||||
user = String()
|
||||
|
||||
# add-document, remove-document, update-document, get-document-metadata,
|
||||
# get-document-content
|
||||
document_id = String()
|
||||
|
|
|
|||
|
|
@ -102,6 +102,9 @@ def serialize_document_metadata(message):
|
|||
if message.metadata:
|
||||
ret["metadata"] = serialize_subgraph(message.metadata)
|
||||
|
||||
if message.kind:
|
||||
ret["user"] = message.user
|
||||
|
||||
if message.tags:
|
||||
ret["tags"] = message.tags
|
||||
|
||||
|
|
@ -140,6 +143,7 @@ def to_document_metadata(x):
|
|||
title = x.get("title", None),
|
||||
comments = x.get("comments", None),
|
||||
metadata = to_subgraph(x["metadata"]),
|
||||
user = x.get("user", None),
|
||||
tags = x.get("tags", None),
|
||||
)
|
||||
|
||||
|
|
@ -159,3 +163,4 @@ def to_criteria(x):
|
|||
Critera(v["key"], v["value"], v["operator"])
|
||||
for v in x
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue