21
KIT University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association 1 Institute of Applied Informatics and Formal Description Metthods (AIFB), Karlsruhe, Germany 2 University of Southampton, United Kingdom www.kit.edu SPARQL Query Verbalization for Explaining Semantic Search Engine Queries Basil Ell , 1 Andreas Harth, 1 Elena Simperl 2 11 th Extended Semantic Web Conference 2014 28 May 2014, Anissaras/Heronissou, Crete, Greece

SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Embed Size (px)

DESCRIPTION

This presentation was given at the 11th Extended Semantic Web Conference (ESWC '14), Anissaras/Heronissou, Crete, Greece, and is related the publication of the same title. In this paper we introduce Spartiqulation, a system that translates SPARQL queries into English text. Our aim is to allow casual end users of semantic applications with limited to no expertise in the SPARQL query language to interact with these applications in a more intuitive way. The verbalization approach exploits domain-independent template-based natural language generation techniques, as well as linguistic cues in labels and URIs.

Citation preview

Page 1: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

KIT – University of the State of Baden-Wuerttemberg and

National Research Center of the Helmholtz Association

1 Institute of Applied Informatics and Formal Description Metthods (AIFB), Karlsruhe, Germany 2 University of Southampton, United Kingdom

www.kit.edu

SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Basil Ell,1 Andreas Harth,1 Elena Simperl2

11th Extended Semantic Web Conference 2014

28 May 2014, Anissaras/Heronissou, Crete, Greece

Page 2: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 2

Overview

Motivation

Anatomy of a query verbalization

Main ideas

Example

Evaluation

Conclusions

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Page 3: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 3

Motivation (1/2)

Expert user

Triple store

SPARQL

Input interpretation

SPARQL query

generation Casual user

Keywords

Question (NL/CNL)

Query results

Query results

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Page 4: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 4

Motivation (2/2)

Casual user

What is the second highest

mountain?

Triple store

SELECT ?s WHERE {

?s rdf:type dbo:Mountain .

?s dbo:elevation ?elev .

} ORDER BY DESC(?elev) LIMIT 1

:Mount_Everest

Unless the user does not understand the generated query,

the user cannot trust the results.

SELECT ?s WHERE {

?s rdf:type dbo:Mountain .

?s dbo:elevation ?elev .

} ORDER BY DESC(?elev) LIMIT 1

The mountain that has the highest

elevation value:

What is the second

highest mountain?

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Mount Everest

> Anatomy

Page 5: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 5

Anatomy of a query verbalization (1/4)

subject constraints requests

The country that has the

highest number of

languages

Show also, if available, its

English labels.

.

SELECT ?uri ?string WHERE {

?uri rdf:type onto:Country .

?uri dbo:language ?language .

OPTIONAL {

?uri rdfs:label ?string .

FILTER(lang(?string) = 'en')

}

} ORDER BY DESC (COUNT(?language)) LIMIT 1

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Page 6: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 6

Anatomy of a query verbalization (2/4)

subject constraints requests

Caves that have numbers

of entrances > 3 Show also, if available, these

caves‘ English labels.

.

SELECT ?uri ?string WHERE {

?uri rdf:type dbo:Cave .

?uri dbo:numberOfEntrances ?entrance .

FILTER (?entrance > 3) .

OPTIONAL {

?uri rdfs:label ?string .

FILTER (lang(?string) = 'en')

}

}

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Page 7: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 7

Anatomy of a query verbalization (3/4)

subject constraints requests

Distinct cities

that have population urbans

> 2000000 or that have a

population > 2000000

Show also, if available, these

cities‘ English labels.

.

SELECT DISTINCT ?uri ?string WHERE {

?uri rdf:type onto:City.

{ ?uri prop:population ?population. }

UNION

{ ?uri prop:populationUrban ?population. }

FILTER (xsd:integer(?population) > 2000000) .

OPTIONAL {

?uri rdfs:label ?string .

FILTER(lang(?string)='en')

}

}

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Page 8: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 8

Anatomy of a query verbalization (4/4)

subject constraints

a film that has the English name

"Batman Begins" and that is

starring a thing that has the

English label "Christian Bale"

?

ASK WHERE {

?film rdf:type onto:Film .

?film onto:starring ?actors .

?actors rdfs:label 'Christian Bale'@en .

?film foaf:name 'Batman Begins'@en

}

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Is it true that

there is

> Main Idea

Page 9: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 9

Main idea

Decompose a query into independently verbalizable messages (top-down approach)

Retrieve labels via URI look-up

Verbalize messages using templates

Assemble verbalized messages

Templates are mostly schema-agnostic

Templates depend on linguistic features of properties

Verbalizer is domain-independent

Schema-specific templates can be added

Lemon dictionaries could be used

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

> Example

Page 10: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 10

Example – SPARQL query

01 SELECT ?uri ?string ?p WHERE {

02 ?uri rdf:type :Person .

03 ?uri :birthPlace ?p .

04 ?uri :surname 'Elcar' .

05 { ?uri :givenName 'Dana'@en . } UNION {

06 ?uri :alias ?alias .

07 FILTER(regex(?alias, 'Dana')) .

08 }

09 OPTIONAL {

10 ?uri rdfs:label ?string .

11 FILTER(lang(?string)='en')

12 }

13 }

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

> Graph rep.

Page 11: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 11

Example query – graph representation

?uri

/Dana/ LANG=en

?var ?var

resource

filter

projection var variable

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

UNION

rdf:ty

pe

:Person

?p

‘Elcar‘ rd

fs:label

OPT

?string

‘Dana‘@en

?alias

M3

M6 > Message rep.

Page 12: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 12

Example query – message rep.

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

> Example verb.

Page 13: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 13

Example – Subject verbalization

Control variables

Subject template (excerpt) → Case: abcdef

→ Result: “People“

Due to depedencies:

36 cases instead of

2^6=64 ( )

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

?uri

rdf:ty

pe

:Person

M3

Page 14: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 14

Example – Constraint verbalization (1/2)

Control variables

Classes of properties

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

schema-

independence,

based on POS

Page 15: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 15

Example – Constraint verbalization (2/2)

RV-Constraint template (class 1) (excerpt)

Property class: C1

→ Case: abcdeFghij

→ Result: „ that have a surname “Elcar““

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

?uri

‘Elcar‘

Page 16: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 16

Example – verbalization result

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

?uri

/Dana/ LANG=en

UNION

rdf:ty

pe

:Person

?p

‘Elcar‘ rd

fs:label

OPT

?string

‘Dana‘@en

?alias

M3

M6

Page 17: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 17

Example – verbalization result

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

People

that have a surname "Elcar"

and

that have birth places

and

that have the English given name "Dana"

or

that have aliases that match the expression /Dana/

.

Show also, if available,

these people's English labels

and

these people's birth places

.

M3

M2

M1

M4

M5

M6

?p

> Evaluation

Page 18: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 18

Evaluation (1/2)

Comparative evaluation: Spartiqulation vs.

SPARQL2NL [Ngonga Ngomo et al., 2013]

(bottom-up approach)

6 evaluators, 38 verbalizations

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Page 19: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 19

Evaluation (2/2)

Non-comparative evaluation

6 evaluators, 40 verbalizations

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

> Conclusions

Page 20: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 20

Conclusions

Verbalization of SPARQL queries allow users to

observe discrepancies between intended

questions and generated queries

Domain-independent approach:

Templates are based on linguistic properties of

properties

Evaluation shows

high accuracy,

acceptable syntactical correctness

outperforms SPARQL2NL i.t.o. understandability

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

Page 21: SPARQL Query Verbalization for Explaining Semantic Search Engine Queries

Institute of Applied Informatics and Formal Description

Metthods (AIFB) 21

?question

Basil Ell - SPARQL Query Verbalization for Explaining Semantic Search Engine

Queries

The authors acknowledge the support of the European Commission's Seventh Framework Programme

FP7/2007-2013 (PlanetData, Grant 257641) and

FP7-ICT-2011-7 (XLike, Grant 288342).

#eswc2014Ell