# Head links to SWISH notebooks, are they possible?

**URL:** <https://swi-prolog.discourse.group/t/head-links-to-swish-notebooks-are-they-possible/816>\
**Category:** Help!\
**Tags:** swish\
**Created:** [June 14, 2019, 10:10am UTC](https://swi-prolog.discourse.group/t/head-links-to-swish-notebooks-are-they-possible/816 "2019-06-14T10:10:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [June 14, 2019, 10:10am UTC](https://swi-prolog.discourse.group/t/head-links-to-swish-notebooks-are-they-possible/816/1 "2019-06-14T10:10:14Z")

</div>

In following along on topic [Six ways to iterate in Prolog](https://swi-prolog.discourse.group/t/six-ways-to-iterate-in-prolog/477) I thought it would be nice to have a link in the first [post](https://swi-prolog.discourse.group/t/six-ways-to-iterate-in-prolog/477) to the SWISH page.

After some discussion with @joeblog and not being a SWISH [aficionado](https://www.merriam-webster.com/dictionary/aficionado) I came to realize that a link to a SWISH notebook is not static, it changes with updates.

In looking for an answer I found [SWISH: SWI-Prolog for Sharing](https://arxiv.org/pdf/1511.00915.pdf) which notes:

> 3.2 Source code and query management
> 
> As JSFiddle formed the initial inspiration for SWISH, SWISH has a facility to save the  
> program. The current version of SWISH explicitly targets the cooperative development  
> of Prolog programs and queries related to a dataset (see section 5.2). This triggered the  
> implementation of a more organised storage facility. The server-side storage module is  
> implemented in Prolog and inspired by GIT. Each file is versioned independently rather  
> than maintaining the version of a hierarchy of files. Files can be referenced by content  
> using their GIT compatible SHA1 hash or by name. The name can be considered a  
> version head and refers to the latest version with that name. The file save and load  
> interface provides the following operations:
> 
> – Saving a file anonymously, which produces a randomly generated URL similar to  
> JSFiddle.  
> – Saving a file by name.  
> – Saving a new version. The interface shows the available versions and the modifications.  
> – Forking a file under a new name. The history remains linked to the original.
> 
> Prolog source files can include other sources on the same server  
> using :- include(filename)., including the latest version or
> 
> ```prolog
> :- include(hash). to include a specific version.
> 
> ```

Noticing storage is [GIT](https://git-scm.com/) inspired, leads me to think that a link exist for the [HEAD](https://git-scm.com/docs/gitglossary). If so how does one copy the link for the [HEAD](https://git-scm.com/docs/gitglossary)?

An [example](https://swi-prolog.discourse.group/t/six-ways-to-iterate-in-prolog/477) of where such a link would be placed.

> Also a SWISH [notebook](https://swish.swi-prolog.org/p/Iteration2.swinb)

---

<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:** [June 14, 2019, 10:58am UTC](https://swi-prolog.discourse.group/t/head-links-to-swish-notebooks-are-they-possible/816/2 "2019-06-14T10:58:26Z")

</div>

> [@EricGT](#):
>
> Noticing storage is [GIT](https://git-scm.com/) inspired, leads me to think that a link exist for the [HEAD](https://git-scm.com/docs/gitglossary). If so how does one copy the link for the [HEAD](https://git-scm.com/docs/gitglossary)?

The HEAD is just the name of the file. The store is git inspired, but does not have a notion of _trees_, which implies that every file has its own history and there is no connection between the histories of different files except for the time stamp. Alternatively, you can pick a specific hash and link to that. Nobody can modify that.
