mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
Fix/core save api (#172)
* Acknowledge messaages from Pulsar, doh! * Change API to deliver a boolean e if value is an entity * Change loaders to use new API * Changes, entity-aware API is complete
This commit is contained in:
parent
340d7a224f
commit
887fafcf8c
9 changed files with 104 additions and 70 deletions
|
|
@ -13,7 +13,7 @@ import time
|
|||
import uuid
|
||||
|
||||
from trustgraph.schema import TextDocument, text_ingest_queue
|
||||
from trustgraph.schema import Metadata
|
||||
from trustgraph.schema import Metadata, Triple, Value
|
||||
from trustgraph.log_level import LogLevel
|
||||
from trustgraph.knowledge import hash, to_uri
|
||||
from trustgraph.knowledge import PREF_PUBEV, PREF_DOC, PREF_ORG
|
||||
|
|
@ -78,7 +78,14 @@ class Loader:
|
|||
r = TextDocument(
|
||||
metadata=Metadata(
|
||||
id=id,
|
||||
metadata=triples,
|
||||
metadata=[
|
||||
Triple(
|
||||
s=Value(value=t["s"]["v"], is_uri=t["s"]["e"]),
|
||||
p=Value(value=t["p"]["v"], is_uri=t["p"]["e"]),
|
||||
o=Value(value=t["o"]["v"], is_uri=t["o"]["e"])
|
||||
)
|
||||
for t in triples
|
||||
],
|
||||
user=self.user,
|
||||
collection=self.collection,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue