1

I have to query an ontology of 70,000 triples using sesame on android. All these problems were solved by creating a parser and then using it. Now having the same problem with SPARQL Query which i posted here How to Query in Sesame openrdf using SPARQL in Android?

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • There is not enough information here to say what is going wrong or how it can be solved. You will need to show the exact error (stacktrace). Also helpful would be if you could tell us which version of Sesame you're using. As a general remark, however, I should say that Sesame is not officially supported for use on Android. It's likely that you get errors because Sesame requires something that Android's SDK simply does not support. Determining whether there is a workaround requires more detail about your problem (and more knowledge about Android SDK than I possess). – Jeen Broekstra Apr 22 '14 at 03:39
  • I am using Sesame 2.4.2. Whether or not Sesame is supported, i saw that many people are using sesame on android in the same way as i am trying to use. My exact stack trace is as follows. – user3556249 Apr 22 '14 at 09:55
  • I am unable to add stack trace because its too long. – user3556249 Apr 22 '14 at 10:22
  • Don't try to add the stack trace in a comment. Instead, you can edit your question to add more details. If it's really long, trim it down to the essential parts. Als make sure you use code formatting so it's easy to read. – Jeen Broekstra Apr 22 '14 at 19:40
  • 2.4.2 is quite old, latest version is currently 2.7.11. Not saying that will solve the problem, but it might not be a bad idea to upgrade. – Jeen Broekstra Apr 22 '14 at 19:45
  • Possibly related question: http://stackoverflow.com/questions/5760607/using-serviceloader-on-android – Jeen Broekstra Apr 30 '14 at 00:00
  • Please provide an _answer_ with the solution to your problem, instead of replacing the question text. If you replace the question text, it becomes hard to understand, as you then have an answer without a question! – Jeen Broekstra May 04 '14 at 23:03

1 Answers1

1

The UnsupportedRDFFormatException indicates that the RDF/XML parser can not be located. This means that the actual jar (sesame-rio-rdfxml.jar if you're using separate Sesame jar files, or just openrdf-sesame-onejar-2.7.11.jar if you're using the onejar distribution) can not be located. To fix, make sure that the required jar(s) are present on your classpath.

Another possible cause is that the parser is actually on your classpath but can not be loaded. Sesame uses a Java Service Provider Interface (SPI) for dynamic loading of the parser. This in turn requires the presence of a file META-INF/services/org.openrdf.rio.RDFParserFactory in the jar file. If you have somehow repackaged the official Sesame distribution jar file and have removed or modified this file, Sesame will be unable to locate the parser. See the Android docs on the ServiceLoader for more details.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • Thanks for replying but i tried these options and it didnt work. I didnt repackaged the sesame distribution jar file, i dont get why it still giving errors. Kindly guide me how could i get rid of this problem. – user3556249 Apr 29 '14 at 13:59
  • I'm no Android developer, but there are some related questions here about the use of ServiceLoader on Android that might be of use to you, for example http://stackoverflow.com/questions/5760607/using-serviceloader-on-android . Hope that helps you further. – Jeen Broekstra Apr 30 '14 at 00:02
  • Infact i am loading my file as fis = getAssets().open("File.rdf"); and then adding in connection as con.add(fis, baseURI,RDFFormat.RDFXML); Is it possible that the problem exists with loading of file? – user3556249 Apr 30 '14 at 13:19