The way I currenlty learn the most about coding with SWI-Prolog is by text searching many downloaded trusted repositories from GitHub (ref) with NotePad++ and then look at the code. If the code is in the ball park of what I need I look at it in more detail. If I don’t understand something I use the individual predicates in examples until the predicate is my friend. Sometimes this takes a few hours and sometimes it takes months. dif/2 is one I am currently trying to make a friend.
Often this leads to other code or ways of doing things and my code just keeps getting better. The most interesting fact of all of this is that my code no longer looks anything like what I learned in my university class many decades ago, it looks a lot more like the code for SWI-Prolog.
Current list (Click triangle to expand)
bench-master
contrib-protobufs-master
docker-swipl-linux-ci-master
packages-bdb-master
packages-chr-master
packages-clib-master
packages-cppproxy-master
packages-http-master
packages-inclpr-master
packages-jpl-master
packages-ltx2htm-master
packages-odbc-master
packages-pcre-master
packages-pengines-master
packages-pldoc-master
packages-RDF-master
packages-real-master
packages-semweb-master
packages-sgml-master
packages-ssl-master
packages-utf8proc-master
packages-xpce-master
packages-yaml-master
packages-zlib-master
pengines-master
plweb-blog-master
plweb-examples-master
plweb-master
plweb-www-master
rclswi-master
sCASP-swipl
swipl-devel-master
swipl-master
swipl-server-js-client-master
swish-master
webstat-master
EDIT
Sometimes there is not enough hits in the current set of repositories. In such cases searching GitHub directly against all repositories, then selecting just those with Prolog code generates new sources of information. This was done recently for http_reply_from_files/3 as there were not enough simple examples from the list above.