java - ParserConfig error in Sesame 2.7 when trying to upload RDF files from DBpedia -
i trying upload sesame repository set of rdf file coming dbpedia. problem is: every rdf file, sesame give following error:
'whatever_file_is': 'some_value' not recognised, , not verified, datatype http://dbpedia.org/datatype/rod [line 30121, column 123]
after research, discovered dbpedia doesn't publish datatypes in dbpedia ontology, bellow (extract http://mappings.dbpedia.org/index.php/datatype:rod):
please note: datatypes not (yet) copied dbpedia mappings wiki dbpedia ontology. hard-coded in ontologydatatypes.scala , added wiki reference. adding datatype in wiki not change ontology , leads error messsage properties use such datatype.
so, if correct, sesame fails when tries verify these datatypes. need upload rdf files.
as using java, tried following code make sesame ignore verification:
repositoryconnection con = repository.getconnection(); set<riosetting<?>> set = new hashset<>(); set.add( basicparsersettings.verify_datatype_values ); con.getparserconfig().setnonfatalerrors(set);
but error continues appear. tried following code:
repositoryconnection con = repository.getconnection(); con.getparserconfig().addnonfatalerror( basicparsersettings.verify_datatype_values );
but last one, strangely, gives java.lang.unsupportedoperationexception
:
exception in thread "main" java.lang.unsupportedoperationexception @ java.util.abstractcollection.add(abstractcollection.java:252) @ org.openrdf.rio.parserconfig.addnonfatalerror(parserconfig.java:134) @ control.repositorycontrol.loadintorepository(repositorycontrol.java:177)
someone has idea of should rdf files dbpedia uploaded sesame?
thanks!
try upgrading sesame 2.7.1. released built-in support dbpedia datatypes.
or if you're stuck on 2.7.0, should able instead:
con.getparserconfig().setnonfatalerrors(new hashset<riosetting<?> (arrays.aslist(basicparsersettings.verify_datatype_values, basicparsersettings.fail_on_unknown_datatypes)));
you might still see message unknown data types, non-fatal warning instead of error.
source:
Comments
Post a Comment