This is the first of a two-part series – this first piece is to break down the difference between knowledge models, knowledge graphs, and ontologies.  These words are often used interchangeably, and it will be essential to understand the significant differences between these three concepts moving forward. The second part will be how these concepts apply to AI, specifically within the realm of DoD.  This first section is relatively short as I will only be covering defining and providing context to knowledge models, ontologies, and knowledge graphs. 

Knowledge Models, ontologies, and knowledge graphs are related concepts in artificial intelligence and knowledge representation but have distinct meanings and purposes in information and knowledge management. While these terms are related and may overlap in certain contexts, understanding their specific meanings helps clarify their roles and applications in knowledge management and representation.

This conversation can get convoluted quickly, and I have found that utilizing an example is the best way to demonstrate the differences between these concepts.

For this example, let’s examine some movie information.  Below are some charts I found on the internet that have been simplified for this example.  The first chart has a movie with the director and producer, and the second is of three actors, the movies they were in, and the year the movie was released.  I will summarize the information in the tables in the following sections to represent the core ideas, concepts, and applications within knowledge models, ontologies, and graphs. 

FilmDirectorProducer
GoodfellasMartin ScorseseIrwin Winkler
GreaseRandal KleiserAllan Carr
Kill BillQuentin TarantinoLawrence Bender
Pulp FictionQuentin TarantinoLawrence Bender
Table 1: Chart of movie, director & producer
ActorYearFilm
John Travolta1978Grease
John Travolta1994Pulp Fiction
Samuel L. Jackson1994Pulp Fiction
Samuel L. Jackson1990Goodfellas
Samuel L. Jackson2003Kill Bill: Vol. 1
Uma Thurman2003Kill Bill: Vol. 1
Uma Thurman1994Pulp Fiction
Table 2: Chart of actor, year, and film

Knowledge Models

A knowledge model encompasses various methods and techniques for organizing and representing knowledge. A knowledge model is a structured framework that defines and organizes knowledge within a specific context. It includes the entities, attributes, relationships, rules, and constraints relevant to a particular domain or problem space.  

Entities

To break it down further – an entity is a real-world tangible object such as a person, place, thing, or concept; referring to our spreadsheet above, we can ascertain that the following entities are in the spreadsheets:

  • Movie Name
  • Movie Director
  • Movie Producer
  • Actor
  • Year of release

I often hear the words entity, class, object, and instance used interchangeably – it is essential to understand the difference between what is explicitly being referenced when addressing nuance. 

  • Entity – as noted in our example above, is a real-world object that exists.  An entity is generally part of a relational database. 
  • Class – an example of a class from the above tables would be: people, date, profession, etc.
  • An object and instance are generally interchangeable but should be clarified depending on the audience; in object-orientated programming (OOP), there is a difference – from a modeling and customer-facing domain, they are almost always used interchangeably.  An object or instance is a particular thing, such as John Travolta, Goodfellas, or 1989 from our tables above. 

Attributes

Attributes differ slightly depending on the context in which they are being used but are a way to describe or quantify an object.  Generally, the columns in a data set that are used to develop or test a model are data attributes.  So, for our movie data example, some attributes could be Directors with an ‘a’ in their first name or movies released before 1993. 

FilmDirectorProducer
GoodfellasMartin ScorseseIrwin Winkler
GreaseRandal KleiserAllan Carr
Table 3: Directors with an ‘a’ in their first name
ActorYearFilm
John Travolta1978Grease
Samuel L. Jackson1990Goodfellas
Table 4: Movies released before 1993

Relationships

In knowledge models (including ontologies and knowledge graphs), relationships are the connections between objects or entities.  Referring to our example we could note:

  • Quentin Taratino (object) directed (relationship) Pulp Fiction (object).
  • John Travolta (object) acted in (relationship) Grease (object).
  • Umma Thurman (object) acted in (relationship) a movie (class) released in (relationship) 1994 (object). 

Rules

Rules are prewritten by developers and are based on expert human knowledge.  This enables any applicable AI in the system to process input data and produce results.  These rules are generally very domain-specific, so in our case, some rules that may be outlined are:

  • A director can also be an actor
  • An actor can also be a producer
  • An actor can perform in multiple movies in any given year
  • A producer must be alive to produce a movie. 

In our example, these rules can help us glean even more knowledge.  While not included in the chart, Producer Allan Carr died in 1999, so with the above rules, we can say that he could not produce a movie after 1999.  Quentin Tarantino famously has small cameo bits in his movies, so the above rules allow this anomaly.   

Constraints

Constraints allow the knowledge model only to use the data or information we need.  For our example, we can say that the date should only consist of a four-digit year, or movie names should always have the first letter capitalized.  These constraints remove irrelevant data or filter out data that doesn’t adhere to the constraints.   

Putting it all together

Knowledge models capture and represent knowledge in a way that can be applied to solve specific problems or make informed decisions. They serve as a blueprint for organizing and structuring information within a particular application or system.  For example, in a knowledge model about medical diagnoses, rules might specify how symptoms relate to potential illnesses, and a taxonomy might categorize diseases based on their characteristics.

A knowledge model may include different components such as rules, ontologies, and representations of entities and their relationships. Knowledge models can be implemented using various technologies, including knowledge graphs, expert systems, and machine learning models.  Knowledge models can incorporate multiple techniques, not limited to graph-based representations.

Ontology

There is a significant overlap between knowledge graphs and ontologies. In many cases, a knowledge graph may use an ontology as a foundational structure for defining the types of entities and relationships within a domain. An ontology is a formal representation of knowledge that defines the concepts within a domain and the relationships between them. It provides a structured framework for organizing information, capturing a domain’s semantics (words), and facilitating interoperability and communication between different systems. Ontologies help create a shared understanding of a specific domain or subject matter. Artificial intelligence, knowledge representation, and semantic web technologies often use them to enable better knowledge sharing and reasoning. 

While a knowledge graph focuses on representing relationships and capturing real-world connections, an ontology provides a formal framework for defining the terms and concepts used in that representation.  A knowledge graph emphasizes information organization through relationships, often using a graph structure. At the same time, ontology focuses on defining the vocabulary and meaning within a specific domain, usually through formal logic-based specifications. While they serve different roles, they are often used to represent knowledge in each context comprehensively.

Put simply, it is essential that we understand what each of the entities and attributes mean specifically.  For example, the word ‘actor’ could mean various things depending on the domain.  Looking at Merriam Webster’s we can see that actor has three main definitions:

Figure 1: Merriam-Webster definition of an actor

The second definition, specifically section a, is the one that fits the domain we are working in – we would officially adopt the definition of an actor as ‘one who acts in a play, movie, or television show.’ This word actor has now been defined for the entire domain, and all developers, modelers, and other technology personnel will know that the word actor points explicitly to that definition.  Below is a table that defines the classes and attributes we will need for our ontology. 

Semantic (word)Class/AttributeDefinitionSource
Directed ByAttributeThe person who supervises the production of a show (as for stage or screen). Derived from Merriam Websters
Performs InAttribute The person who completes the action of representing a character in a play. Derived from Merriam Websters
Produced ByAttributeThe person who supervises or finances a play, movie, or television show.Derived from Merriam Websters
ActorClassOne who acts in a play, movie, or television show.Merriam Websters
DirectorClassA person who supervises the production of a play, movie, or television show. Merriam Websters
MovieClassA recording of moving images that tells a story and that people watch on a screen or televisionMerriam Websters
ProducerClassA person who supervises or finances a work (such as a staged or recorded performance) for exhibition or dissemination to the publicMerriam Websters
Table 5: Definitions of classes and attributes

From this information, we can start developing our classes. Let’s stick with Movie, Director, Producer, and Actor to simplify the example.  We associate the classes and attributes and have formed an ontology with well-defined classes and attributes usable across the system. 

A diagram of a movie  Description automatically generated

Knowledge Graph

A knowledge graph is a specific type of knowledge model that focuses on representing information using nodes and edges.  A knowledge graph is a type of knowledge representation that captures knowledge in the form of entities, relationships, and attributes. It organizes information in a graph structure, where nodes represent entities, edges represent relationships between entities, and attributes provide additional information about entities. Knowledge graphs often adhere to semantic web standards, such as RDF (Resource Description Framework) and OWL (Web Ontology Language).  It is commonly used for information retrieval, semantic search, and to enhance the understanding of relationships between entities in a specific domain.  For example, if we take our ontology from above and apply the data from the tables in the ontology section, we can see that our knowledge graph starts to take shape.  We are applying the data to the ontology and now have an excellent start to a knowledge graph.    

Knowledge graphs are used to model and connect diverse sources of information, providing a flexible and scalable way to represent and query knowledge. They are commonly employed in semantic search, recommendation systems, and data integration applications.  A knowledge graph can be considered a specific type of knowledge model that emphasizes knowledge representation through a graph structure. In other words, a knowledge graph is a model, but not all knowledge models are necessarily represented as graphs.

Movie diagram

SUMMARY

  • Knowledge Model is a structured framework defining entities, attributes, relationships, rules, and constraints within a specific context, serving as a blueprint for organizing knowledge in applications or systems.
  • Ontology formally represents concepts and relationships within a domain, emphasizing a shared understanding of semantics.
  • Knowledge Graph represents knowledge using a graph structure, connecting entities through relationships and attributes, facilitating flexible and interconnected data models.

In the next blog we will discuss how these concepts apply to AI, specifically within the DoD domain.