mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-20 18:51:03 +02:00
Add fields to library schema
This commit is contained in:
parent
5575e885e5
commit
a74119c93e
2 changed files with 12 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
from pulsar.schema import Record, Bytes, String, Array
|
||||
from pulsar.schema import Record, Bytes, String, Array, Timestamp
|
||||
from . types import Triple
|
||||
from . topic import topic
|
||||
from . types import Error
|
||||
|
|
@ -24,12 +24,16 @@ class DocumentPackage(Record):
|
|||
collection = String()
|
||||
title = String()
|
||||
comments = String()
|
||||
time = Timestamp()
|
||||
|
||||
class DocumentInfo(Record):
|
||||
metadata = Array(Triple())
|
||||
kind = String()
|
||||
user = String()
|
||||
collection = String()
|
||||
title = String()
|
||||
comments = String()
|
||||
time = Timestamp()
|
||||
|
||||
class Criteria(Record):
|
||||
key = String()
|
||||
|
|
|
|||
|
|
@ -126,10 +126,13 @@ def to_document_package(x):
|
|||
|
||||
return DocumentPackage(
|
||||
metadata = to_subgraph(x["metadata"]),
|
||||
document = x.get("document", None),
|
||||
kind = x.get("kind", None),
|
||||
user = x.get("user", None),
|
||||
collection = x.get("collection", None),
|
||||
title = x.get("title", None),
|
||||
comments = x.get("comments", None),
|
||||
time = x.get("time", None),
|
||||
document = x.get("document", None),
|
||||
)
|
||||
|
||||
def to_document_info(x):
|
||||
|
|
@ -139,6 +142,9 @@ def to_document_info(x):
|
|||
kind = x.get("kind", None),
|
||||
user = x.get("user", None),
|
||||
collection = x.get("collection", None),
|
||||
title = x.get("title", None),
|
||||
comments = x.get("comments", None),
|
||||
time = x.get("time", None),
|
||||
)
|
||||
|
||||
def to_criteria(x):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue