2

I am trying to understand the terms around the semantic web, and have read about RDF. I have seen that RDF files can be based on XML, and XML files should have a corresponding XSD file so you can validate them. But I couldn't find a XSD for an RDF file. Does such a thing exist? If not, how can you define the structure of an RDF in order to validate it later? (I am only interested in the XML form of an RDF not N3 or such.)

Dragos
  • 2,911
  • 12
  • 39
  • 55
  • At the risk of sounding pedantic: don't get hung up on the XML syntax of RDF too much. It's really not the best way to get to grips with RDF. See http://answers.semanticweb.com/questions/11557/what-are-the-most-severe-limitations-of-rdfxml for a discussion of the limitations of RDF/XML. – Jeen Broekstra Nov 14 '11 at 20:40

4 Answers4

4

There is no schema because there are multiple ways to serialize a RDF statement.

for example

<rdf:resource rdf:about="uri:me">
  <dc:title>My Name1</dc:title>
  <dc:title>My Name2</dc:title>
  <rdf:type rdf:resource="&foaf;Person"/>
  <rdf:type rdf:resource="&myontology;Individual"/>
</rdf:resource>

is the same as:

<foaf:Person rdf:about="uri:me">
  <dc:title>My Name1</dc:title>
</foaf:Person>

<foaf:Person rdf:about="uri:me">
  <dc:title>My Name2</dc:title>
</foaf:Person>

<foaf:Person rdf:about="uri:me">
  <rdf:type rdf:resource="&myontology;Individual"/>
</foaf:Person>
Pierre
  • 34,472
  • 31
  • 113
  • 192
  • the serialized XML must follow the spec (...). So you can just validate by uploading it with , e.g., the Jena API. – Pierre Nov 14 '11 at 19:09
  • You are writing about some spec, but precisely that's my problem: I couldn't find any spec, beside a few examples. – Dragos Nov 17 '11 at 13:04
1

I've found this official tool, available as a service. Should fit your needs.

CapelliC
  • 59,646
  • 5
  • 47
  • 90
  • I have used that tool, and found it a bit unuseful... see http://stackoverflow.com/questions/8120638/rdf-reading-parsing-errors – Dragos Nov 14 '11 at 14:27
0

Sorry for posting on such an old thread.

You can find another validator (not official) here

user9869932
  • 6,571
  • 3
  • 55
  • 49
-2

There is something called RDF/Schema (RDFS) designed for this.

Mike Sokolov
  • 6,914
  • 2
  • 23
  • 31
  • 2
    I do not think that RDFS is the RDF equivalent of XSD... From what I have read, RDFS defines some restrictions in using RDF information, it doesn't define its structure. – Dragos Nov 14 '11 at 13:01
  • 1
    That's correct, RDF Schema is a bit of a misnomer, it's not an actual schema, more a "vocabulary description" language. – Jeen Broekstra Nov 15 '11 at 00:04