W3C home > Mailing lists > Public > semantic-web@w3.org > May 2019

Are many (X)HTML documents also RDF/XML documents?

From: Wouter Beek <wouter@triply.cc>
Date: Mon, 6 May 2019 21:55:51 +0200
Message-ID: <CAEh2WcMSVOri0K1+Fmxn5hg=hgETpE=MnzLb=xG7B82N=ivXcg@mail.gmail.com>
To: SW-forum Web <semantic-web@w3.org>
Dear SW community,

The RDF/XML 1.1 specification contains the following two phrases:

    When there is only one top-level node element inside rdf:RDF, the
rdf:RDFcan be omitted although any XML namespaces must still be
declared.

    The XML specification also permits an XML declaration at the top
of the document with the XML version and possibly the XML content
encoding. This is optional but recommended.

Does this mean that many/all (X)HTML documents are also RDF/XML
documents?  If so, there is much more RDF out there than I had
previously thought.  In fact, RDF would be at least as popular as HTML
(contrary to common complaints from the SW community about RDF's
popularity).

Specifically, does the above mean that the following document should
be parsed by a standards-compliant RDF/XML parser:

```xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>
  </title>
</head>
<body>
  <table>
    <tr>
      <td>some col 1</td>
    </tr>
  </table>
</body>
</html>
```

, resulting in the following RDF triples (serialized in N-Triples):

```
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/1999/xhtmlhtml> .
_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/1999/xhtmltitle> .
_:genid1 <http://www.w3.org/1999/xhtmlhead> _:genid2 .
_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/1999/xhtmltable> .
_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/1999/xhtmltd> .
_:genid3 <http://www.w3.org/1999/xhtmltr> _:genid4 .
_:genid1 <http://www.w3.org/1999/xhtmlbody> _:genid3 .
```

---
Best regards,
Wouter Beek.

Email: wouter@triply.cc
WWW: https://triply.cc
Tel: +31647674624
Received on Monday, 6 May 2019 19:56:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:51:27 UTC