Pack: changed github url?


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



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 ???

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

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

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

?- pack_install('').

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 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 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/')).

?- use_module(pack(ape)).
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/
Warning:    Invalid mode declaration in PlDoc comment: post_process//0
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/
Warning:    Invalid mode declaration in PlDoc comment: get_sentence_id('SId'/'_TId','SId')
Warning: /home/xxxxx/.local/share/swi-prolog/pack/APE/prolog/utils/
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/
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/
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/
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/
Warning:    Invalid mode declaration in PlDoc comment: ce_to_xml('ObjectSomeValuesFrom'('OPE','CE'),'_Prefix','Class'('CE'))

?-  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 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 file and may conclude the name is wrong. The only way around would be to get the 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).