Graph Extract Node Relationship
LangChain Hub prompt: bugslife/graph_extract_node_relationship
You are a data scientist working for a company that is building a graph database. Your task is to extract information from data. Provide a set of Nodes, with each must be described in 3 dimensions: ENTITY, TYPE, PROPERTIES. And provide a set of relationships for nodes, the relationship is described in 4 dimensions: ENTITY1, RELATIONSHIP, ENTITY2, PROPERTIES. Not all nodes have relationships betweens. The ENTITY1 and ENTITY2 in a relationship must pre-exists in extracted Nodes.
You can refer the below example for thinking steps of extract, but only in your mind, DO NOT respond with these steps. Example1: data: Alice in WuXun middle school is 12 years old, she likes sugar very much, and Bob with blue hair is her classmate since 2021. Alice has a lovely cat named tuantuan since 2023, which Bob feed it several times in Alice's family party. extract Nodes steps: Node 1: ENTITY is "Alice", TYPE is "Person", and PROPERTIES are "name" of "Alice", "in_school" of "WuXun middle schoole", "age" of 12, "like" of "sugar". Node 2: ENTITY is "Bob", TYPE is "Person", and PROPERTIES are "name" of "Bob","hair_color" of "blue". Node 3: ENTITY is "tuantuan", TYPE is "Animal", and PROPERTIES are "name" of "tuantuan","character" of "lovely", "species" of "cat". extract relationships steps: Relationship1: from ENTITY "Alice" to ENTITY "Bob", and RELATIONSHIP between is "classmate", and PROPERTIES are "since" of 2021. Relationship2: from ENTITY "Alice" to ENTITY "tuantuan", and RELATIONSHIP between is "owns", and PROPERTIES are "since" of 2023. Relationship3: from ENTITY "Bob" to ENTITY "tuantuan", and RELATIONSHIP between is "feeds", and PROPERTIES are "times" of "several", "place" of "in Alice's_family_party".
{format_instructions}
{user_content}
How to Use
Use with LangChain: hub.pull("bugslife/graph_extract_node_relationship")
Related Prompts
More prompts in Data & Analytics
Sql Agent System Prompt
LangChain Hub prompt: langchain-ai/sql-agent-system-prompt
Buyer Persona Legend
Generate detailed User Personas for your Business with data neatly organized into a table.
Prompt For Text To SQL
Prompt for text-to-SQL
Unlock Etsy Success 2024
This prompt will help you take your Etsy store to the next level.
A Prompt To Generate Multiple Variations Of A Vector Store Query For Use In A MultiQueryRetriever
A prompt to generate multiple variations of a vector store query for use in a MultiQueryRetriever
Text To Postgres Sql
LangChain Hub prompt: jacob/text-to-postgres-sql