EmbeddingRDFinHTML
In the beginning, there was the HTML meta element. Then came PICS, which could be carried inside meta elements. Then came RDF, in some ways a generalization of PICS, written in XML, and XHTML, also written in XML. Whence comes the question...
How do I put RDF in my HTML document?
With the growing number of GrddlImplementations...
- use a profile of HTML designed for the RDF schema you're interested in
- check out Joe Lambda's homepage and proceed in the best "view source" tradition.
- see the online service started by Dom Nov 2003
- check the proposed spec
- earlier design sketch: relational data views of XHTML via XSLT Dan Connolly (Thursday, 29 May)
- more notes
- join the public-rdf-in-xhtml-tf mailing list discussion, started May 21 2003
- Use a data: URL (http://www.ietf.org/rfc/rfc2397.txt) and add the URL-encoded RDF as the href attribute of a <link> in your <head>.
in particular...
How do I put bibliographic metadata ala DublinCore in my HTML document?
- Use the dialect from Encoding Dublin Core Metadata in HTML, December 1999 by J. Kunze, the profile above, and the formal interpreter in XSLT
- see also: DC extraction service
- hmm... photo metadata... see ImageDescription
How do I put rights metadata in my HTML document ala CreativeCommons?
- Use markup like in Joe Lambda's homepage and link to the grokCC interpreter.
How can I use my HTML document to make FOAF metadata?
- Use markup like in Joe Lambda's homepage and link to the grokFOAF interpreter.
How can I make an RSS feed from my HTML page?
- try the RDF Site Summary profile, and use the home2rss interpreter
- hmm... see also How should HTML content be represented? in an RSS wiki
- hmm... what about trackback?
How do I connect my web page to a geographic lat/long location?
- Use markup like in Joe Lambda's homepage and link to the grokGeoURL interpreter.
- see also: discussion of geourl, HTML meta, and RDF
how about travel schedules?
How do I make a namespace document that works with HTML browsers but formally relates various resources?
- try the RDDL dialect of HTML (Sep 2003 version) with the grokRDDL interpreter
- but stay tuned to namespaceDocument in the TAG issue list
- see also: RDDL home
- earlier work on schemas in HTML: HyperRDF
Some older ideas and the corresponding drawbacks:
- appendix B of the 1999 RDF spec suggests sticking RDF in the head of an HTML document (more in Part I of RDF in HTML: Approaches)
- but the result doesn't conform to the XHTML specs, so
- build a modular DTD (details in Part II of RDF in HTML: Approaches)
- but you have to tweak the DTD every time you use a new RDF property
- build a modular DTD (details in Part II of RDF in HTML: Approaches)
- but the result doesn't conform to the XHTML specs, so
- wrap the RDF in a
<div style="display:none">
.- looks silly in a browser that can't handle CSS
- see DTD problems above
- The initial CreativeCommons deployment involves putting RDF inside comments inside HTML.
- PPR:HotComments?!?! Blech!
- make a separate RDF file and link to it
- but
- It is often easier to add an HTML document than another kind of document (for example in a Wiki...)
- HTML documents get crawled already, and are better connected than RDF documents
- We want something readable at the end of a URI without figuring out content negotiation, etc.
- but
references, newest first:
- public-rdf-in-xhtml-tf started May 21 2003
- RDF in XHTML tasks approaches from Joseph Reagle
- paper on revising of RDF/XML by Dave Beckett including known problems, requirements for new syntaxes, analysis of existing work.
- XHTML Metainformation Module in XHTML2 WD draft.
- RDF and HTML session in the March 2003 Semantic Web Architecture meeting in Cambridge
- RDF/XML with HTML and XHTML in the RDF Syntax WD (January 2003)
- TagIssue:RDFinXHTML-35
- RDF in HTML: Approaches, May 2002 by Sean B.
- A strawman Unstriped syntax for RDF in XML esp section "RDF in HTML - Transparent or not?", Jun 1999 by TimBL
- appendix B to 1999 RDF spec
- Shoe from Heflin, Hendler and company (LinkMe). Their approach has been to stick formulas inside HTML all along.
, ProxyTopic of public-rdf-in-xhtml-tf
Comments:
In the HTML 4.01 specs, it is said "The ADDRESS element may be used by authors to supply contact information for a document or a major part of a document such as a form. This element often appears at the beginning or end of a document." But you are putting licence information (CC example) which is not contact information. -- KarlDubost.
- I guess I owe a comment on the HTML 4.01 spec then; I think the ADDRESS element is where you sign the page; i.e. you show who's responsible for the page. And copyright info is often part of a page's signature. -- DanConnolly
This document is very interesting because it has a lot of links but it's also very hard to read, because you have to go back and forward with the Joe User home page. --KarlDubost
The spec suggests that the rel attribute of the link tag be "transformation" and that's what Joe Lambda's page uses, yet View > Source of the page http://www.w3.org/2003/g/data-view shows it using rel="xslt2rdf". Are both OK? -- SPage
- "xslt2rdf" was the name used in an old version of the spec; while it's still supported in one of the implementations, "transformation" is the one that must be used; I've updated data-view to use the latter. --DomHazael
If you use a data: URL in a <link>, it's pretty easy, and compatible with many many versions of HTML and HTML-processing agents:
<link rel="meta" type="application/rdf+xml" href="data:application/rdf+xml,%3Crdf%3ARDF%20xmlns%3D%22http%3A%2F%2Fweb.resource.org%2Fcc%2F%22%0D%0A%20%20%20%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%0D%0A%20%20%20%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%3E%0D%0A%3CWork%20rdf%3Aabout%3D%22http%3A%2F%2Fexample.org%2Fgnomophone.mp3%22%3E%0D%0A%20%20%3Cdc%3Atitle%3ECompilers%20in%20the%20Key%20of%20C%3C%2Fdc%3Atitle%3E%0D%0A%20%20%3Cdc%3Adescription%3EA%20lovely%20classical%20work%20on%20compiling%20code.%3C%2Fdc%3Adescription%3E%0D%0A%20%20%3Cdc%3Acreator%3E%3CAgent%3E%0D%0A%20%20%20%20%3Cdc%3Atitle%3EYo-Yo%20Dyne%3C%2Fdc%3Atitle%3E%0D%0A%20%20%3C%2FAgent%3E%3C%2Fdc%3Acreator%3E%0D%0A%20%20%3Cdc%3Arights%3E%3CAgent%3E%0D%0A%20%20%20%20%3Cdc%3Atitle%3EGnomophone%3C%2Fdc%3Atitle%3E%0D%0A%20%20%3C%2FAgent%3E%3C%2Fdc%3Arights%3E%0D%0A%20%20%3Cdc%3Adate%3E1842%3C%2Fdc%3Adate%3E%0D%0A%20%20%3Cdc%3Aformat%3Eaudio%2Fmpeg%3C%2Fdc%3Aformat%3E%0D%0A%20%20%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FSound%22%20%2F%3E%0D%0A%20%20%3Cdc%3Asource%20rdf%3Aresource%3D%22http%3A%2F%2Fexample.net%2Fgnomovision.mov%22%20%2F%3E%0D%0A%20%20%3Clicense%20rdf%3Aresource%3D%22http%3A%2F%2Fcreativecommons.org%2Flicenses%2Fby-nc-nd%2F2.0%2F%22%20%2F%3E%0D%0A%20%20%3Clicense%20rdf%3Aresource%3D%22http%3A%2F%2Fwww.eff.org%2FIP%2FOpen_licenses%2Feff_oal.html%22%20%2F%3E%0D%0A%0D%0A%3C%2FWork%3E%0D%0A%0D%0A%3CLicense%20rdf%3Aabout%3D%22http%3A%2F%2Fcreativecommons.org%2Flicenses%2Fby-nc-nd%2F2.0%2F%22%3E%0D%0A%20%20%3Cpermits%20rdf%3Aresource%3D%22http%3A%2F%2Fweb.resource.org%2Fcc%2FReproduction%22%20%2F%3E%0D%0A%20%20%3Cpermits%20rdf%3Aresource%3D%22http%3A%2F%2Fweb.resource.org%2Fcc%2FDistribution%22%20%2F%3E%0D%0A%20%20%3Crequires%20rdf%3Aresource%3D%22http%3A%2F%2Fweb.resource.org%2Fcc%2FNotice%22%20%2F%3E%0D%0A%20%20%3Crequires%20rdf%3Aresource%3D%22http%3A%2F%2Fweb.resource.org%2Fcc%2FAttribution%22%20%2F%3E%0D%0A%20%20%3Cprohibits%20rdf%3Aresource%3D%22http%3A%2F%2Fweb.resource.org%2Fcc%2FCommercialUse%22%20%2F%3E%0D%0A%0D%0A%3C%2FLicense%3E%0D%0A%3C%2Frdf%3ARDF%3E" />
It's just so deliciously wrong. --EvanProdromou