protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
1.01k stars 231 forks source link

Can protege use .ttl format files? #1052

Open mf093087 opened 2 years ago

mf093087 commented 2 years ago

I want to use these ontologies in protege, however, I found it was not possible.

https://github.com/dbpedia/dbpedia https://github.com/SpyrosKou/StandardOntology https://github.com/i40-Tools/I40KG

Because I don't find any place in protege for me to import .ttl format files, I only found how to import ontologies with .owl extension

mf093087 commented 2 years ago

May I ask, how to use .ttl ontology in protege? I can't import that.

johannesschrott commented 2 years ago

You can use the "Open..." function in the file menu (Ctrl + O). For me, this works fine to open .ttl files.

mdebellis commented 2 years ago

Protege definitely supports Turtle (.ttl) I save and load ontologies in turtle all the time. I have a feeling that the problem doesn't relate to the streaming format. I tried loading the dbpedia_3.4.owl file and there was a parsing error. Not sure if that was the DBpedia ontology you were trying to load. If those ontologies are also available in rdf/xml or json-ld you could try those formats. Of course, they should all be semantically the same, regardless of the streaming format. If either one works (rdf/xml tends to be the most portable) then you know it is something about the ttl format.

tfysekis commented 1 year ago

@mf093087 There is no "correct place" to import a .ttl file.I am in a project where i have to import a ontology (.ttl file) to protege 5.5.The best way is to use Ctrl + O to open the .ttl file but beware,you have to check the ontology bye hand to search for possible mistakes.I am afraid this is the only way.

mdebellis commented 1 year ago

@mf093087 There is no "correct place" to import a .ttl file.I am in a project where i have to import a ontology (.ttl file) to protege 5.5.The best way is to use Ctrl + O to open the .ttl file but beware,you have to check the ontology bye hand to search for possible mistakes.I am afraid this is the only way.

Just to be clear, at least as far as I know, there is nothing specific about ttl files compared to rdf/xml or json-ld or other OWL streaming formats. These are all possible expert files for OWL, they all load into Protege and there is nothing specific about ttl that makes it more or less require manual checking. If you use a good tool (like Protege or Web Protege) to create the file in the first place you can run the reasoner and if there are no errors, the chances that Protege won't be able to read the file later are virtually nil. Actually, even if you don't run the reasoner, the chances that a ttl (or other format) file created with a good tool won't at least read (i.e., be correctly parsed, which could still mean there are logical errors) are virtually nil. I've been using Protege for over 10 years and I've never had that happen. The only times I've had problems with a file not being able to parse are when I read it into a text editor, made changes with the text editor, and the editor also changed things without my knowledge, specifically it used "smart quotes" which made the file unable to parse.

If you are having problems loading ontologies it is probably some problem with the ontology itself. E.g., if you try and load all of DBpedia, I think such a file would be order of magnitude a terabyte so of course that's too large to load into Protege because Protege is a modeling tool not a graph database. If you want to work on files that large you need a triplestore not a modeling tool like Protege. I just did an experiment where I took a small sample ontology and saved it in Tutrle. Protege always saves with extension ".owl" but I manually changed the extension of my test file to ".ttl". I got the usual Windows warning but when I went to open the file in Protege 5 it recognized the extension "ttl" as an ontology, and loaded the file with no problem. In general, if you have an ontology file and it ends in some .xxx format that Protege doen't recognize, you can just rename it ".owl" and it should load fine.

Zack-83 commented 1 year ago

With the new version 5.6, it is not possible to open a TTL file by double-clicking on it, or moving it into the program window. Only File --> Open... works.