Towards Extending and using SPARQL for Modular Document Generation - - PowerPoint PPT Presentation

towards extending and using sparql for modular document
SMART_READER_LITE
LIVE PREVIEW

Towards Extending and using SPARQL for Modular Document Generation - - PowerPoint PPT Presentation

Towards Extending and using SPARQL for Modular Document Generation Faisal Alkhateeb and S ebastien Laborie DocEng08 1 Faisal Alkhateeb and S ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation


slide-1
SLIDE 1

Towards Extending and using SPARQL for Modular Document Generation

Faisal Alkhateeb and S´ ebastien Laborie DocEng’08

1 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-2
SLIDE 2

Introduction

The context

World Wide Web

2 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-3
SLIDE 3

Introduction

The context

World Wide Web

2 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-4
SLIDE 4

Introduction

The context

World Wide Web Document generation Template

2 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-5
SLIDE 5

Introduction

The problem

The gap between XML and RDF technologies Document generation Template XSLT XPath SPARQL

3 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-6
SLIDE 6

Our contribution

Our contribution

Bridge the gap between XML and RDF technologies Document generation Template SPARQL

4 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-7
SLIDE 7

Our contribution

Our contribution

Contribution: A SPARQL extension which supports the generation of XML documents based on templates Definition of a template language based on our SPARQL extension Advantages: Templates modularity Templates reusability Templates readability

4 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-8
SLIDE 8

Our contribution

Outline

1

The SPARQL language

2

A SPARQL extension for document generation

3

Embed queries into templates

4

Conclusion

5 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-9
SLIDE 9

The SPARQL language

Outline

1

The SPARQL language

2

A SPARQL extension for document generation

3

Embed queries into templates

4

Conclusion

6 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-10
SLIDE 10

The SPARQL language

The SPARQL Language

Query: Look for flights from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

7 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-11
SLIDE 11

The SPARQL language

The SPARQL Language

Query: Look for flights from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query SELECT * FROM RDF Graph WHERE { ?Flight rdf:type ex:Flight . ?Flight ex:from ex:Paris . ?Flight ex:to ?CityArrival . ?Flight ex:price ?Price . }

7 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-12
SLIDE 12

The SPARQL language

The SPARQL Language

Query: Look for flights from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query

ex:Paris ?Flight ?CityArrival ex:Flight ?Price ex:from ex:to ex:price rdf:type

7 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-13
SLIDE 13

The SPARQL language

The SPARQL Language

Query: Look for flights from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query

ex:Paris ?Flight ?CityArrival ex:Flight ?Price ex:from ex:to ex:price rdf:type Solutions ?Flight ?CityArrival ?Price 1 ex : Iberia123 ex : Amsterdam “325”

7 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-14
SLIDE 14

The SPARQL language

The SPARQL Language

Query: Look for flights from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query

ex:Paris ?Flight ?CityArrival ex:Flight ?Price ex:from ex:to ex:price rdf:type Solutions ?Flight ?CityArrival ?Price 1 ex : Iberia123 ex : Amsterdam “325” 2 ex : Alitalia712 ex : Roma “400”

7 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-15
SLIDE 15

The SPARQL language

The SPARQL Language with RDFS

Query: Look for trips from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query SELECT * FROM RDF Graph WHERE { ?Trip rdf:type ex:Trip . ?Trip ex:from ex:Paris . ?Trip ex:to ?CityArrival . ?Trip ex:price ?Price . }

8 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-16
SLIDE 16

The SPARQL language

The SPARQL Language with RDFS

Query: Look for trips from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query SELECT * FROM RDF Graph WHERE { ?Trip rdf:type ex:Trip . ?Trip ex:from ex:Paris . ?Trip ex:to ?CityArrival . ?Trip ex:price ?Price . }

8 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-17
SLIDE 17

The SPARQL language

The SPARQL Language with RDFS

Query: Look for trips from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query SELECT * FROM RDF Graph WHERE { ?Trip rdf:type ex:Trip . ?Trip ex:from ex:Paris . ?Trip ex:to ?CityArrival . ?Trip ex:price ?Price . }

Solutions ?Trip ?CityArrival ?Price 1 ex : Iberia123 ex : Amsterdam “325” 2 ex : Alitalia712 ex : Roma “400”

8 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-18
SLIDE 18

The SPARQL language

The SPARQL Language with a CONSTRUCT clause

Query: Look for trips from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query CONSTRUCT

{ex:Paris ex:reachable ?CityArrival .}

FROM RDF Graph WHERE { ?Trip rdf:type ex:Trip . ?Trip ex:from ex:Paris . ?Trip ex:to ?CityArrival . ?Trip ex:price ?Price . }

9 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-19
SLIDE 19

The SPARQL language

The SPARQL Language with a CONSTRUCT clause

Query: Look for trips from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query CONSTRUCT

{ex:Paris ex:reachable ?CityArrival .}

FROM RDF Graph WHERE { ?Trip rdf:type ex:Trip . ?Trip ex:from ex:Paris . ?Trip ex:to ?CityArrival . ?Trip ex:price ?Price . } Query answer

ex:Paris ex:Paris ex:Roma ex:Amsterdam ex:reachable ex:reachable

9 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-20
SLIDE 20

The SPARQL language

The SPARQL Language with a CONSTRUCT clause

Query: Look for trips from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query CONSTRUCT

{ex:Paris ex:reachable ?CityArrival .}

FROM RDF Graph WHERE { ?Trip rdf:type ex:Trip . ?Trip ex:from ex:Paris . ?Trip ex:to ?CityArrival . ?Trip ex:price ?Price . } Query answer

ex:Paris ex:Roma ex:Amsterdam ex:reachable ex:reachable

9 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-21
SLIDE 21

The SPARQL language

The SPARQL Language with a CONSTRUCT clause

Query: Look for trips from Paris which cost a certain price RDF Graph

ex:Paris ex:Iberia123 ex:Alitalia712 ex:Roma ex:Amsterdam ex:Flight ex:Trip “Paris” “Paris.jpg” “325” “400” “Amsterdam” “Roma” ex:name foaf:depiction ex:from ex:to ex:from ex:to ex:price ex:price rdf:type rdf:type ex:name ex:name rdfs:subClassOf

SPARQL Query CONSTRUCT

{ex:Paris ex:reachable ?CityArrival .}

FROM RDF Graph WHERE { ?Trip rdf:type ex:Trip . ?Trip ex:from ex:Paris . ?Trip ex:to ?CityArrival . ?Trip ex:price ?Price . } Limitation: SPARQL generates only RDF Graphs

9 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-22
SLIDE 22

A SPARQL extension for document generation

Outline

1

The SPARQL language

2

A SPARQL extension for document generation

3

Embed queries into templates

4

Conclusion

10 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-23
SLIDE 23

A SPARQL extension for document generation

Our SPARQL Extension

We propose an extension to SPARQL that: can be used to generate XML documents; preserves the compatibility with SPARQL syntax. Extension of the CONSTRUCT clause CONSTRUCT Example.xml FROM RDF Graph WHERE { ?CityArrival foaf:depiction ?PhotoCityArrival . . . . }

11 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-24
SLIDE 24

A SPARQL extension for document generation

Our SPARQL Extension

We propose an extension to SPARQL that: can be used to generate XML documents; preserves the compatibility with SPARQL syntax. Extension of the CONSTRUCT clause CONSTRUCT Example.xml FROM RDF Graph WHERE { ?CityArrival foaf:depiction ?PhotoCityArrival . . . . } The XML document is a template (Example.xml)

<table> <tr> <td><img src="?PhotoCityArrival" .../></td> ... </tr> </table>

11 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-25
SLIDE 25

A SPARQL extension for document generation

Our SPARQL Extension

We propose an extension to SPARQL that: can be used to generate XML documents; preserves the compatibility with SPARQL syntax. Extension of the CONSTRUCT clause CONSTRUCT Example.xml FROM RDF Graph WHERE { ?CityArrival foaf:depiction ?PhotoCityArrival . . . . } The XML document is a template (Example.xml)

<table> <tr> <td><img src="?PhotoCityArrival" .../></td> ... </tr> </table>

After the query evaluation, n documents are computed according to the n solutions

11 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-26
SLIDE 26

A SPARQL extension for document generation

Our SPARQL Extension

We propose an extension to SPARQL that: can be used to generate XML documents; preserves the compatibility with SPARQL syntax. Query Answers ?PhotoCityArrival http://ex.fr/Eiffel.jpg http://ex.fr/BigBen.jpg The XML document is a template (Example.xml)

<table> <tr> <td><img src="?PhotoCityArrival" .../></td> ... </tr> </table>

After the query evaluation, n documents are computed according to the n solutions

11 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-27
SLIDE 27

A SPARQL extension for document generation

Our SPARQL Extension

We propose an extension to SPARQL that: can be used to generate XML documents; preserves the compatibility with SPARQL syntax. Query Answers ?PhotoCityArrival http://ex.fr/Eiffel.jpg http://ex.fr/BigBen.jpg Document instantiations Document 1

<table> <tr> <td><img src="http://ex.fr/Eiffel.jpg" .../> </td> ... </tr> </table>

Document 2

<table> <tr> <td><img src="http://ex.fr/BigBen.jpg".../> </td> ... </tr> </table>

11 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-28
SLIDE 28

A SPARQL extension for document generation

Document adaptation

CONSTRUCT <MobileTemplate.html> FROM <RDFGraph> FROM <CC/PPprofile> WHERE { ?Image exif:resolution ?Res . ?Image rdf:type exif:IFD . ?Image mms:MmsMaxImageResolution ?MaxRes . FILTER ( ?Res <= ?MaxRes ) . }

12 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-29
SLIDE 29

A SPARQL extension for document generation

Document adaptation

CONSTRUCT <MobileTemplate.html> FROM <RDFGraph> FROM <CC/PPprofile> WHERE { ?Image exif:resolution ?Res . ?Image rdf:type exif:IFD . ?Image mms:MmsMaxImageResolution ?MaxRes . FILTER ( ?Res <= ?MaxRes ) . }

12 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-30
SLIDE 30

A SPARQL extension for document generation

Document adaptation

CONSTRUCT <MobileTemplate.html> FROM <RDFGraph> FROM <CC/PPprofile> WHERE { ?Image exif:resolution ?Res . ?Image rdf:type exif:IFD . ?Image mms:MmsMaxImageResolution ?MaxRes . FILTER ( ?Res <= ?MaxRes ) . }

12 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-31
SLIDE 31

A SPARQL extension for document generation

Limitations

The SPARQL query and the template are edited independently.

⇒ The query and its variables must fit the template.

Several queries may be specified for a given template.

⇒ Each of them may be applied to particular fragments of the template.

One may want to compose several templates (Modular templates).

⇒ Reuse existing templates.

13 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-32
SLIDE 32

Embed queries into templates

Outline

1

The SPARQL language

2

A SPARQL extension for document generation

3

Embed queries into templates

4

Conclusion

14 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-33
SLIDE 33

Embed queries into templates

Modular template

Definition (Modular template) A modular template is a document where some of the data is given explicitly while

  • ther parts are described modularly or recursively, and externally constructed by

means of embedded calls to query evaluators. Example imported template

15 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-34
SLIDE 34

Embed queries into templates

Syntax of a modular template

Syntax of a modular template <sparqlmm:div>: this tag encapsulates a query environment containing the specific tags such as <sparqlmm:construct> and <sparqlmm:query>. This tag may also embed

  • ther XML tags and/or even other query environments.

<sparqlmm:construct>: this tag is composed of an XML fragment to be constructed from the answers

  • f the query by substituting its variables.

<sparqlmm:query>: we include in this tag a SPARQL query.

16 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-35
SLIDE 35

Embed queries into templates

Metadata generation

<smil> <sparqlmm:div> <head> <metadata id="meta-rdf"> <sparqlmm:query> <!-- construct <metadata.rdf> from <RDFGraph> where { ?Media rdf:type ex:Video . ?Media ex:author ?Author . ?Media ex:source ?Source . ?Media dc:title ?Title . ?Author foaf:name ?Name .}--> </sparqlmm:query> </metadata> ... </head> <body> <sparqlmm:construct> <video src="?Source" dur="30s"/> </sparqlmm:construct> ... </body> </sparqlmm:div> </smil>

17 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-36
SLIDE 36

Embed queries into templates

Metadata generation

<smil> <sparqlmm:div> <head> <metadata id="meta-rdf"> <sparqlmm:query> <!-- construct <metadata.rdf> from <RDFGraph> where { ?Media rdf:type ex:Video . ?Media ex:author ?Author . ?Media ex:source ?Source . ?Media dc:title ?Title . ?Author foaf:name ?Name .}--> </sparqlmm:query> </metadata> ... </head> <body> <sparqlmm:construct> <video src="?Source" dur="30s"/> </sparqlmm:construct> ... </body> </sparqlmm:div> </smil>

17 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-37
SLIDE 37

Embed queries into templates

Metadata generation

<smil> <sparqlmm:div> <head> <metadata id="meta-rdf"> <sparqlmm:query> <!-- construct <metadata.rdf> from <RDFGraph> where { ?Media rdf:type ex:Video . ?Media ex:author ?Author . ?Media ex:source ?Source . ?Media dc:title ?Title . ?Author foaf:name ?Name .}--> </sparqlmm:query> </metadata> ... </head> <body> <sparqlmm:construct> <video src="?Source" dur="30s"/> </sparqlmm:construct> ... </body> </sparqlmm:div> </smil>

17 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-38
SLIDE 38

Embed queries into templates

Metadata generation

<smil> <sparqlmm:div> <head> <metadata id="meta-rdf"> <sparqlmm:query> <!-- construct <metadata.rdf> from <RDFGraph> where { ?Media rdf:type ex:Video . ?Media ex:author ?Author . ?Media ex:source ?Source . ?Media dc:title ?Title . ?Author foaf:name ?Name .}--> </sparqlmm:query> </metadata> ... </head> <body> <sparqlmm:construct> <video src="?Source" dur="30s"/> </sparqlmm:construct> ... </body> </sparqlmm:div> </smil>

17 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-39
SLIDE 39

Embed queries into templates

Metadata generation

<smil> <sparqlmm:div> <head> <metadata id="meta-rdf"> <sparqlmm:query> <!-- construct <metadata.rdf> from <RDFGraph> where { ?Media rdf:type ex:Video . ?Media ex:author ?Author . ?Media ex:source ?Source . ?Media dc:title ?Title . ?Author foaf:name ?Name .}--> </sparqlmm:query> </metadata> ... </head> <body> <sparqlmm:construct> <video src="?Source" dur="30s"/> </sparqlmm:construct> ... </body> </sparqlmm:div> </smil>

metadata.rdf

<rdf:Description rdf:about="?Media"> <dc:creator> <rdf:Description> <foaf:name> <sparqlmm:var name="?Name"/> </foaf:name> </rdf:Description> </dc:creator> <dc:title> <sparqlmm:var name="?Title"/> </dc:title> <ex:source> <sparqlmm:var name="?Source"/> </ex:source> </rdf:Description>

17 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-40
SLIDE 40

Embed queries into templates

Metadata generation

<smil> <sparqlmm:div> <head> <metadata id="meta-rdf"> <sparqlmm:query> <!-- construct <metadata.rdf> from <RDFGraph> where { ?Media rdf:type ex:Video . ?Media ex:author ?Author . ?Media ex:source ?Source . ?Media dc:title ?Title . ?Author foaf:name ?Name .}--> </sparqlmm:query> </metadata> ... </head> <body> <sparqlmm:construct> <video src="?Source" dur="30s"/> </sparqlmm:construct> ... </body> </sparqlmm:div> </smil>

metadata.rdf

<rdf:Description rdf:about="?Media"> <dc:creator> <rdf:Description> <foaf:name> <sparqlmm:var name="?Name"/> </foaf:name> </rdf:Description> </dc:creator> <dc:title> <sparqlmm:var name="?Title"/> </dc:title> <ex:source> <sparqlmm:var name="?Source"/> </ex:source> </rdf:Description>

Template reusability Template readability Template modularity

17 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-41
SLIDE 41

Embed queries into templates

Metadata generation

<smil> <sparqlmm:div> <head> <metadata id="meta-rdf"> <sparqlmm:query> <!-- construct <metadata.rdf> from <RDFGraph> where { ?Media rdf:type ex:Video . ?Media ex:author ?Author . ?Media ex:source ?Source . ?Media dc:title ?Title . ?Author foaf:name ?Name .}--> </sparqlmm:query> </metadata> ... </head> <body> <sparqlmm:construct> <video src="Seb.avi" dur="30s"/> </sparqlmm:construct> ... </body> </sparqlmm:div> </smil>

metadata.rdf

<rdf:Description rdf:about="vid1"> <dc:creator> <rdf:Description> <foaf:name> Seb </foaf:name> </rdf:Description> </dc:creator> <dc:title> My video </dc:title> <ex:source> Seb.avi </ex:source> </rdf:Description>

17 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-42
SLIDE 42

Embed queries into templates

Control template importation

Fragment selection.

<sparqlmm:query xpath="..."> ...

Transforming template importation.

<sparqlmm:query xslt="..."> ...

Condition on template importation.

<sparqlmm:query condition="..."> ...

Template importation for some query answers.

<sparqlmm:query offset="..." limit="..."> ...

18 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-43
SLIDE 43

Conclusion

Outline

1

The SPARQL language

2

A SPARQL extension for document generation

3

Embed queries into templates

4

Conclusion

19 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-44
SLIDE 44

Conclusion

Conclusion

Bridge the gap between XML and RDF applications

A SPARQL extension which supports the generation of XML documents based on templates

provides a formal and modular means to query RDF graphs returns the results in XML avoids developing ad hoc transformations from RDF to XML

A modular approach that allows templates:

reusability readability

Motivated examples based on:

document adaptation metadata generation

Implementation on http://sparqlmm.gforge.inria.fr and other concrete examples

20 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-45
SLIDE 45

Conclusion

Future Work

Controlling the number of generated documents by permitting the user to interact with the system. Mix our SPARQL templates with other template languages (e.g., XTiger). Implement a web service.

21 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation

slide-46
SLIDE 46

Questions

Questions ? Thank you for your attention ! sebastien.laborie@inrialpes.fr http://exmo.inrialpes.fr

22 Faisal Alkhateeb and S´ ebastien Laborie Towards Extending and using SPARQL for Modular Document Generation