OBOFoundry / purl.obolibrary.org

A system for managing OBO PURLs
BSD 3-Clause "New" or "Revised" License
75 stars 128 forks source link

Simpler YAML configuration #106

Open jamesaoverton opened 8 years ago

jamesaoverton commented 8 years ago

I've created the simpler branch to experiment with a simpler and more consistent YAML configuration format. It addresses most of the complaints I made in https://github.com/OBOFoundry/purl.obolibrary.org/issues/100#issuecomment-159391144, but is really orthogonal to #100.

The old format omitted the base_url (e.g. /obo/obi) from most paths. This was designed to save a little typing and enforce separation of project-level rules from top-level rules. But each project has some top-level rules, and to handle them I had to create products, term_browser, and base_redirect fields, each with different behaviour.

In the new format the base_url is always included. The translate.py script operates in two "modes": project and top. In project mode it only generates Apache directives in the project's space, e.g. under /obo/obi/. In top mode it only generates Apache directives in the top-level /obo/ space (not project space), and restricts them to the given IDSPACE so that only these patterns work:

Full examples: OBI.yml, CHEBI.yml

The upshot is less code with fewer special cases. I've also tweaked the nomenclature for clarity and updated the documentation.

alanruttenberg commented 8 years ago

So do I understand that 'browser: ontobee' will automatically add the /obo//about/ redirect?

I suggest we also add an alias(or maybe use YAML feature if I understand it) and a release directive for a start

e.g. (using OBI as example) Currenty:

- exact: /2009-11-02/obi.owl
  replacement: http://obi.svn.sourceforge.net/svnroot/obi/releases/2009-11-02/merged/merged-obi.owl

- exact: /2009-11-06/obi.owl
  replacement: http://obi.svn.sourceforge.net/svnroot/obi/releases/2009-11-06/merged/merged-obi.owl

Suggested:

- alias: repo=http://obi.svn.sourceforge.net/svnroot/obi/

- releasedate: 2009-11-02
  - releasebase: $(repo)/releases
  - release: obi.owl

- releasedate: 2009-11-06
  - releasebase: $(repo)/releases
  - release: obi.owl
  - release: obi.obo

If I read the YAML 1.2 spec there is something that looks like it could be an alternative to alias.

I think it would be written (not quite the same structure)

releasebase: &releasebase
 -    http://obi.svn.sourceforge.net/svnroot/obi/releases

- releasedate: 2009-11-02
  - *releasebase
  - release: obi.owl

- releasedate: 2009-11-06
  - *releasebase
  - release: obi.owl
  - release: obi.obo

http://www.yaml.org/spec/1.2/spec.html#id2765878 http://www.yaml.org/spec/1.2/spec.html#id2785586 http://www.yaml.org/spec/1.2/spec.html#id2761803

jamesaoverton commented 8 years ago

term_browser: ontobee adds a top-level term rule, e.g. /obo/OBI_(\d+). It does not add an /about/ rule. Half of our ontologies have /about/ rules and half don't. Automatically adding an /about/ rule would interfere with existing partial redirects in many cases.

I created #103 for variables in configuration files. I find YAML anchors/aliases unintuitive. The shell-style makes more sense to me, but I'm not sold on the cost/benefit.

While I'm not opposed to a special rule type for releases, I worry that there's too much variation between project release practises, and even between releases of the same ontology (e.g. OBI), for a simple rule to handle.

alanruttenberg commented 8 years ago

The /about link should be configured. It is the persistent name for the browser page.

We want to encourage common release practices. This one's documented in id policy so is applicable to foundry ontologies at least, but perhaps even stronger.

jamesaoverton commented 8 years ago

I could not find a documented policy for /about/. It's not in the OBO ID Policy. Do you have a link?

cmungall commented 8 years ago

Seems like additional complexity for what should be possible with a normal redirect.

For all the ontologies I work on, we use /obo/$ont/releases/YYYY-MM-DD/$product

Then a single redirect for /obo/$ont/releases goes to the appropriate location (svn branch, github releases, etc)

This was necessitated by the old OCLC system, as we didn't have resources for people to register things all day

(I hadn't thought about yaml aliases before: presumably we isolate these so that they can't infect neighboring yamls?)

On 1 Dec 2015, at 10:08, Alan Ruttenberg wrote:

So do I understand that 'browser: ontobee' will automatically add the /obo//about/ redirect?

I suggest we also add an alias(or maybe use YAML feature if I understand it) and a release directive for a start

e.g. (using OBI as example)

Currently

Suggested:

  • alias: repo=http://obi.svn.sourceforge.net/svnroot/obi/
  • releasedate: 2009-11-02
  • releasebase: $(repo)/releases
  • release: obi.owl
  • releasedate: 2009-11-06
  • releasebase: $(repo)/releases
  • release: obi.owl
  • release: obi.obo

If I read the YAML 1.2 spec there is something that looks like it could be an alternative to alias.

I think it would be written (not quite the same structure)

releasebase: &releasebase


Reply to this email directly or view it on GitHub: https://github.com/OBOFoundry/purl.obolibrary.org/issues/106#issuecomment-161050562

jamesaoverton commented 8 years ago

Jim Balhoff used the products: keyword in a reasonable but incorrect way in this PR: #195. This points to the need for this simpler syntax, and better checking. I plan to make the change when I can make the time.