Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… ·...
Transcript of Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… ·...
![Page 1: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/1.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Embedding RDF Metadata in XHTML
• Embedding RDF Metadata in XHTML
• Homepage Generator:MMM.Persons 2.2 - Math-Net Meta Maker for Persons
• by Gulraj Singh University of Osnabrueck Germany
• Presentation by Martin Cavanagh• University of Waikato New Zealand & University
of Osnabrueck Germany
![Page 2: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/2.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Terminology
• SVG stands for Scalable Vector Graphics• SVG is used to define vector-based graphics for
the web• SVG defines the graphics in XML format• SVG is a World Wide Web Consortium (W3C)
recommendation• SVG can be embedded in XHTML
![Page 3: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/3.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Terminology
• RDF stands for Resource Description Framework• RDF is a framework for describing resources on
the web• RDF provides a model for data, and a syntax so
that independent parties can exchange and use it• RDF is designed to be read and understood by
computers
![Page 4: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/4.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Terminology
• RDF is NOT designed for being displayed to people
• RDF is written in XML• RDF is part of the W3C's Semantic Web Activity• RDF is a World Wide Web Consortium (W3C)
recommendation• RDF can be an element in a SVG object
![Page 5: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/5.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Problem Description
• We want to be able to describe webpages with metadata - namely RDF
• But when we embed RDF directly in XHTML the browser attempts to render the RDF
![Page 6: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/6.jpg)
Göttingen, 2005-02-28 – 2005-03-02
RDF embedded directly in XHTML
<?xml version="1.0" encoding="iso-8859-15"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0
plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Personal Homepage of Martin Cavanagh</title></head><body><p> page with info and RDF describing the page<b> elements of the RDF document MAY be rendered!</b></p><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"></rdf:RDF></body></html>
![Page 7: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/7.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Directly embedding
• Why doesn't it work? The browser (or validator) parses the RDF object as XHTML! Some browers will then render this
• This is a BAD THING:• RDF has many tags that are not a part of XHTML• The metadata was never designed to be displayed
as XHTML• Therefore we need a way to include RDF in
XHTML without letting it be parsed by the browser!
![Page 8: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/8.jpg)
Göttingen, 2005-02-28 – 2005-03-02
A Solution:
• Embedd a SVG object of 0 width and 0 height (so that it won't be seen) in the XHTML page.
• Inside this SVG object include the RDF resource• This works because XHTML allows SVG objects &
SVG may have RDF tags
![Page 9: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/9.jpg)
Göttingen, 2005-02-28 – 2005-03-02
RDF embedded in SVG example<?xml version="1.0" encoding="iso-8859-15"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0
plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Personal Homepage of Martin Cavanagh</title></head><body><p>page with info and RDF describing the page<b>RDF will NOT be rendered</b></p><svg xlink="http://www.w3.org/1999/xlink"
svg="http://www.w3.org/2000/svg"> <switch> <foreignObject><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"></rdf:RDF></foreignObject> </switch> </svg></body></html>
![Page 10: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/10.jpg)
Göttingen, 2005-02-28 – 2005-03-02
RDF embedded in SVG sample solutionMMM v 2.1 tool:http://www.inf-eng.org/cgi-bin/infeng/MMM/MMMPersons/MMMPers2.1.cgi
produces:http://homepages.ihug.co.nz/~cavanatj/MMMPers2.1.cgi.htm
![Page 11: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/11.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Problem with this method:
• RDF describes every object on the page (or can) except the SVG object.
![Page 12: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/12.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Another school of thought:
• Inside the XHTML include a link to the RDF document.
• The RDF document is then in a seperate document
![Page 13: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/13.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Linked RDF example<?xml version="1.0" encoding="iso-8859-15"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML
2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Personal Homepage of Martin
Cavanagh</title></head><body><p> page with info and RDF describing the page</p><p><a href="Martin%20Cavanagh.rdf">Martin Cavanagh.rdf is
here</a></p></body></html>
![Page 14: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/14.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Linked RDF sample solution
MMM ver 2.2http://www.inf-eng.org/cgi-bin/infeng/MMM/MMMPersons/MMMPers2.2.cgi
Produceshttp://homepages.ihug.co.nz/~cavanatj/MMMPers2.2.cgi.htm
![Page 15: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/15.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Problems with Linked RDF
• No longer embedded in XHTML page, which was the goal
• But the RDF now shows up as a link for the user (metadata is for computers not for people - there is no reason for people to visit this page)
• Every link could be a RDF document....the metadata browser would need to parse them all...
![Page 16: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/16.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Conclusion
• Cashmere Int at Osnabrueck University have implemented the 2 prevailing solutions
• RDF cannot be directly written into XHTML (ver 1.1. -and this is likely to remain the case for XHTML 2.0)
• Solutions:• Embedd RDF resource in SVG object and SVG
object in XHTML page• Have a seperate RDF page and a link to this page
from XHTML• Neither solution is perfect - but they both allow
backwards compatibility
![Page 17: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/17.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Embedding RDF Metadata in XHTML
• Embedding RDF Metadata in XHTML
• Homepage Generator:MMM.Persons 2.2 - Math-Net Meta Maker for Persons
• by Gulraj Singh University of Osnabrueck Germany
• Presentation by Martin Cavanagh• University of Waikato New Zealand & University
of Osnabrueck Germany
![Page 18: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/18.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Terminology
• SVG stands for Scalable Vector Graphics• SVG is used to define vector-based graphics for
the web• SVG defines the graphics in XML format• SVG is a World Wide Web Consortium (W3C)
recommendation• SVG can be embedded in XHTML
![Page 19: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/19.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Terminology
• RDF stands for Resource Description Framework• RDF is a framework for describing resources on
the web• RDF provides a model for data, and a syntax so
that independent parties can exchange and use it• RDF is designed to be read and understood by
computers
![Page 20: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/20.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Terminology
• RDF is NOT designed for being displayed to people
• RDF is written in XML• RDF is part of the W3C's Semantic Web Activity• RDF is a World Wide Web Consortium (W3C)
recommendation• RDF can be an element in a SVG object
![Page 21: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/21.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Problem Description
• We want to be able to describe webpages with metadata - namely RDF
• But when we embed RDF directly in XHTML the browser attempts to render the RDF
![Page 22: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/22.jpg)
Göttingen, 2005-02-28 – 2005-03-02
RDF embedded directly in XHTML
<?xml version="1.0" encoding="iso-8859-15"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0
plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Personal Homepage of Martin Cavanagh</title></head><body><p> page with info and RDF describing the page<b> elements of the RDF document MAY be rendered!</b></p><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"></rdf:RDF></body></html>
![Page 23: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/23.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Directly embedding
• Why doesn't it work? The browser (or validator) parses the RDF object as XHTML! Some browers will then render this
• This is a BAD THING:• RDF has many tags that are not a part of XHTML• The metadata was never designed to be displayed
as XHTML• Therefore we need a way to include RDF in
XHTML without letting it be parsed by the browser!
![Page 24: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/24.jpg)
Göttingen, 2005-02-28 – 2005-03-02
A Solution:
• Embedd a SVG object of 0 width and 0 height (so that it won't be seen) in the XHTML page.
• Inside this SVG object include the RDF resource• This works because XHTML allows SVG objects &
SVG may have RDF tags
![Page 25: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/25.jpg)
Göttingen, 2005-02-28 – 2005-03-02
RDF embedded in SVG example<?xml version="1.0" encoding="iso-8859-15"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0
plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Personal Homepage of Martin Cavanagh</title></head><body><p>page with info and RDF describing the page<b>RDF will NOT be rendered</b></p><svg xlink="http://www.w3.org/1999/xlink"
svg="http://www.w3.org/2000/svg"> <switch> <foreignObject><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"></rdf:RDF></foreignObject> </switch> </svg></body></html>
![Page 26: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/26.jpg)
Göttingen, 2005-02-28 – 2005-03-02
RDF embedded in SVG sample solutionMMM v 2.1 tool:http://www.inf-eng.org/cgi-bin/infeng/MMM/MMMPersons/MMMPers2.1.cgi
produces:http://homepages.ihug.co.nz/~cavanatj/MMMPers2.1.cgi.htm
![Page 27: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/27.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Problem with this method:
• RDF describes every object on the page (or can) except the SVG object.
![Page 28: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/28.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Another school of thought:
• Inside the XHTML include a link to the RDF document.
• The RDF document is then in a seperate document
![Page 29: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/29.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Linked RDF example<?xml version="1.0" encoding="iso-8859-15"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML
2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Personal Homepage of Martin
Cavanagh</title></head><body><p> page with info and RDF describing the page</p><p><a href="Martin%20Cavanagh.rdf">Martin Cavanagh.rdf is
here</a></p></body></html>
![Page 30: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/30.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Linked RDF sample solution
MMM ver 2.2http://www.inf-eng.org/cgi-bin/infeng/MMM/MMMPersons/MMMPers2.2.cgi
Produceshttp://homepages.ihug.co.nz/~cavanatj/MMMPers2.2.cgi.htm
![Page 31: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/31.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Problems with Linked RDF
• No longer embedded in XHTML page, which was the goal
• But the RDF now shows up as a link for the user (metadata is for computers not for people - there is no reason for people to visit this page)
• Every link could be a RDF document....the metadata browser would need to parse them all...
![Page 32: Embedding RDF Metadata in XHTML - uni-osnabrueck.de › cashmere › htdocs › html › wo… · Göttingen, 2005-02-28 –2005-03-02 Directly embedding •Why doesn't it work? The](https://reader035.fdocuments.net/reader035/viewer/2022070802/5f02e7c97e708231d40697f0/html5/thumbnails/32.jpg)
Göttingen, 2005-02-28 – 2005-03-02
Conclusion
• Cashmere Int at Osnabrueck University have implemented the 2 prevailing solutions
• RDF cannot be directly written into XHTML (ver 1.1. -and this is likely to remain the case for XHTML 2.0)
• Solutions:• Embedd RDF resource in SVG object and SVG
object in XHTML page• Have a seperate RDF page and a link to this page
from XHTML• Neither solution is perfect - but they both allow
backwards compatibility