Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed...

21
© COPYRIGHT 2014 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. Introduction to SPARQL Pete Aven, Principal Sales Engineer, MarkLogic

Transcript of Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed...

Page 1: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED.

Introduction to SPARQL Pete Aven, Principal Sales Engineer, MarkLogic

Page 2: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2013 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 2

RDF – DISTRIBUTED GRAPH DATA

Page 3: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 3

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

RDF: Distributed Graph Data Dean

Allemang Semantic Web for the Working Ontologist

wrote

Stephen Buxton

John Snelson

knows

likes

Sem Web Meetup

attends

SemTechBiz

speaking at

MarkLogic

works for

knows

speaking at

speaking at

works for

attends

Page 4: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 4

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

RDF: Distributed Graph Data Dean

Allemang

Stephen Buxton

Sem Web Meetup

attends

meetup.com attends

Page 5: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 5

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

RDF: Distributed Graph Data Dean

Allemang

Stephen Buxton

John Snelson

knows

MarkLogic

works for

linkedin.com works for

Page 6: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 6

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

RDF: Distributed Graph Data Dean

Allemang Semantic Web for the Working Ontologist

wrote

workingontologist.com

Page 7: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 7

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

RDF: Distributed Graph Data Dean

Allemang Semantic Web for the Working Ontologist

John Snelson

likes

knows

facebook.com

Page 8: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 8

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

RDF: Distributed Graph Data Dean

Allemang

Stephen Buxton

John Snelson SemTechBiz

speaking at

speaking at

speaking at

semanticweb.com

Page 9: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 9

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

RDF: Distributed Graph Data Dean

Allemang Semantic Web for the Working Ontologist

wrote

Stephen Buxton

John Snelson

knows

likes

Sem Web Meetup

attends

SemTechBiz

speaking at

MarkLogic

works for

knows

workingontologist.com facebook.com

linkedin.com meetup.com

speaking at

speaking at

works for

semanticweb.com

attends

Page 10: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2013 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 10

SPARQL – RDF QUERY LANGUAGE

Page 11: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 11

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Data: John Snelson

SemTechBiz

speaking at

Query:

SPARQL

Queries look like the data

?who SemTechBiz

speaking at

Page 12: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 12

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Query: ?who SemTechBiz

speaking at

select * where { ?who :speaking-at “SemTechBiz” . }

Data: John Snelson

SemTechBiz

speaking at

:jsnelson :speaking-at “SemTechBiz” .

SPARQL

Queries look like the data

Page 13: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 13

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

select * where { ?author :wrote ?book ; :speaking-at “SemTechBiz” . :jsnelson :likes ?book . }

Graph Patterns

Dean Allemang Semantic Web for the

Working Ontologist

wrote

Stephen Buxton

John Snelson

knows likes

Sem Web Meetup

attends

SemTechBiz

speaking at

MarkLogic

works for

knows

speaking at

speaking at

works for

attends

?author ?book wrote

John Snelson

likes

SemTechBiz

speaking at

Which authors speaking at SemTechBiz wrote a book that John Snelson likes?

Page 14: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 14

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Graph Patterns

Dean Allemang Semantic Web for the

Working Ontologist

wrote

Stephen Buxton

John Snelson

knows likes

Sem Web Meetup

attends

SemTechBiz

speaking at

MarkLogic

works for

knows

speaking at

speaking at

works for

attends

select * where { ?author :wrote ?book ; :speaking-at “SemTechBiz” . :jsnelson :likes ?book . }

?author ?book

:dallemang “Semantic Web for the Working Ontologist”

Which authors speaking at SemTechBiz wrote a book

John Snelson likes?

Page 15: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 15

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Graph Patterns

Dean Allemang Semantic Web for the

Working Ontologist

wrote

Stephen Buxton

John Snelson

knows likes

Sem Web Meetup

attends

SemTechBiz

speaking at

MarkLogic

works for

knows

speaking at

speaking at

works for

attends Who works at Snelson’s company and knows the author of a book Snelson

likes? ?author

wrote

?who John Snelson

knows likes ?company

works for works for

?book select * where { ?who :works-for ?company ; :knows ?author . :jsnelson :works-for ?company ; :likes ?book . ?author :wrote ?book . }

Page 16: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 DEAN ALLEMANG, MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 16

This slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Graph Patterns

Dean Allemang Semantic Web for the

Working Ontologist

wrote

Stephen Buxton

John Snelson

knows likes

Sem Web Meetup

attends

SemTechBiz

speaking at

MarkLogic

works for

knows

speaking at

speaking at

works for

attends Who works John Snelson’s company and knows the author of a book Snelson

likes?

?who ?company ?author ?book

:sbuxton :MarkLogic :dallemang

“Semantic Web for

the Working

Ontologist”

select * where { ?who :works-for ?company ; :knows ?author . :jsnelson :works-for ?company ; :likes ?book . ?author :wrote ?book . }

Page 17: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2013 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 17

MARKLOGIC AND SPARQL

Page 18: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 18

TRIPLE

XQY XSLT SQL SPARQL

GRAPH SPARQL

Page 19: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 19

Triples Embedded in Documents

Page 20: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2014 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 21

The Best of Both Worlds

Page 21: Introduction to SPARQLThis slide is derived from a presentation by Dean Allemang, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

© COPYRIGHT 2013 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED. SLIDE: 28

Thank you!