Search code examples
schemavalidationrdfjena

Is there anything that has the function to validate RDF that the same as the xml schema to xml?


Now I come up with some problems about RDF. I have to check a RDF file whether it is valid. Below is an example of my RDF file:

<skos:Concept rdf:about='loc:107'>
<skos:prefLabel>Neptune</skos:prefLabel>
<skos:altLabel>Shoemaker-Levy 9 Comet</skos:altLabel>
<skos:broader rdf:resource='loc:3'/>
<skos:narrower rdf:resource='loc:110'/>
<skos:narrower rdf:resource='loc:111'/>
<skos:narrower rdf:resource='loc:112'/>
<skos:narrower rdf:resource='loc:108'/>
<skos:narrower rdf:resource='loc:115'/>
<skos:narrower rdf:resource='loc:113'/>
<skos:narrower rdf:resource='loc:109'/>
<skos:narrower rdf:resource='loc:114'/>
</skos:Concept>

It is skos actually. I use jena to parse it,and jena can check the errors of RDF properties, such as replacing the rdf:about with rdf:abou ,jena will throw an exception. But if I replace skos:broader with skos:broad ,jena will say ok. What can I do if I want to ensure that all the entities and properties in this RDF file are valid? Or to say,all the skos:broader are spelt correctly, not in wrong spell like skos:broad ,and all skos entities or properties should be embedded in <skos:Concept></skos:Concept>. In a word,is there anything can do the work that xml schema do for RDF?


Solution

  • You can use Jena's Eyeball tool for this.