Introduction To Knowledge Graph

samir khanal
Analytics Vidhya
Published in
3 min readMar 28, 2021

Knowledge Graph is a knowledge base of entities and the relationships between them. It is a graph formed by representing entities (like people, places, objects) as nodes, and relationships between entities (like is located in, is a, etc) as edges. It contains Facts where Facts are typically represented as “SPO” triples: (Subject, Predicate, Object).
It actually contains a head entity, relation and a tail entity, or in simpler terms: subject, relation and object.

It acquires and integrates information into an Ontology and applies a reasoner to derive new knowledge.(Lisa Ehrlinger and Wolfram Wöß – University of Linz in Austria)

(Ontology: a set of concepts and categories in a subject area or domain that shows their properties and the relations between them.)

It represents a collection of interlinked descriptions of entities – real-world objects and events, or abstract concepts (e.g., documents) – where:

  • Descriptions have formal semantics that allow both people and computers to process them in an efficient and unambiguous manner
  • Entity descriptions contribute to one another, forming a network, where each entity represents part of the description of the entities, related to it, and provides context for their interpretation.

(Semantics is the study of the relationship between words and how we draw meaning from those words.)

Knowledge Graph can be Created by following Steps:

Data Acquisition:

Data can either be self collected or we can use others datasets.

Here, If we have to create our own dataset, we can segment the targeted text, Differentiate and extract the subjects and objects, then, determine the relationships between them.

Generating RFD triples and quads:

We can use yarrrml-parser which translates YARRRML custom rules to RML(RDF Mapping language) rules where the YARRRML rules are translated along with the execution of the RMLMapper with the corresponding RML rules to generate RDF(Resource Description Framework) triples and quads.

(YARRRML : A human readable text-based representation for declarative Linked Data generation rules.)

(RML is a generic scalable mapping language defined to express rules that map data in heterogeneous structures and serializations to the RDF data model.)

Storing Triples in Graph Database:

Storing the generated triples and quads in graph databases for future uses.

Some Available Graph Databases:

  1. Neo4j
  2. ArangoDB
  3. OrientDB
  4. Amazon Neptune

Mapping of Data to Knowledge Graph:

We can use RDFlib for mapping of RDF data into Knowledge graphs.

OR,

We can directly visualize the Knowledge Graph from the Graph Database.

(RDFlib is a pure Python package for working with RFD data which includes parsers, serializers, graph interface and many more.)

Example:

Fig: Sample Diagram of Knowledge Graph[1]

From this Knowledge Graph, We can Infer that, P.R. China is a country with the capital Beijing which has Chinese name as in the diagram.

Applications of Knowledge Graph:

  1. Question Answering System(Semantic Parsing Based, Information Retrieval Based,Embedding Based and Deep Learning Based): Semantic information from KGs can be used to enhance search results in semantic-aware question answering (QA) services.
  2. Recommender System(Embedding Based and Path Based): The relations with various types in a KG help to improve the recommender accuracy and increase the diversity of recommended items. KGs also brings interpretability to recommender systems.
  3. Information Retrieval: Incorporating entity data from KGs for Information Retrieval. Like: Google Knowledge Graph performs the search tasks over entities with Graph Search.
  4. Domain-Specific(Medical, Cyber Security, Financial, News, Education,etc.): Integrating various data & information and developing a Knowledge Graph in different domains to infer different pieces of information of that domain.

References:

[1]: Wu, Tianxing & Qi, Guilin & Li, Cheng & Wang, Meng. (2018). A Survey of Techniques for Constructing Chinese Knowledge Graphs and Their Applications. Sustainability. 10. 3245. 10.3390/su10093245.

[2]: Zou, Xiaohan. (2020). A Survey on Application of Knowledge Graph. Journal of Physics: Conference Series. 1487. 012016. 10.1088/1742–6596/1487/1/012016.

--

--