2

I'm trying to put Schema.org on a website. First I made JSON-LD but the website is not allowing any script in the head element. Then I converted it into RDF/XML format below.

Now, where on the website should I put this for Google to read it. Should I put in the head element?

<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:schema="http://schema.org/">

  <schema:Organization rdf:nodeID="genid1">
    <schema:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">National Public Radio</schema:name>
    <schema:sponsor>
      <schema:Organization>
        <schema:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">GloboCorp</schema:name>
        <schema:url rdf:resource="http://www.example.com/"/>
      </schema:Organization>
    </schema:sponsor>

    <schema:url rdf:resource="http://npr.org"/>
  </schema:Organization>

</rdf:RDF>
unor
  • 92,415
  • 26
  • 211
  • 360
susan
  • 21
  • 1

1 Answers1

0

If you want to include it in the HTML document, you would have to use a script element (just like with JSON-LD). This script element doesn’t have to be part of the head, you can place it in the body. An alternative is to provide the RDF/XML in its own file and link it from the head, or offer it via content negotiation.

That said, Google Search doesn’t support RDF/XML. For their search result features, which make use of Schema.org, they only support these syntaxes:

  • JSON-LD (in script)
  • Microdata
  • RDFa
Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360