English 中文(简体)
RDF reading/parsing errors
原标题:

I have some RDF files which I want to import into a tripplestore(AllegroGraph), but at the first file I get a SAX parser error, stating there is an unrecognized character. After removing the line in question, everything is great. Then I have tried using the W3C RDF validator and Jena on the RDF with the error-line, but all I got was some warnings regarding undefined languages(absolutely nothing about the error-line). Could you please suggest a method(java if possible) to finding errors in RDF files?

Edit: The line in question is:

<gn:alternateName xml:lang="got">&#66352;&#66374;&#66354;&#66352;&#66365;&#66361;&#66371;&#66372;&#66352;&#66365;</gn:alternateName>
问题回答

You can use Sesame s Rio parser to do validation. There s instructions in this blogpost on how to work with Rio in general. For validation specifically, the trick is to create and attach a ParseErrorListener that receives detailed warning and errors from the parser.

However, since you mention that the problem you encounter is at the level of SAX / XML, you could also just use a generic XML validator to see what s wrong. The most likely cause (but it s hard to tell without more details) is that you have an incorrectly encoded character in there somewhere.





相关问题
Defining cardinality for a RDF statement

Im having a problem with RDF. I have a couple of triples defined as : <User rdf:about="#T"> <hasName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">T</hasName> <...

Duplicate triple in RDF, authoritative view?

if a triple store contains twice the same triple, what is (if any exist) the authoritative position about this redundancy ? Additionally, should a triplestore be allowed to store twice the same ...

Pick and RDF/SPARQL

Anyone have any interest in intergrating RDF and/or SPARQL with a PICK database? Has anyone tried this yet? I have some thoughts about what to try. One idea is to figure out how to create a file with ...

Using contexts in rdflib

I am having trouble finding a clear, sensible example of usage of context with rdflib. ConjunctiveGraph does not accept contexts, and Graph is deprecated. How am I supposed to create and operate on ...

What is the difference between RDF and OWL? [closed]

I am trying to grasp the concept of Semantic Web. I am finding it hard to understand what exactly is the difference between RDF and OWL. Is OWL an extension of RDF or these two are totally different ...

Problem with SPARQLWrapper (Python)

I m making a SPARQL query against the Sesame store in localhost, using SPARQLWrapper: sparql = SPARQLWrapper( http://localhost:8080/openrdf-sesame/repositories/rep/statements ) sparql.setQuery(...

热门标签