Fix relation info in kownledge graph UI
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="./logo.png" />
|
<link rel="icon" type="image/svg+xml" href="./logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Lightrag</title>
|
<title>Lightrag</title>
|
||||||
<script type="module" crossorigin src="./assets/index-CJz72b6Q.js"></script>
|
<script type="module" crossorigin src="./assets/index-BCtjO3U7.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-CH-3l4_Z.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-CH-3l4_Z.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@@ -744,11 +744,7 @@ class Neo4JStorage(BaseGraphStorage):
|
|||||||
result.nodes.append(
|
result.nodes.append(
|
||||||
KnowledgeGraphNode(
|
KnowledgeGraphNode(
|
||||||
id=f"{node_id}",
|
id=f"{node_id}",
|
||||||
labels=[
|
labels=[node.get("entity_id")],
|
||||||
label
|
|
||||||
for label in node.labels
|
|
||||||
if label != "base"
|
|
||||||
],
|
|
||||||
properties=dict(node),
|
properties=dict(node),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -865,9 +861,7 @@ class Neo4JStorage(BaseGraphStorage):
|
|||||||
# Create KnowledgeGraphNode for target
|
# Create KnowledgeGraphNode for target
|
||||||
target_node = KnowledgeGraphNode(
|
target_node = KnowledgeGraphNode(
|
||||||
id=f"{target_id}",
|
id=f"{target_id}",
|
||||||
labels=[
|
labels=list(f"{target_id}"),
|
||||||
label for label in b_node.labels if label != "base"
|
|
||||||
],
|
|
||||||
properties=dict(b_node.properties),
|
properties=dict(b_node.properties),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -907,9 +901,7 @@ class Neo4JStorage(BaseGraphStorage):
|
|||||||
# Create initial KnowledgeGraphNode
|
# Create initial KnowledgeGraphNode
|
||||||
start_node = KnowledgeGraphNode(
|
start_node = KnowledgeGraphNode(
|
||||||
id=f"{node_record['n'].get('entity_id')}",
|
id=f"{node_record['n'].get('entity_id')}",
|
||||||
labels=[
|
labels=list(f"{node_record['n'].get('entity_id')}"),
|
||||||
label for label in node_record["n"].labels if label != "base"
|
|
||||||
],
|
|
||||||
properties=dict(node_record["n"].properties),
|
properties=dict(node_record["n"].properties),
|
||||||
)
|
)
|
||||||
finally:
|
finally:
|
||||||
|
@@ -95,9 +95,9 @@ const refineNodeProperties = (node: RawNodeType): NodeType => {
|
|||||||
const neighbour = state.rawGraph.getNode(neighbourId)
|
const neighbour = state.rawGraph.getNode(neighbourId)
|
||||||
if (neighbour) {
|
if (neighbour) {
|
||||||
relationships.push({
|
relationships.push({
|
||||||
type: isTarget ? 'Target' : 'Source',
|
type: 'Target',
|
||||||
id: neighbourId,
|
id: neighbourId,
|
||||||
label: neighbour.labels.join(', ')
|
label: neighbour.properties['entity_id']
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user