|
|
Index
| Recent Threads
| Who's Online
| User List
| Search
| Help
| |
|
Forum closing down This forum will be closing down due to extensive spamming activities. As a first step, registration of new members has been disabled. Existing members will be able to use the forum for now, but please consider using the sesame-general mailing list instead. |
![]() |
openRDF.org Forum » Sesame & Rio: Help » Thread: Content is not allowed in prolog |
|
Total posts in this thread: 11
|
[Add To My Favorites] [Watch this Thread] [Post new Thread] |
| Author |
|
|
May 4, 2004 10:06:29 AM
xilos Member
|
Hi all We are trying to use sesame in our internal development and we have found some errors. The xerces parser does not read correctly any RDF file and rises this error: "Content is not allowed in prolog.". We have tried with several versions of this parser. Please, if you know about this trouble or if you know about anybody who is experiencing (and solving ;-) the same error, let us know. Thanks in advance |
||
|
|
May 4, 2004 10:38:34 AM
jeen Sesame Addict The Netherlands Joined: Jan 23, 2004 Posts: 1091 Status: Offline |
This sounds like you are trying to let the Rdf/XML parser process a non-XML RDF file. What serialization format is your RDF in, is it NTriples? ---------------------------------------- Researcher at AFSG - Wageningen UR |
||
|
|
May 4, 2004 12:58:08 PM
xilos Member
|
The format is RDF/XML. The document is well formed. Thanks, |
||
|
|
May 4, 2004 1:28:46 PM
jeen Sesame Addict The Netherlands Joined: Jan 23, 2004 Posts: 1091 Status: Offline |
That is very peculiar. How exactly are you adding the file to Sesame when this error , are you using the web interface or are you accessing through the API? If the latter, can you show the bit of code that you are using? If the former, do the log files give you any clue what might be wrong? Also: what exactly is your setup, that is, which version of Sesame, Java, Tomcat, Xerces are you using? ---------------------------------------- Researcher at AFSG - Wageningen UR |
||
|
|
May 4, 2004 2:13:05 PM
xilos Member
|
I´m using the api, local repository without running server. The code: StdOutAdminListener adminlistener = new StdOutAdminListener(); RepositoryConfig config = new RepositoryConfig("myRep"); SailConfig syncSail = new SailConfig("org.openrdf.sesame.sailimpl.sync.SyncRdfSchemaRepository"); SailConfig memSail = new SailConfig("org.openrdf.sesame.sailimpl.memory.RdfSchemaRepository"); config.addSail(syncSail); config.addSail(memSail); config.setWorldReadable(true); config.setWorldWriteable(true); LocalService service = Sesame.getService(); service.addRepository(config); File rdfFile = new File("C://proyectos//elcano//buscador//doc//Ontology//Domain//culture.rdf"); LocalRepository myRepository = (LocalRepository) service.getRepository("myRep"); myRepository.addData(rdfFile,"http://www.oclc.org/schema.rdf#", RDFFormat.RDFXML,false,adminlistener); System.out.println("modelo en memoria"); Versions JDK is 1.4 sesame 1.0.1 xerces 2.6.2 I can create a repository using server over HTTP, and I add this file to the repository. Thanks Silvestre. |
||
|
|
May 5, 2004 10:06:23 AM
jeen Sesame Addict The Netherlands Joined: Jan 23, 2004 Posts: 1091 Status: Offline |
I can not reproduce the error. The only thing I can think of is that your setting of the system property org.xml.sax.driver is not correct. Try inserting the following in your code:
If that does not solve the problem, could you please send me a copy of the file that you are trying to upload? ---------------------------------------- Researcher at AFSG - Wageningen UR ---------------------------------------- [Edit 1 times, last edit by jeen at May 5, 2004 10:06:45 AM] |
||
|
|
Feb 16, 2005 1:32:51 PM
behrooz Visitor
|
I think this problem is an I/O problem. Usually this occures when parser calls inputStream's read(byte[],offSet,len).In this case the parser wants to read a block of data to improve the performance.And if your input stream return a chunk of data which is not complete available data (because the parser assums that it will block until end of data or total requested buffer be filled). |
||
|
|
May 2, 2005 9:47:29 PM
anksagi Visitor
|
thats right.. the problem is coming when ur parser is reading the bytes from the xml doc . . the prolog definition is not proper.. few things you can check which are fairly simple and occur due to jst a bit of negligience here n there . . just make sure the first node or your xml is actually the xml prolog node <?xml.. and not an enter character, space char or any junk text node.. |
||
|
|
Aug 22, 2005 10:12:10 AM
juny Member
|
Hi, I've recently encountered the same problem. But I am trying to add the file through http, using Ruby on Rails. The file is in RDF/XML and is well formed, when I add the file through sesame web interface there're no problems, but if I use sesame http to add the file it gives me this error 'error while adding new triples: org.openrdf .rio.ParseException: org.xml.sax.SAXParseException: Content is not allowed in prolog. Please help |
||
|
|
Aug 25, 2005 10:29:38 AM
arjohn OpenRDF project lead The Netherlands Joined: Jan 23, 2004 Posts: 1289 Status: Offline |
After some extensive research on the web, the most likely cause for this behaviour is that you are using an UTF-8 encoded file with byte-order mark (BOM). Java doesn't handle BOMs on UTF-8 files properly, making the three header bytes appear as being part of the document. UTF-8 files with BOMs are commonly generated by tools such as Window's Notepad. This is a known bug in Java, but it still needs fixing after almost 4 years... I would appreciate it if you could test this theory. To do so you will need to investigate the first few bytes of the file. If the first three bytes of the file have hexadecimal values EF BB BF then the file contains a BOM. In case you don't know how to do the above, feel free to post the problematic file to the forum or to e-mail it to me. ---------------------------------------- Arjohn Kampman, OpenRDF project lead, Aduna |
|||
|
|
[Show Printable Version of Thread] [Post new Thread] |