Building an Enterprise Ownership Look-Through Graph with Large Language Models

    This article explains how to build an enterprise ownership look-through system by combining large language models, graph databases, and rule engines. It covers data ingestion, document parsing, structured relationship extraction, indirect ownership calculations, control-rights analysis, data validation, accuracy evaluation, technology selection, and compliance requirements.

    Why the Problem Must Be Defined First

    An enterprise ownership look-through analysis aims to identify an entity’s ultimate ownership and control. The main challenges are:

    • Relevant relationships are scattered across annual reports, articles of association, investment agreements, and other long documents.
    • Indirect ownership percentages must be calculated layer by layer along ownership paths.
    • Ownership relationships change as corporate registration information is updated.

    Large language models are well suited to the first challenge. Graph databases and rule engines are better suited to the latter two.

    1. System Architecture

    The system can be divided into four layers.

    1. Data ingestion layer: Collect corporate registration records, annual reports, litigation documents, and investment agreements. Store the original files in object storage, deduplicate them by file hash, and record their sources and collection times.
    2. Parsing layer: Use OCR to extract text, then split the content by sections and paragraphs. A chunk size of 800 to 1,200 characters can be used initially, with approximately 150 characters of overlap between adjacent chunks to prevent ownership clauses from being split across chunks.
    3. Relationship layer: Have the large language model output entities and relationships according to a JSON Schema. Store the results in relationship tables and send them through a validation workflow.
    4. Graph and query layer: Store nodes and edges in a graph database and provide ownership look-through queries.

    2. LLM Extraction: Prompts and Parameters

    Fix the model version in the configuration. Do not use aliases such as “latest,” which may switch automatically and cause extraction results for the same text to change without notice.

    Recommended parameters include:

    • Set temperature to 0 or close to 0.
    • Reserve max_tokens according to the maximum expected output for each chunk.
    • Retry a timed-out request no more than two times.
    • Send chunks that still fail after retries to a manual review queue.

    The prompt should clearly specify three requirements:

    1. Extract only relationships explicitly stated in the source text.
    2. Attach an original-text citation to every relationship.
    3. Set uncertain fields to null rather than making assumptions.

    Example output structure, with data anonymized:

    1. {
    2. "entities": [
    3. {"id": "p1", "name": "Individual A", "type": "Individual"},
    4. {"id": "c1", "name": "Investment Partnership", "type": "Limited Partnership"}
    5. ],
    6. "relations": [
    7. {
    8. "subject_id": "p1",
    9. "object_id": "c1",
    10. "relation_type": "Shareholder",
    11. "attributes": {"ratio": 0.51, "role": "Executive Partner"},
    12. "evidence": "Quoted text from paragraph X",
    13. "confidence": 0.9
    14. }
    15. ]
    16. }

    Store ownership percentages as numeric values rather than strings such as "51%". Standardize dates to YYYY-MM-DD, and specify whether each date represents an “as of” date or the effective date of a change.

    The inputs, tasks, outputs, and validation methods for each stage can be organized as follows:

    Input Model Task Output Validation Method
    Section text chunk Entity recognition Entity name and type Match the name with a unified entity identifier or identification number
    Section text chunk Relationship extraction Shareholder, investment, nominee holding, and other relationships Verify that the evidence text appears in the source
    Ownership change announcement Date and percentage extraction Effective date and post-change percentage Confirm that the percentage is between 0 and 1 and that the total ownership of all shareholders in the same company does not exceed 100%
    Entity name Entity resolution Unified entity ID Perform sample-based manual review of potentially different entities with the same name

    3. Graph Modeling and Ownership Look-Through Calculations

    Ownership look-through is not simply a matter of finding paths. Once paths are identified, three additional calculations are required.

    1. Multiplication along a path: The indirect ownership percentage is the product of the ownership percentages across each edge. For example, if A owns 60% of B and B owns 50% of C, A indirectly owns 30% of C.
    2. Summation across multiple paths: If multiple paths lead to the same target, add the indirect ownership percentages from those paths.
    3. Control-rights determination: Ownership percentage does not necessarily equal control. Control should be determined separately based on rules involving articles of association, voting-rights authorizations, acting-in-concert agreements, and similar documents. The holdings of parties acting in concert should be combined, and nominee holding arrangements should be traced to the ultimate beneficial owner.

    The following query demonstrates path identification only. Variable-length paths must have a depth limit and must exclude repeated nodes. When relationship types contain Chinese characters, enclose them in backticks.

    1. MATCH path = (p:Person {id: $pid})-[:`Shareholder`*1..3]->(c:Company)
    2. WHERE ALL(n IN nodes(path) WHERE size([x IN nodes(path) WHERE x = n]) = 1)
    3. RETURN path

    Calculate ownership percentages in application code rather than inside the query:

    1. def effective_ratio(path_ratios):
    2. ratio = 1.0
    3. for r in path_ratios:
    4. if r is None:
    5. return None # Do not fill in missing ratios; mark the result as not computable
    6. ratio *= r
    7. return ratio

    Cross-shareholding and circular ownership can cause a path to return to its starting point or to a previously visited node. During traversal, record visited nodes. When a repeated node is encountered, stop that branch and record the chain in an exception table.

    A maximum depth of five layers can be used initially and adjusted based on business samples. Chains that exceed the configured depth should be sent for manual review.

    4. Common Errors and Troubleshooting

    • Entity ambiguity: Companies or individuals with the same name may be incorrectly merged. Use a unified entity identifier or identification number as the primary key. If the identity cannot be confirmed, do not merge the entities.
    • Missing percentages: The source may use vague wording such as “a certain amount” or omit the percentage entirely. Set ratio to null, mark the result as not computable during calculation, and never fill the value with 0 or 1.
    • Inconsistent date definitions: An annual report’s reporting date may be mixed with the effective date of a corporate registration change. Preserve a date-type field for every relationship.
    • Hallucinated relationships: The model may output a relationship that does not exist in the source. Perform string matching against the evidence text. Discard relationships that fail the match and write them to the log.
    • Ownership totals above 100%: This often occurs when installment-based contributions are involved or when subscribed and paid-in capital data are mixed. Store subscribed capital and paid-in capital in separate fields.

    5. Evaluating Accuracy

    String matching can only show that the evidence text exists; it cannot prove that the relationship itself is correct. Relationship correctness must be evaluated against an annotated dataset.

    Have human reviewers annotate at least 200 relationships, covering cases such as nominee holding, multi-level ownership, and circular ownership. Calculate precision and recall separately for entity recognition, relationship type, and percentage values.

    Whenever the model version or prompt changes, rerun the evaluation on the same annotated dataset. The updated version should not be deployed unless the evaluation metrics do not decline.

    6. Technology Selection and Appropriate Boundaries

    When selecting a graph database, evaluate three areas:

    • Whether variable-length path queries provide sufficient performance.
    • Whether the system supports access control and audit logging.
    • Whether it can integrate with existing risk-control systems.

    For smaller datasets, recursive queries in a relational database can be used for initial validation. A migration to a graph database can be considered as the data volume grows.

    This approach should not be applied directly in the following situations:

    • Only a single ownership layer needs to be queried; corporate registration data may be sufficient.
    • The data cannot be obtained under valid legal authorization.
    • The output is expected to provide a legal conclusion.

    System results should be treated as investigative leads. They cannot replace the judgment of legal counsel or compliance professionals.

    7. Compliance Requirements

    The use of corporate registration information and court documents must have a valid legal basis. Confirm the scope of data authorization before collection.

    After ingestion, mask or encrypt individuals’ identification numbers, addresses, and telephone numbers. Apply role-based access controls to the graph database, and log every ownership look-through query for auditing, including the requester, query time, and query parameters.

    When publishing examples externally, remove identifiable personal information. All entities in the examples used in this article have been anonymized.