Problem when importing an owl file

745 views
Skip to first unread message

Pedro Paulo Favato Barcelos

unread,
Oct 8, 2021, 12:03:26 PM10/8/21
to vocbench-user
Hi, community,

I am facing a problem when importing a simple OWL ontology to my Vocbench Ontolex project. I have tried versions 9 and 10 and in both the same problem occurs.

I am trying to import using: Metadata > Namespaces and Imports > Add Import From > Local File

The reported error is:
org.eclipse.rdf4j.query.QueryEvaluationException: org.eclipse.rdf4j.rio.RDFParseException: Content is not allowed in prolog. [line 1, column 1]

I am puzzled because the ontology (here attached) is really simple: it consists of only one direct import (importing Ontolex), 4 classes, and 5 object properties. The file was created on Protégé.

Can someone please help me understand what is happening? Is it a bug on Vocbench? If so, should I report on GitHub?

Thank you very much in advance.
Thor Ontology 1.4.owl

Manuel Fiorelli

unread,
Oct 8, 2021, 7:53:08 PM10/8/21
to Pedro Paulo Favato Barcelos, vocbench-user
Hi Pedro

I didn't test it but looking at the provided ontology I'm quite sure to have identified the problem.

Your file conforms to the TURTLE specification, while the file extension .owl is usually associated with RDF/XML files (see https://rdf4j.org/javadoc/latest/org/eclipse/rdf4j/rio/RDFFormat.html#RDFXML).
Accordingly, when you try to import the file, VocBench tries to use the parser for the RDF/XML syntax, which - obviously - fails on a TURTLE file.

The solution is simple: just change the file extension to .ttl or save again the ontology, choosing the RDF/XML format this time.

Please, let us known if my suggestion works.

Regards
Manuel

--
You received this message because you are subscribed to the Google Groups "vocbench-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vocbench-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/e1b43e37-24a6-4530-89a8-fc4c6b3c5570n%40googlegroups.com.


--
Manuel Fiorelli

Pedro Paulo Favato Barcelos

unread,
Oct 11, 2021, 7:28:49 AM10/11/21
to Manuel Fiorelli, vocbench-user
Hi Manuel, good afternoon,

Thank you very much for your answer! This really solved the problem! I could upload the file saved as ttl with no problem!  It was something so simple... =)

As a suggestion, wouldn't it be interesting to create an input validation or at least ask the user which syntax is he/she using? This feature would avoid others to have problems like I did.

Thank you once again and I wish you a great week!

Kind regards - Cordiali saluti - Atenciosamente,
Pedro Paulo Favato Barcelos

Armando Stellato

unread,
Oct 11, 2021, 11:03:06 AM10/11/21
to Pedro Paulo Favato Barcelos, Manuel Fiorelli, vocbench-user

Dear Pedro,

 

there is indeed some support for correction in other areas. For instance, whether you are in the pre-load section of VB or in the load data, you can opt to “force” the format to the type of your own choice, even if the file extension would suggest another one. This is missing in the import panel just for historical reasons and for a sort of consistency of the UI: the import is usually performed from the Web. Now, in the Web, we expect information to be properly published. In that case, other than the extension (which implies the MIME type), the MIME type can be associated with the returned file by the service returning it. So, even though importing from local file was one of the options, we minimized the differences across the various options (web, local file, mirror) to provide a consistent UI.

In any case, your case is a quite unusual one: I don’t know of many applications that, upon getting a file with a format not consistent with its extension, would properly handle it. The file should have been with .ttl extension in the first place. After a very quick search, I couldn’t confirm if .owl is normatively to be considered as an extension for RDF/XML formatted files. At least, at the level of the RDF4 framework (e.g. the link already provided), it seems to suggest so.

 

Kind Regards,


Armando

 

 

 

 

 

Pedro Paulo Favato Barcelos

unread,
Oct 15, 2021, 11:48:10 AM10/15/21
to Armando Stellato, Manuel Fiorelli, vocbench-user
I sent another email regarding this issue, but I guess it was not sent for some reason...so I am sending it again and  I apologize in case of a duplicate.

Hi community,

I am still facing problems importing my ontology in an Ontolex project on Vocbench. For solving the problem reported in the first email of this thread, I performed two actions:
  1. changed the ontology file extension from owl to ttl (as it is written in turtle)
  2. before importing the ontology, I removed its label from the namespace management list in the project. 
I was able to correctly import the ontology only after these two steps.

Now I have upgraded my ontology and I want to substitute the one already in the project for the new one. To do this, I removed the old importing clicking on the garbage can icon for the ontology in the imports list. And now I have the following problems:

1) I cannot remove the prefix/namespace of the old ontology from the list. It is shown in gray and when I click on it, the remove button is not available. Why is this happening?

2) When trying to import the ontology without removing the namespace from the list, I get the following error:

Not a valid (absolute) IRI: /opt/vocbench3/semanticturkey-9.1/data/tmp/addFromLocalFile5288585900881900178Thor Ontology 2.2.ttl

The new ontology file is here attached.

Some useful information might be that I have some instances in the project that are instances of classes from my ontology, but the upgrade of the version of the ontology shouldn't have any impact on this, as the base URI has not changed.

Can someone help me with that? Any tips or suggestions?

Thank you in advance for all the support =)

Kind regards - Cordiali saluti - Atenciosamente,
Pedro Paulo Favato Barcelos
Thor Ontology 2.2.ttl

Armando Stellato

unread,
Oct 17, 2021, 12:25:32 PM10/17/21
to Pedro Paulo Favato Barcelos, Manuel Fiorelli, vocbench-user

Dear Pedro,

 

which version are you using for VB and which fields did you fill when doing the import? I just tried to import your ontology with our new VB and it works, but this might be related to some bug in your VB version. In any case, it shouldn’t be related with your issue about the prefix-namespace mapping. Pls let me know your version (and fields filled) and I will test your ontology on it

 

About the ns-prefix mapping, well this is related to automatic mappings assigned by the underlying RDF4J.

 

You can do a few things:

 

  • If you want to change the namespace assigned to the thor prefix, just add a new mapping with the same prefix but a different namespace, it will overwrite the previous one
    • You can even then remove the mapping :D
  • If you want to change the prefix for a given namespace, you can select the edit button, it works and it will, practically, add a new mapping overwriting the one before

 

Kind Regards,


Armando

 

Pedro Paulo Favato Barcelos

unread,
Oct 18, 2021, 5:39:03 AM10/18/21
to Armando Stellato, Manuel Fiorelli, vocbench-user
Hi Armando, good morning!

First of all, thank you very much for your help.


which version are you using for VB and which fields did you fill when doing the import? I just tried to import your ontology with our new VB and it works, but this might be related to some bug in your VB version. In any case, it shouldn’t be related with your issue about the prefix-namespace mapping. Pls let me know your version (and fields filled) and I will test your ontology on it

I am using Vocbench v.9.1.0. I downloaded the newest version, imported my project data there and then I was able to correctly upload the ontology with no problems. I have also tested to import the owl ontology in a blank project in the 9.1.0 version and the ontology is not imported as well. Seems to be a bug related to the 9.1.0 version. 

Regarding the fields used, I just click on Add import from > Local File > Browse > (select the file) > OK

If you want to change the namespace assigned to the thor prefix, just add a new mapping with the same prefix but a different namespace, it will overwrite the previous one. You can even then remove the mapping :D

It worked! I was able to delete the prefix after overwriting it! Thank you!

I am going to work on migrating the server for the newest version, which I think it is going to solve my problem.

Have a nice week!

Kind regards - Cordiali saluti - Atenciosamente,
Pedro Paulo Favato Barcelos

Otso

unread,
Oct 18, 2021, 12:40:12 PM10/18/21
to vocbench-user
Hello,

I am running into a similar problem in 10.1. I am trying to import this ontology https://standards.buildingsmart.org/IFC/DEV/IFC4_1/OWL/ontology.xml from a local file (which VB identifies as TriX, seems correct at a quick glance, URL import fails due to file size). When pressing "preload data", loading dialogue is displayed but nothing is loaded and I am unable to advance. Similarly to my previous problems I see nothing in any logs.

Similar issue happens if I try to import the ontology either from URL or local file. Similarly, nothing is imported *except* that VB has added the ontology prefixes to namespaces. An unfortunate side-effect is that I am unable to remove any prefixes - the minus button is greyed and the only thing I can do with these added prefixes is to change the prefix label.

As a sanity-check I have imported the same ontology both in Turtle and XML into Protégé without any issues.

Could someone give a hint on how to remove unwanted namespaces and is there any other way to debug the local import other than accessing the ST backend directly via POST requests and seeing if it returns anything more verbose?

Kind regards,
Otso

Pedro Paulo Favato Barcelos

unread,
Oct 18, 2021, 4:36:22 PM10/18/21
to Otso, vocbench-user
Hi Otso!

Could someone give a hint on how to remove unwanted namespaces (...)

Regarding this, Armando's tip solved the problem! Just insert a new namespace with the same label, then the old one is going to be overwritten and the minus button is going to be available for use again. =)

Kind regards - Cordiali saluti - Atenciosamente,
Pedro Paulo Favato Barcelos
You received this message because you are subscribed to a topic in the Google Groups "vocbench-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vocbench-user/Gw6zlNTMRmc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vocbench-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/cfe93b6d-faf2-40b9-b14b-f04a32ae6710n%40googlegroups.com.

Otso

unread,
Oct 22, 2021, 7:16:49 AM10/22/21
to vocbench-user
Thank you Pedro for the hint, the original message by Armando somehow passed by my eyes.

If anyone has a clue on why VB refuses to import the aforementioned ontology and fails silently, I would be grateful.

Kind regards,
Otso

Manuel Fiorelli

unread,
Oct 22, 2021, 3:48:09 PM10/22/21
to Otso, vocbench-user
Hi Otso

I didn't test it, but the problem you describe when importing https://standards.buildingsmart.org/IFC/DEV/IFC4_1/OWL/ontology.xml is that the ontology is not serialized as TriX (as the extension would suggest) but as RDF/XML.
It should be possible to force the format when importing the ontology from a local file; alternatively, change the file extension to .rdf

Regards
Manuel



--
Manuel Fiorelli
Reply all
Reply to author
Forward
0 new messages