Schema Editor
The schema editor in whyhow is a powerful tool for defining and managing the schema of your knowledge graph. It provides a user-friendly interface for creating entity types and relationship types and specifying their properties and constraints.
Accessing the Schema Editor
To access the schema editor, follow these steps:
- Open your project and navigate to the "Schema" tab in the sidebar.
- Click the "Edit Schema" button to open the visualizations
Editing and Updating Schema
Right now, you can only save the schema once. Once it is saved, it cannot be edited. To amend the schema, copy and paste the JSON into a new schema and amend accordingly.
Best Practices
To create an effective and maintainable schema in whyhow, consider the following best practices:
- Use meaningful and descriptive names for entity types, relationship types, and properties.
- Define clear and consistent property data types to ensure data integrity.
- Specify constraints and validation rules to envisualized quality and consistency.
- Avoid circular relationships or overly complex schema structures.
- Regularly review and update your schema as your knowledge graph evolves.
- Use schema versioning to track and manage changes over time.
Example Schemas
Schema for Unstructured Data
{
"entities": [
{
"name": "CorporateStructure",
"description": "Amazon's overall corporate organization and governance",
"fields": []
},
{
"name": "BusinessSegments",
"description": "Major operational divisions of Amazon",
"fields": []
},
{
"name": "ProductsAndServices",
"description": "Key offerings provided by Amazon",
"fields": []
},
{
"name": "RevenueStreams",
"description": "Sources of income for Amazon",
"fields": []
},
{
"name": "OperationalInfrastructure",
"description": "Key systems and networks supporting Amazon's operations",
"fields": []
},
{
"name": "StrategicPartnerships",
"description": "Important business relationships and collaborations",
"fields": []
},
{
"name": "RiskFactors",
"description": "Potential threats and challenges to Amazon's business",
"fields": []
},
{
"name": "FinancialPerformance",
"description": "Key financial metrics and results",
"fields": []
},
{
"name": "MarketPosition",
"description": "Amazon's standing in various markets and industries",
"fields": []
},
{
"name": "FutureOutlook",
"description": "Projections and strategic directions for Amazon",
"fields": []
}
],
"relations": [
{
"name": "comprises",
"description": "Indicates components or subdivisions of an entity"
},
{
"name": "contributes_to",
"description": "Indicates a positive impact or contribution"
},
{
"name": "depends_on",
"description": "Indicates a critical reliance or dependency"
},
{
"name": "influences",
"description": "Indicates a significant effect or impact"
},
{
"name": "competes_with",
"description": "Indicates competitive relationships"
},
{
"name": "mitigates",
"description": "Indicates strategies to address challenges or risks"
},
{
"name": "drives",
"description": "Indicates key factors behind growth or performance"
}
],
"patterns": [
{
"head": "CorporateStructure",
"relation": "comprises",
"tail": "BusinessSegments",
"description": "Amazon's corporate structure includes various business segments"
},
{
"head": "BusinessSegments",
"relation": "contributes_to",
"tail": "RevenueStreams",
"description": "Each business segment contributes to Amazon's revenue streams"
},
{
"head": "ProductsAndServices",
"relation": "depends_on",
"tail": "OperationalInfrastructure",
"description": "Amazon's products and services rely on its operational infrastructure"
},
{
"head": "StrategicPartnerships",
"relation": "influences",
"tail": "MarketPosition",
"description": "Strategic partnerships affect Amazon's market position"
},
{
"head": "RiskFactors",
"relation": "influences",
"tail": "FutureOutlook",
"description": "Identified risk factors impact Amazon's future outlook"
},
{
"head": "FinancialPerformance",
"relation": "drives",
"tail": "FutureOutlook",
"description": "Financial performance drives Amazon's future strategies and projections"
}
]
}
Schema for Structured Data
{
"entities": [
{
"name": "movie",
"description": "A cinematic work directed by Christopher Nolan.",
"fields": [
{
"name": "title",
"properties": [
"movie name",
"original title",
]
}
]
},
{
"name": "person",
"description": "An individual involved in the creation of a Nolan movie.",
"fields": [
{
"name": "name",
"properties": [
"identity",
"real name",
"nickname"
]
}
]
},
{
"name": "studio",
"description": "A company that produces and distributes Nolan's movies.",
"fields": [
{
"name": "name",
"properties": [
"studio name",
"company name",
"company"
]
}
]
},
{
"name": "financial_info",
"description": "Financial details related to a Nolan movie's production and performance.",
"fields": [
{
"name": "type",
"properties": [
"amount",
"budget",
"revenue",
"earnings",
]
}
]
}
],
"relations": [
{
"name": "directed_by",
"description": "Indicates that Christopher Nolan directed a movie."
},
{
"name": "starred_in",
"description": "Indicates that an actor starred in a Nolan movie."
},
{
"name": "produced_by",
"description": "Indicates that a studio produced a Nolan movie."
},
{
"name": "wrote",
"description": "Indicates that Christopher Nolan or Jonathan Nolan wrote the screenplay for a movie."
},
{
"name": "has_financial_info",
"description": "Connects a Nolan movie to its financial information."
}
],
"patterns": [
{
"head": "movie",
"relation": "directed_by",
"tail": "person",
"description": "Represents the relationship between a Nolan movie and Christopher Nolan as the director."
},
{
"head": "person",
"relation": "starred_in",
"tail": "movie",
"description": "Represents the relationship between an actor and a Nolan movie they appeared in."
},
{
"head": "studio",
"relation": "produced_by",
"tail": "movie",
"description": "Represents the relationship between a Nolan movie and the studio that produced it."
},
{
"head": "person",
"relation": "wrote",
"tail": "movie",
"description": "Represents the relationship between Christopher or Jonathan Nolan and the movie they wrote."
},
{
"head": "movie",
"relation": "has_financial_info",
"tail": "financial_info",
"description": "Connects a Nolan movie to its associated financial information."
}
]
}
By leveraging the schema editor and following best practices, you can create a well-structured and reliable schema for your knowledge graph in whyhow.