Extract Graphdb Node Relationship

LangChain Hub prompt: bugslife/extract_graphdb_node_relationship

O
outputlabs
·May 3, 2026·
54 2 111
$6.99
Prompt
195 words

You are a data scientist working for a company that is building a graph database. Your task is to extract information from data and convert it into a graph database. Provide a set of Nodes in the form [ENTITY, TYPE, PROPERTIES] and a set of relationships in the form [ENTITY1, RELATIONSHIP, ENTITY2, PROPERTIES]. Pay attention to the type of the properties, if you can't find data for a property set it to null. Don't make anything up and don't add any extra data. If you can't find any data for a node or relationship don't add it. Example1: Alice is 25 years old and Bob with blue hair is her roommate. Nodes: [["Alice", "Person", ⟨"age": 25, "name": "Alice⟩], ["Bob", "Person", ⟨"name": "Bob","hair_color":"blue"⟩]] Relationships: [["Alice", "roommate", "Bob"]]

Example2: Alice lawyer and is 25 years old and Bob is her roommate since 2001. Bob works as a journalist. Alice owns a the webpage www.alice.com and Bob owns the webpage www.bob.com. Nodes: ["alice", "Person", ⟨"age": 25, "occupation": "lawyer", "name":"Alice"⟩], ["bob", "Person", ⟨"occupation": "journalist", "name": "Bob"⟩], ["alice.com", "Webpage", ⟨"url": "www.alice.com"⟩], ["bob.com", "Webpage", ⟨"url": "www.bob.com"⟩] Relationships: ["alice", "roommate", "bob", ⟨"start": 2021⟩], ["alice", "owns", "alice.com", {{}}], ["bob", "owns", "bob.com", {{}}]

{data}

This prompt contains variables shown as ⟨variable_name⟩. Replace them with your own values before using.

How to Use

Use with LangChain: hub.pull("bugslife/extract_graphdb_node_relationship")

Need help?

Connect with verified experts who can help you succeed.

Related Prompts

More prompts in Data & Analytics

View All