# Fix to thea2 for saving in plsyn format

**URL:** <https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205>\
**Category:** Nice to know\
**Tags:** how-to\
**Created:** [April 21, 2020, 2:18am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205 "2020-04-21T02:18:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![RdR](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/rdr/32/379_2.png) [@RdR](https://swi-prolog.discourse.group/u/RdR)\
**Post date:** [April 21, 2020, 2:18am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/1 "2020-04-21T02:18:52Z")

</div>

The thea2 library enables reading, analysis and writing of ontology files in a variety of formats. A particularly useful format is `plsyn` which is a succinct format (sort of Manchester meets Functional style). However, for some reason in the current git download of the thea libraries, the `save_axioms` hook in the `owl2_plsyn.pl` file doesn’t save to file, but instead dumps to screen.

The following fix in the predicate `owl2_io:save_axioms_hook/3` will alleviate that. I essentially mirrored the code from the similar file `owl2_to_prolog_dlp.pl`.

```prolog
owl2_io:save_axioms_hook(File,plsyn,Opts) :-
        ( nonvar(File)
        -> tell(File)
        ; true
        ),
        write_owl_as_plsyn(Opts),
        told.

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [April 21, 2020, 7:47am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/2 "2020-04-21T07:47:04Z")

</div>

Thanks. Added after a small rewrite using setup\_call\_cleanup/3.

---

<div class="post-metadata">

**Author:** ![RdR](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/rdr/32/379_2.png) [@RdR](https://swi-prolog.discourse.group/u/RdR)\
**Post date:** [May 14, 2020, 10:34pm UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/3 "2020-05-14T22:34:32Z")

</div>

Hi Jan – just quickly checking: is [https://github.com/vangelisv/thea](https://github.com/vangelisv/thea) the correct repository to start contributing to? I’m just asking because the updates that you kindly added for me from the comments in this forum don’t seem to be in there. I would like to become a contributor, but I’m not sure which repo to request that of.

cheers,

RdR

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [May 15, 2020, 7:02am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/5 "2020-05-15T07:02:53Z")

</div>

Good you ask. The place is now [https://github.com/conceptsinmotion/thea](https://github.com/conceptsinmotion/thea)

The version there has quite a few fixes compared to the one you refer to. The original project is mostly sleeping. I revived it a little as I needed some of its functionality in a project (concepts in motion). Chris Mungall knows about this. He says he is working on a replacement of thea following a quite different design.

---

<div class="post-metadata">

**Author:** ![RdR](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/rdr/32/379_2.png) [@RdR](https://swi-prolog.discourse.group/u/RdR)\
**Post date:** [May 17, 2020, 4:22am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/6 "2020-05-17T04:22:14Z")

</div>

Thanks, Jan. Can I request contributor access for Github user RdR1024 (me)? I tried to push a fix (i.e. create a pull request), but it tells me I don’t have the correct access rights.

Or is there another way you would prefer I use?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [May 17, 2020, 7:57am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/7 "2020-05-17T07:57:53Z")

</div>

The usual way in Github is that you fork the repo on Github, clone your fork, edit and commit, then push to your fork and create a pull request. Now that you already have a clone of the original, you can do

- Fork on github
- In your local clone, do `git remote add myfork url-of-your-fork`
- `git push myfork`

And create the pull request

Given that you seem to be happily hacking in Thea, I’m happy to give you access to the repo.

(correction). I didn’t setup the organization and it seems I do not have admin rights to the repo. Will check with the owners.

---

<div class="post-metadata">

**Author:** ![RdR](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/rdr/32/379_2.png) [@RdR](https://swi-prolog.discourse.group/u/RdR)\
**Post date:** [May 17, 2020, 8:36am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/8 "2020-05-17T08:36:17Z")

</div>

Thanks, Jan – it would simplify things. I’ll await the answer.

---

<div class="post-metadata">

**Author:** ![RdR](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/rdr/32/379_2.png) [@RdR](https://swi-prolog.discourse.group/u/RdR)\
**Post date:** [May 17, 2020, 11:43pm UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/9 "2020-05-17T23:43:37Z")

</div>

@jan I ended up deleting the clone from conceptsinmotion and first forking into my own account, and syncing that fork with the original repo from conceptsinmotion (don’t know if that is strictly necessary, but github recommends this to ensure updates from the original are sync’d in the fork).

I then created a fix-branch in the fork, according to your earlier suggestion, and committed the changes. I then pushed to origin, and went to the provided link to create a pull request. The github page kindly already sets the pull request up as a fork-to-upstream request. I added some notes and submitted the PR.

Hopefully all goes well to get the change into the conceptsinmotion/thea repo and I’ll continue adding to it.

cheers,

RdR

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [May 18, 2020, 7:47am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/10 "2020-05-18T07:47:06Z")

</div>

Thanks! Merged. I contacted the owners to grant you write access to the repo as well.

---

<div class="post-metadata">

**Author:** ![RdR](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/rdr/32/379_2.png) [@RdR](https://swi-prolog.discourse.group/u/RdR)\
**Post date:** [May 19, 2020, 6:43am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/11 "2020-05-19T06:43:22Z")

</div>

@jan a quick question on protocol: should I still let you know about pull requests here, or do you automatically receive notice via github?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [May 19, 2020, 7:04am UTC](https://swi-prolog.discourse.group/t/fix-to-thea2-for-saving-in-plsyn-format/2205/12 "2020-05-19T07:04:20Z")

</div>

I get them through github.
