1

I am getting an error while creating RDF/XML:

The markup in the document preceding the root element must be well-formed

Can somebody please help me with this error?

<?xml version="1.0" encoding ="UTF-8"?>
<"rdf:RDF">
"xmlns:g=“http://schema.org/gen”
"xmlns:u=“http://schema.org/univ”>
<rdf:Description about="http://thisisjohnsmith.org">
    <dc:Title> Personal Webpage </dc:Title>
           <dc:Creator> John Smith </dc:Creator>
</rdf:Description>
<rdf:Person rdf:ID=“john”>
    <g:name>John Smith</g:name> 
    <g:age>40</g:age>
</rdf:Person> 
<rdf:Person rdf:ID=“peter”>
    <g:name>Peter</g:name>
</rdf:Person> 
 <rdf:Lecturer rdf:ID=“john”>
    <g:name>John Smith</g:name> 
</rdf:Lecturer> 
<rdf:Lecture rdf:ID=“john”>
    <g:name>John Smith</g:name> 
    <g:status>crowded</g:status> 
    <g:student>
    <g:name> Peter</g:name>
   </g:student>
</rdf:Lecture> 
</rdf:RDF>
unor
  • 92,415
  • 26
  • 211
  • 360
bengalurean
  • 69
  • 1
  • 3
  • 10
  • 1
    There are lots of problems here; lots of quotation marks where they don't belong. "Smart" quotes instead of "dumb" quotes. Etc. If you're writing RDF by hand, **don't** use RDF/XML. A serialization like Turtle/N3 is much easier. – Joshua Taylor Jun 08 '16 at 22:19

1 Answers1

0

There are many syntax errors preventing your XML from being well-formed.

Here's a cleaned-up copy of your document that's now well-formed:

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:g="http://schema.org/gen">
  <rdf:Description rdf:about="http://thisisjohnsmith.org">
    <dc:Title> Personal Webpage </dc:Title>
    <dc:Creator> John Smith </dc:Creator>
  </rdf:Description>
  <rdf:Person rdf:ID="john">
    <g:name>John Smith</g:name> 
    <g:age>40</g:age>
  </rdf:Person> 
  <rdf:Person rdf:ID="peter">
    <g:name>Peter</g:name>
  </rdf:Person> 
  <rdf:Lecturer rdf:ID="john">
    <g:name>John Smith</g:name> 
  </rdf:Lecturer> 
  <rdf:Lecture rdf:ID="john">
    <g:name>John Smith</g:name> 
    <g:status>crowded</g:status> 
    <g:student>
      <g:name> Peter</g:name>
    </g:student>
  </rdf:Lecture>
</rdf:RDF>
kjhughes
  • 106,133
  • 27
  • 181
  • 240