1 of 41

Knowledge Graph Foundations

2 of 41

Outline

  • Introduction and motivation
    • History and areas of application
  • Knowledge Representation and Query Languages
    • RDF og RDFS
    • OWL
    • SPARQL
  • Ontologies and Vocabularies
    • Some Standard Vocabularies
    • schema.org
  • Data Lifting Standards
    • RDB2RDF
    • GRDDL

3 of 41

Introduction

“A knowledge graph consists of a set of interconnected typed entities and their attributes.”

Popularized by Google in 2012

Now also used by Facebook, LinkedIn and Microsoft

4 of 41

The Semantic Web (“the Web of meanings”)

History

Semantic web

RDF and OWL

Knowledge graph

Application

Open innovation

Market Intelligence

IBM Watson

5 of 41

IBM Watson

6 of 41

“A knowledge graph is a set of typed entities (with attributes) which relate to one another by typed relationships.

The types of entities and relationships are defined in schemas that are called ontologies. Such defined types are called vocabulary.

In this section, we will introduce �the standard for representing knowledge graphs (RDF), �two standards for defining ontologies (RDFS and OWL) �and the standard for querying knowledge graphs (SPARQL).

7 of 41

How to read this book

8 of 41

Outline

  • Introduction and motivation
    • History and areas of application
  • Knowledge Representation and Query Languages
    • RDF og RDFS
    • OWL
    • SPARQL
  • Ontologies and Vocabularies
    • Some Standard Vocabularies
    • schema.org
  • Data Lifting Standards
    • RDB2RDF
    • GRDDL

9 of 41

Representing

Knowledge Graphs

10 of 41

RDF - Resource Description Framework

  • Originally created by W3C in 1999�
  • Modern standard to describe entities
    • person, homepage, company
    • Anything we can identify!�
  • structured -> machine understandable -> interoperability among applications exchanging information on the web

11 of 41

RDF Triples/Statements

12 of 41

RDF Triples/Statements Example 1

Kristian

Taco

likes

13 of 41

RDF Triples/Statements Example 2

14 of 41

Node Types

  • IRI
    • International Resource Identifier
  • Literal
    • strings, numbers or dates
    • datatype
      • language if specific datatype
  • Blank
    • “this is an existing thing”

15 of 41

Node Types (cont.)

IRI�BlankLiteral

IRI�Blank

IRI

16 of 41

Node Types Example

IRI

Literal

IRI

17 of 41

Prefixes

18 of 41

RDF Serialising

  • Several syntaxes for storing and exchanging RDF
    • Turtle
    • RDF/XML
    • RDFa
    • N-Triples
    • NQUADS
    • JSON-LD

19 of 41

RDF Serialising Example

@prefix dbpedia: <http://dbpedia.org/resource/>

@prefix dbpedia-owl: <http://dbpedia.org/ontology/>�

dbpedia:Bolivia dbpedia-owl:longName "Plurinational State of Bolivia" .

Example with Turtle:

20 of 41

Defining Ontologies

21 of 41

RDFS - Resource Description Framework Schema

  • Ontologies are schemas�
  • Simple schema language for RDF knowledge graphs
  • RDF defines the structure of the data �
  • RDFS defines semantic relationships�

22 of 41

RDFS Example

org:Organization rdf:type rdfs:Class .

org:Start-up a rdfs:Class .

org:hasHomePage rdf:type rdfs:Property .

org:Start-up rdfs:subClassOf org:Organization .

23 of 41

OWL - Web Ontology Language

  • OWL2 W3C Recommendation Status�
  • “RDFS extension”
  • Vocabulary - types of entities and relationships defined in ontologies�
  • Additional vocabulary defined by the OWL schema
    • Cardinality
    • Property chain
    • Self-restriction
    • Symmetric
    • Reflexive

24 of 41

OWL Example

Example from the Travel ontology:

:borders rdf:type owl:ObjectProperty ,� owl:SymmetricProperty ;� owl:propertyChainAxiom ( :hasBoundary� :boundaryOf� ) .

25 of 41

Querying Knowledge Graphs

26 of 41

SPARQL

  • Standard query language for RDF and OWL�
  • Turtle syntax
    • SQL like�
  • Based on pattern-matching mechanism

Mer om TURTLE og SPARQL

De fire "ledige" fikser dette

27 of 41

“A knowledge graph is a set of typed entities (with attributes) which relate to one another by typed relationships.

The types of entities and relationships are defined in schemas that are called ontologies. Such defined types are called vocabulary.

In this section, we will introduce �the standard for representing knowledge graphs (RDF), �two standards for defining ontologies (RDFS and OWL) �and the standard for querying knowledge graphs (SPARQL).

28 of 41

Oversikt

  • Introduction and motivation
    • History and areas of application
  • Knowledge Representation and Query Languages
    • RDF and RDFS
    • OWL
    • SPARQL
  • Ontologies and Vocabularies
    • Some Standard Vocabularies
    • schema.org
  • Data Lifting Standards
    • RDB2RDF
    • GRDDL

29 of 41

Some standard

schemas and vocabularies

30 of 41

Standard Ontologies and Vocabularies

  • Organisation Ontology�
  • GoodRealtions�
  • Data Cube Vocabulary
  • Friend-of-a-Friend (FOAF)
  • schema.org

31 of 41

schema.org

  • Introduced by Google, Yahoo! and Bing in 2011�
  • Over 10 million sites�
  • Not intended to be a “global ontology”
    • Improve display of search results

32 of 41

Oversikt

  • Introduction and motivation
    • History and areas of application
  • Knowledge Representation and Query Languages
    • RDF and RDFS
    • OWL
    • SPARQL
  • Ontologies and Vocabularies
    • Some Standard Vocabularies
    • schema.org
  • Data Lifting Standards
    • RDB2RDF
    • GRDDL

33 of 41

Data Lifting Standards

34 of 41

Data Lifting Standards

35 of 41

Why? 👀

Legacy data

36 of 41

RDB2RDF

Relational database 2 Resource description framework

Make a choice

  • Direct mapping vs
  • using a mapping language

37 of 41

Tools

38 of 41

GRDDL

X(HT)ML -> RDF

Crawl webpages, discover rdf standards, use GRDDL to convert to your own knowledge graph

39 of 41

Knowledge graph vs Linked data

Linked data

  • many RDF datasets linked together

A knowledge graph is a structured dataset that is compatible with the RDF data model and has an (OWL) ontology as its schema.

  • high integrity and reliability

40 of 41

RDF vs Linked Data vs Knowledge Graph

Y= Yes, NN = Not Necessarily, N = No, L= Limited

41 of 41

Web search vs enterprise

Web

  • Small hierarchy
  • good enough
  • Schema.org, 700 types

Enterprise

  • More functionality than just search
  • can make use of more complex structures