llama
llama

Reputation: 1661

schema.org Failing to Validate Dublin Core Meta in 'meta' and 'link' elements

I have Dublin Core (DC) meta data in <meta ...> and <link...> elements. Testing my html document with the validator fails to identify the dublin core meta data in my document. But when using DC tags in elemetns like <td rel="dc:date" content="2017-02-10">10 February 2017 </td> the validator identifies those meta data elements.

This validator also fails to identify DC tags in meta and link elements.

Example that does not validate but should:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head profile="http://dublincore.org/specifications/dublin-core/dc-html/2008-08-04/">
    <title>Services to Government</title>
    <link rel="schema.DC" href="http://example.org/terms/" />
    <meta name="DC.date" content="2007-05-05" />
  </head>
  <body>
  </body>
</html>

Is the meta data invalid or are the validators in the wrong? Is there a validator that will support <meta > and <link>?

it seems like the prefix: @prefix dc: http://purl.org/dc/elements/1.1/ . is not appearing the the validator results for some reason.

I have tried adding additional vocabulaires like:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head profile="http://dublincore.org/specifications/dublin-core/dc-html/2008-08-04/">
    <title>Services to Government</title>
    <link rel="schema.DC" href="http://example.org/terms/" />
    <link rel="schema.DC" xmlns:dc="http://purl.org/dc/elements/1.1/"  xmlns:gml="http://www.opengis.net/gml" xmlns:v="http://rdf.data-vocabulary.org/#"/>
    <meta name="DC.date" content="2007-05-05" />
  </head>
  <body>
<td rel="dc:date" content="2017-02-10">10 February 2017</td>
  </body>
</html>

Without success.

To recreate, just paste the example html into one of the validators linked above.

Upvotes: 0

Views: 254

Answers (1)

traynor
traynor

Reputation: 8752

Those examples are written with an obviously unsupported syntax. So the validators are not suppose to detect it, as they support common syntax, such as RDFa, JSON-LD, Microdata etc.

Here's a quote that might be relevant:

The major search engines now extract and index metadata embedded with one of several syntaxes: HTML Microdata, of limited expressivity but the easiest for webmasters to deploy; RDFa, a richer syntax with better support for internationalization and multiple RDF namespaces; and JSON-LD, an RDF-compatible variant of the popular Javascript Object Notation (JSON). These broadly supported syntaxes effectively obsolete a series of IETF and DCMI syntax specifications developed prior to 2008 specifically for expressing Dublin Core™ metadata.

https://www.dublincore.org/resources/metadata-basics/


Parsing those examples would require a parser for that specific syntax (there doesn't seem to be many out there..).

So the solution might be to use some of the common serializations (JSON-LD, Microdata, RDFa)

Upvotes: 0

Related Questions