mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-04-28 19:40:50 +00:00
refactor transformation, add graph and admin
This commit is contained in:
parent
e3fa445fcc
commit
4a5d47d934
26 changed files with 326 additions and 384 deletions
|
|
@ -37,7 +37,6 @@ def repo_query(query_str: str, vars: Optional[Dict[str, Any]] = None):
|
|||
|
||||
def repo_create(table: str, data: Dict[str, Any]):
|
||||
query = f"CREATE {table} CONTENT {data};"
|
||||
# vars = {"table": table, "data": data}
|
||||
return repo_query(query)
|
||||
|
||||
|
||||
|
|
@ -53,14 +52,7 @@ def repo_delete(id: str):
|
|||
return repo_query(query, vars)
|
||||
|
||||
|
||||
def repo_relate(source: str, relationship: str, target: str):
|
||||
query = f"RELATE {source}->{relationship}->{target}"
|
||||
# CONTENT $content;"
|
||||
# vars = {
|
||||
# "source": source,
|
||||
# "relationship": relationship,
|
||||
# "target": target,
|
||||
# # "content": {}, # You can add properties to the relation here if needed
|
||||
# }
|
||||
result = repo_query(query)
|
||||
def repo_relate(source: str, relationship: str, target: str, data: Optional[Dict] = {}):
|
||||
query = f"RELATE {source}->{relationship}->{target} CONTENT $content;"
|
||||
result = repo_query(query, {"content": data})
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue