Pack: changed github url?

hi,

Trying to install Attempto(APE), but the github url is different :

correct> https://github.com/Attempto/APE.git

incorrect> https://github.com/fnogatz/APE.git

how to fix that ?
Also if there are any SWI specific instructions on using it… cant see in the docs how you use it from swipl ???

https://www.swi-prolog.org/pack/file_details/ape/README.md

Plus there seems to be no packages named : clib,sgml,http

?- pack_install(ape).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Install ape@6.7.0 from https://github.com/fnogatz/APE.git Y/n? 
% Cloning into '/home/xxxxx/.local/share/swi-prolog/pack/APE'...
Username for 'https://github.com': 
Password for 'https://xxxxxx@github.com': 
ERROR: remote: Repository not found.
ERROR: fatal: repository 'https://github.com/fnogatz/APE.git/' not found

Hmm. The repository is apparently moved. The simple way to install anyway is

?- pack_install('https://github.com/Attempto/APE.git').

And ignore a couple of warnings :frowning:

I’ve updated the pattern for allowed urls. A manual install doesn’t update the default url though. This may be related to the pack.pl claiming release files instead of using git clone as download. It also seems that the new git doesn’t provide the same hash as the old one. @fnogatz, do you know what happened?

1 Like

Thanks Jan for reaching out. Just for completeness, here’s the related GitHub issue to release APE as library(ape) in SWI’s package list: Package the APE modules as a SWI-Prolog extension package · Issue #4 · Attempto/APE · GitHub
I did the initial work to create the pack.pl for APE in PR #24. Probably that’s the reason my old fork at fnogatz/APE is referred to. Jan, what’s needed to get ?- pack_install(ape). linked to GitHub - Attempto/APE: Parser for Attempto Controlled English (ACE) again? In its list of releases, only the format of the actual version numbers seems a little bit odd.

seems ok… except i get all those warnings …
How can skip the assert(), thing … its just compiled, but not installed, right, thats why i have to use use_module(pack(ape)) ?

?- assert(user:file_search_path(pack, '/home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/')).
true.

?- use_module(pack(ape)).
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/drs_to_coreace.pl:168:
Warning:    Invalid mode declaration in PlDoc comment: post_process//0
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/drs_to_coreace.pl:1563:
Warning:    Invalid mode declaration in PlDoc comment: get_sentence_id('SId'/'_TId','SId')
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/implication_turn.pl:45:
Warning:    Invalid mode declaration in PlDoc comment: implication_turn(+ ('Implication':term),- ('ImplicationTurned':term))is undet
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/implication_turn.pl:54:
Warning:    Invalid mode declaration in PlDoc comment: drs_turn(+ ('Level':functor),+ ('Subject':functor),+ ('CondsIn':list),- ('CondsTurned':list))is undet
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/owlswrl/drs_to_owlswrl_core.pl:793:
Warning:    Invalid mode declaration in PlDoc comment: get_entity(+iri('Name':atom),- ('Individual':term))is semidet
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/owlswrl/owlswrl_to_xml.pl:173:
Warning:    Invalid mode declaration in PlDoc comment: e_to_xml(ce,'CE','Prefix','CEx')
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/owlswrl/owlswrl_to_xml.pl:182:
Warning:    Invalid mode declaration in PlDoc comment: ce_to_xml('ObjectSomeValuesFrom'('OPE','CE'),'_Prefix','Class'('CE'))
true.

?-  get_ape_results([text='John waits.', solo=drs], ContentType, Content).
ContentType = 'text/plain',
Content = 'drs([A],[predicate(A,wait,named(\'John\'))-1/2])'.

Hi Falco. As the new git is not a successor of your git, I think the simplest way is for me to delete the APE pack and revive it by installing it from the git. Doesn’t matter who does the latter step, so I can do so. Shall I do so?

Go for it, Jan!

Works again. There is a small flaw. The pack.pl says the pack is called ape and the repo is APE. That leads to some confusion. The pack is now known as ape on the Prolog site, but after installation it is called APE locally. Not sure what to think about this. One option is to make this consistent on your end (after which the pack must be recreated once more).

Getting it fixed in pack_install/1 is rather hard as installing from a GIT repo starts with cloning this repo. Only after cloning we find the content of the pack.pl file and may conclude the name is wrong. The only way around would be to get the pack.pl file first, but that is a little hacky. I think there is some value in allowing the pack name to be different from the repo, in particular as github repos for a user live in a single directory. Doing so complicates the process and dependencies though :frowning:

1 Like

Hm, this is a thing I already stumbled upon several times. Locally, I call all my Prolog packs swipl-..., so library(xsd) is located at swipl-xsd, etc. For GitHub, I had to name the repositories without this prefix. So I would consider the current behaviour a major drawback of the package system. Maybe we should open an issue on GitHub? Hopefully, I can find some spare time the next days to work on a fix for this.

1 Like

We could of course define a different mapping from filename to pack name, such as allowing the file/repo name to be prefixed using swipl-. A fixed swipl- seems a bit rigid. On the other hand, it makes finding files and repositories that are supposed to be SWI-Prolog packs easy. Surely, this would be easy to implement (but doesn’t deal with the ape vs APE).