Context, Semantics & RAG

Build a Knowledge Graph: Modeling, Mapping and Inference Workshop

In a hands-on workshop at the Data Science Innovators Conference 2023, Stardog co-founder Mike Grove built a customer 360 knowledge graph live. He covered data modeling, virtual mapping of source data, and an inference engine that derives new relationships.

By The AI Enterprise Magazine Team4 min read

Key takeaways

  • Connections create value. Grove said linking datasets lets organizations ask questions single datasets cannot answer.
  • Start small. A handful of concepts and attributes is enough to begin modeling.
  • Models are lenses. Multiple models can describe the same data without changing it.
  • Mapping does not copy data. Queries are translated to the source systems, such as SQL.
  • Inference is logical and explainable. Rules live in the graph, are computed at query time and can show their proof.
Build a Semantically Enriched Knowledge Graph. Watch on YouTube

In a hands-on workshop at the Data Science Innovators Conference 2023, "Build a Semantically Enriched Knowledge Graph," Mike Grove, founder and SVP of Engineering and Product at Stardog, showed attendees how to build a customer 360 knowledge graph in about 90 minutes. Grove, who described himself as the original architect of the Stardog platform, covered data modeling, mapping source data, and using an inference engine to derive new relationships. The demonstration used Stardog's free cloud tools and sample CSV files that attendees could follow along with.

Why do knowledge graphs matter for enterprise data?

Grove argued that the core data problem is disconnection. A single dataset can answer a simple question about a customer, but connecting that customer to rewards, social activity, support history and purchases lets an organization ask richer ones, such as whether a customer posted negatively after a recent transaction.

He said knowledge graphs rest on three principles: virtualization, semantics and inference. Data stays where it sits, a semantic layer sits on top, and an inference engine adds connections. Grove said this makes the approach lighter than the heavyweight big data and master data management efforts that preceded it. He also said knowledge graphs are a critical component of data fabric and data mesh patterns.

He distinguished semantic graphs from simple graph databases by their combination of data and metadata, so that a connection carries business meaning. In his example, an edge is a three-part statement like "Tom Hanks acted in Toy Story." Asked whether Stardog is built on Neo4j, he said no, describing it as a separate system built from scratch and aimed at data management and integration problems.

How should you model data for a knowledge graph?

Grove boiled data modeling down to a few points. Models describe concepts, with classes as nouns, plus attributes and relationships. He advised starting with a handful of concepts and a couple of attributes. "A little modeling goes a long way," he said, passing on a line from his college advisor.

He recommended small, composable models stacked like Lego, with core concepts such as person and address at the root and specific models, such as a churn-risk definition, at the leaves. Several models can describe the same data. "Think of these models like lenses," he said. There is no single definition of customer as in master data management, and Sales and Finance can each use their own view of the same data.

How do you map source data into the graph?

In Stardog Designer, Grove built a model with customers, purchases, products and categories, with names, emails, prices and quantities as attributes. He then mapped CSV files to it. Mapping is a correspondence between a source column and a graph property; no data is copied. Stardog uses the mappings to translate queries into the source system's language, such as SQL.

An auto-mapping feature suggested most matches, he said, and he added missed properties and relationships on the fly. Grove said the same experience applies to relational sources and that Stardog can pick up sources through data catalogs. The group rebuilt much of the customer 360 graph in about 20 minutes. A file-based option can also generate a class from a file's structure, and Grove said Stardog is working on large language model integration that could draft a data model in seconds.

What does the inference engine add?

Grove described inference as making the implicit explicit. Rules like "any purchase over ten thousand dollars is a large purchase" live in the graph instead of in external code. Inferred relationships are not stored; they are computed when queried, across sources.

He demonstrated rules for large purchases, big spenders, baby department shoppers and 2022 buyers. Combining them found 20 customers among 5,000 generated records without changing the data. Because the rules sit in the model, he said, changing a definition does not require rewriting queries.

Grove contrasted this with machine learning. Stardog's inference is logical, he said, "mathematically provable," and can show the chain of data and rules behind a derived link, which he tied to explainable AI.

What did Grove say about security and adoption?

On access control, Grove said queries run with the user's permissions, so different users can see different results. The knowledge graph respects source system controls and has its own, such as hiding a sensitive property like a Social Security number from everyone except an HR role. He said a knowledge graph improves recommendation engines by supplying better data, not by unlocking a new algorithm.

On adoption, he advised starting with one data source, then adding related ones sprint by sprint. He suggested building a first model yourself, because large public models are hard to start with. He noted early financial services uses around compliance reporting, fraud and anti-money laundering.

Where can you learn more about enterprise data strategy?

Semantic layers and knowledge graphs continue to come up on the agenda for enterprise AI leaders. The AI Enterprise Conference 2027 takes place Tuesday, August 31, 2027, at Pier Sixty in New York City. Details are at /events/ai-enterprise-conference/, and registration is coming soon.

Frequently asked questions

What is a knowledge graph?

Grove described a semantic graph as combining data and metadata so that connections carry business meaning and machines can understand them.

Does a knowledge graph copy my data?

No. Mapping links source columns to graph properties, and queries are translated to the source systems.

How is inference different from machine learning?

Grove said Stardog's inference is logical and mathematically provable, not statistical, and can show the proof behind a derived relationship.

How do you get started with a knowledge graph?

Grove suggested picking one data source, then adding related ones sprint by sprint, and building a first model yourself.

This article is based on remarks by Mike Grove, Founder, SVP Engineering & Product, Stardog at Data Science Innovators Conference 2023 on April 12, 2023. More coverage: More AI Connect Events.

Filed under: Context, Semantics & RAG, Data & AI Infrastructure

More from AI Enterprise Magazine

Read the magazine