I get this error message : Exception in thread "AWT-EventQueue-0" org.apache.jena.riot.RiotException: [line: 1, col: 1 ] Content is not allowed in prolog. when i try to load my local ontology file in java through netbeans? Please what does this mean and how can I go about it?
Asked
Active
Viewed 191 times
1
-
Have you done [any research into this](https://stackoverflow.com/questions/21513440/jena-read-from-turtle-fails)? Please post any research you've done and why they do not solve the problem (along with a [mcve] to outline the issue preferably). – Ironcache Feb 07 '18 at 13:54
-
Possible duplicate of [Jena read from turtle fails](https://stackoverflow.com/questions/21513440/jena-read-from-turtle-fails) – Ironcache Feb 07 '18 at 13:55
-
Content not allowed in prolog is a typical XML error, something about the wrong whitespaces used in the headers iirc. – G_V Feb 07 '18 at 13:56
1 Answers
4
[line: 1, col: 1 ] Content is not allowed in prolog
That's the hallmark of an XML parser encountering a non-XML (or malformed) file.
If your input is an XML file, make sure it starts with
<?xml version="1.0"
with no other characters in front of the <
.
This might also be the case for an imported ontology.
Note: NetBeans or any other IDE are not relevant to this issue.

Ignazio
- 10,504
- 1
- 14
- 25
-
Thanks @Ignazio, Problem has been fixed. I simply changed the format in which my ontology was saved from functional format to rdf/xml format and it works now. Thanks to everyone for their contributions. I appreciate them – Omojolinho Mar 16 '18 at 00:42