From Unstructured Text to Structured Knowledge: A General Data Modeling Methodology

    This article explains how to turn unstructured biographical text into structured, machine-readable data. It walks through a five-step methodology—modeling, implementation, relationship mapping, data cleaning, and API serving—using JSON and graph schemas to show how developers can extract entities, attributes, and events from raw text and expose them through retrieval-friendly interfaces.

    From Unstructured Text to Structured Knowledge: A General Modeling Methodology

    1. Introduction: Why Developers Should Care About Knowledge Modeling

    More than 80% of the information we process every day is unstructured text: documents, logs, user reviews, historical archives, and more. Raw information such as “Oscar-Claude Monet (November 14, 1840 – December 5, 1926)…” is a typical example of semi-structured or unstructured text. It contains key entities (a person), attributes (name, birth and death dates, nationality), and a chronologically ordered list of events (a life timeline).

    The goal of this methodology is not to analyze Monet’s art, but to demonstrate how to transform such text into a structured data object that programs can efficiently search, link, and display. This covers:

    • Data Modeling: Defining entities, attributes, and relationships.
    • Information Extraction: Identifying and populating fields from raw text.
    • Data Structure Implementation: Representing the data with JSON, database table schemas, or graph database models.
    • Extensibility Considerations: Designing the structure to accommodate more information of the same kind.

    2. Step 1: Abstraction and Data Modeling

    Before writing any code, you must design the data structure. Start by identifying the core objects in the raw information. Looking at the text, we can abstract the following core entities:

    1. Person Entity: Represents the subject being described. Its core attributes include:

      • id (unique identifier, e.g., person_001)
      • full_name (full name, e.g., “Oscar-Claude Monet”)
      • common_name (common name, e.g., “Claude Monet”)
      • birth_date (birth date, normalized to YYYY-MM-DD)
      • death_date (death date, normalized to YYYY-MM-DD)
      • nationality
      • gender
      • profession
      • domain (art domain)
    2. Event Entity: Represents a point in time or a time span in the person’s life. The Person and Event entities have a one-to-many relationship. Attributes include:

      • id (unique identifier)
      • person_id (associated person ID, foreign key)
      • year (year or time span in which it occurred)
      • description (event description, e.g., “The family moved to the port city in northern Normandy, France”)
      • related_entities (associated entities such as places or other people, e.g., “Eugène Boudin”)
    3. Work Entity: Represents a creative output.

      • id
      • person_id
      • title (work title, e.g., “Impression, Sunrise”)

    This modeling approach breaks complex person information into manageable parts and avoids storing everything in one large block of text. It is a common pattern in relational and NoSQL database design.


    3. Step 2: Designing and Implementing the Data Structure

    Now we implement the model using general-purpose data structures. JSON is used as the example here because it is widely used in web development and API interactions and expresses nested and list structures well.

    3.1 Person Entity (JSON Representation)

    1. {
    2. "id": "person_001",
    3. "full_name": "Oscar-Claude Monet",
    4. "common_name": "Claude Monet",
    5. "aliases": ["Claude Monet", "Oscar-Claude Monet"],
    6. "birth_date": "1840-11-14",
    7. "death_date": "1926-12-05",
    8. "birthplace": "Paris, France",
    9. "nationality": "French",
    10. "gender": "Male",
    11. "profession": "Painter",
    12. "art_domain": "Impressionism",
    13. "roles": ["Leading figure of Impressionism", "One of the founders", "Leader of the Impressionist movement"]
    14. }

    3.2 Event List (JSON Array of Events)

    To keep the data atomic, events should be stored as a separate array linked to the main entity through person_id.

    1. {
    2. "person_id": "person_001",
    3. "events": [
    4. {
    5. "event_id": "evt_001",
    6. "year": 1840,
    7. "description": "Born on Lafayette Street in Paris."
    8. },
    9. {
    10. "event_id": "evt_002",
    11. "year": 1845,
    12. "description": "The family moved to the port city of Le Havre in northern Normandy, France, where he spent his childhood.",
    13. "location": "Le Havre"
    14. },
    15. {
    16. "event_id": "evt_003",
    17. "year": 1858,
    18. "description": "Met the landscape painter Eugène Boudin, who inspired him to try painting landscapes outdoors.",
    19. "related_persons": ["Eugène Boudin"]
    20. }
    21. ]
    22. }

    This design separates the static attributes of the “Claude Monet” entity (name, birth and death dates) from its dynamic historical events. When querying, you can retrieve person information alone or all events sorted chronologically, which is highly flexible.


    4. Step 3: Building Knowledge Graph Relationships

    To make deeper use of this data, we can map it to a graph structure. In a graph database, entities are “nodes” and relationships are “edges.”

    4.1 Node Schema

    • Node Labels: Person, Location, Event, Work
    • Properties:
      • Person: {name, birth, death, nationality}
      • Location: {name, type} (e.g., Le Havre, type: City)
      • Event: {year, description}

    4.2 Relationship Schema

    • Person -[:BORN_IN]-> Location
    • Person -[:LIVED_IN]-> Location
    • Person -[:MET]-> Person (e.g., Monet -[:MET]-> Boudin)
    • Person -[:CREATED]-> Work (e.g., Monet -[:CREATED]-> “Impression, Sunrise”)
    • Person -[:PART_OF_EVENT]-> Event

    This modeling approach enables complex associative queries, such as: “Find all artists who lived in the Normandy region during the 1850s and met other painters.” In a traditional tabular database, this kind of query requires complex multi-table JOIN operations, whereas in a graph database it is very efficient.


    5. Step 4: Data Cleaning and Standardization

    Data in raw text is often inconsistently formatted and must be cleaned before ingestion.

    • Date Standardization: Convert “November 14, 1840” to 1840-11-14 or a Unix timestamp. This is key to ensuring data can be sorted and computed.
    • Text Normalization: Link aliases such as “Claude Monet,” “Oscar-Claude Monet,” and their variants to the same person_id.
    • Entity Disambiguation: A text mentioning “Georges Clemenceau, the future Prime Minister of France” refers to an entity. You need to determine whether it is the historically famous Georges Clemenceau and link the entity to a globally unique ID (for example, an ID from an authoritative person database) rather than merely storing it as a string.
    • Geocoding: For a place like “Le Havre,” you can associate latitude and longitude coordinates to support later map visualization or geographic queries.

    6. Step 5: Building a Searchable API

    Once the data is modeled and cleaned, the next step is to provide interfaces for external callers. A typical RESTful API design is as follows:

    • GET /persons/{person_id}: Retrieve detailed information about a person (including attributes and event list).
    • GET /persons/{person_id}/events: Retrieve only the event list.
    • GET /persons/{person_id}/works: Retrieve the list of all works.
    • GET /events?year=1858: Retrieve all events that occurred in 1858.
    • GET /persons?nationality=French: Retrieve all persons of French nationality.

    For more complex queries, you can provide a graph query interface (for example, an HTTP wrapper around query languages such as Gremlin or Cypher) that lets users submit flexible graph traversal requests.


    7. Summary and Outlook

    Transforming a descriptive piece of text (such as Monet’s biography) into structured data is a core skill widely applied in knowledge management, digital humanities, intelligent customer service, enterprise knowledge bases, and more. The core workflow can be summarized as:

    1. Modeling: Define entities and their relationships.
    2. Implementation: Represent the data with a suitable storage structure (relational, document, or graph database).
    3. Connecting: Link entities through relationships to form a network.
    4. Cleaning: Ensure data quality and consistency.
    5. Serving: Expose access capabilities through APIs.

    In this article, we did not analyze Monet’s artistic achievements; instead, we used him as a “data source” to demonstrate how to transform human-readable text into structured knowledge assets that machines can understand, query, and extend. This methodology can be applied to any scenario that requires extracting knowledge from unstructured text and building an application system on top of it.