refactor transformation, add graph and admin

This commit is contained in:
LUIS NOVO 2024-11-18 22:01:11 -03:00
parent e3fa445fcc
commit 4a5d47d934
26 changed files with 326 additions and 384 deletions

View file

@ -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