BONSAMURAIS / BONSAI-ontology-RDF-framework

Recommendations and discussions on ontology and RDF framework development
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Automatic conversion from Turtle to XML #9

Closed kuzeko closed 5 years ago

kuzeko commented 5 years ago

The ontology file at http://ontology.bonsai.uno/core/ontology_v0.1.rdf should be in XML format (e.g., see the Geonames file).

We will develop in TTL format for now. We need a script that will monitor the TTL file and automatically converts it to proper XML a workflow to do this semi-automatically.

See for instance: http://www.easyrdf.org/converter

mmr2187 commented 5 years ago

I think I can open the ttl file in protege and then save it again as an rdf-xml.

kuzeko commented 5 years ago

Yes, that's a way to do it for now.

tngTUDOR commented 5 years ago

I saw the HOWOTO (https://github.com/BONSAMURAIS/BONSAI-ontology-RDF-framework/blob/master/examples/HowTo_Converter.md) and I see you used that python script.

Have you considered using riot ?

docker run -it --rm -v `pwd`:/rdf stain/jena riot -v --pretty RDF/XML core/ontology_v0.1.ttl > core/ontology_v0.1.JENA.rdf
kuzeko commented 5 years ago

@massimopizzol and @ntropy-esa look at this please

tngTUDOR commented 5 years ago

I saw the HOWOTO (https://github.com/BONSAMURAIS/BONSAI-ontology-RDF-framework/blob/master/examples/HowTo_Converter.md) and I see you used that python script.

Have you considered using riot ?

docker run -it --rm -v `pwd`:/rdf stain/jena riot -v --pretty RDF/XML core/ontology_v0.1.ttl > core/ontology_v0.1.JENA.rdf

When I did this, the output file is quite different from the one done using the rdflib based script mentionned in the howto

massimopizzol commented 5 years ago

Thanks @tngTUDOR. We only checked for python based converters as this is what @kuzeko indicated. We are also not sure if the converted output makes sense. Somebody with more RDF familiarity should look at these outputs. For me jena or python doesn't matter, I would go for the most stable/robust one. @tngTUDOR What would you recommend?

kuzeko commented 5 years ago

Yes, I defaulted to python but there is no need to use python. I'm fine with anything then. You have green light with either option on my side. Please proceed how you see fit.

massimopizzol commented 5 years ago

Please discuss it down there and then decide. We have two proposed methods, should be enough to close the issue. I would love if @tngTUDOR could write a brief "howto with jena" if we go for it!

ntropy-esa commented 5 years ago

@tngTUDOR ALPHA/ We need to have it automated, i.e. with the CD/CI system as Matteo explained. Jena/Riot/Docker combo can do that? I am not an expert in that at all.

The python library I guess is more for us, to quickly do it on our machines.

BRAVO/ the output files need to be compared; can you share your output?

kuzeko commented 5 years ago

Related to the jena riot conversion specifically for JSON-LD https://stackoverflow.com/questions/26287432/json-ld-in-jena-riot

kuzeko commented 5 years ago

Hi all, I've investigated the issue and the code. I've implemented the method and wrote the How To. Please see this commit https://github.com/BONSAMURAIS/BONSAI-ontology-RDF-framework/commit/a5776f8de1970a5e6c1cf0447c878039e3529a74#diff-a2f363641ee91574e1622a3fc6ca8d99

I would ask you to see if it is clear or if you have issues with it.

Bottom line, I think we can stick with jena/riot

mmr2187 commented 5 years ago

shouldn't this issue be closed or is there something left to be done?

massimopizzol commented 5 years ago

The only problem for me is the python approach is easier because I only need python and an additional package, so it's more in line with the rest of the Bonsai code and more reproducible.

kuzeko commented 5 years ago

I've implemented it also on the core ontology. We now have the automatic conversion of files on commit.

https://github.com/BONSAMURAIS/ontology/commit/0d5b0252bf410bd080502068e9d357717a2aad81

I know it sounds scary, but docker is very convenient. You install it and then all will magically work. The RIOT is maintained by the Apache Jena project, and with docker is a 1-line command with not other things required.

massimopizzol commented 5 years ago

I actually managed, yes not difficult once docker installed.

kuzeko commented 5 years ago

Great, we'll go out for beers to celebrate then! :) Can we close this?

kuzeko commented 5 years ago

This is duplicate of #4