Skip to content

Commit 84af7bd

Browse files
realmarcinclaude
andauthored
Shorten w3id prefix, stage redirect, dogfood #30 on SPRUCE (#79)
* Shorten w3id prefix, stage redirect, and dogfood #30 on SPRUCE Closes #12 by staging the upstream w3id.org redirect for https://w3id.org/communitymech/ (apply by copying w3id/communitymech/ into a fork of perma-id/w3id.org). The LinkML schema prefix is shortened from /culturebot-ai/communitymech/ to /communitymech/ so the registered redirect resolves CommunityMech CURIEs, and the generated datamodel and SPARQL examples are updated to match. Also adds the first dogfood use of #30's cross-repo linking schema: SPRUCE peatland community now declares humic-substance electron acceptors and acetate as related_ingredients, anchored to existing PMID:40715043 evidence. No MediaIngredientMech IDs minted yet; this exercises the schema using preferred_term + CHEBI + evidence only, which is the dogfood pattern recommended in cross_repo_linking.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Format regenerated datamodel with black Addresses Copilot review feedback on #79: the regenerated LinkML datamodel didn't match the repo's black formatting (line length 100, default string normalization), so `just lint`'s `black --check` would flag it. Running `just format` reformats only this file; the rest of src/ and tests/ is untouched and `black --check src/ tests/` now reports all 46 files clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 07443cb commit 84af7bd

6 files changed

Lines changed: 120 additions & 9 deletions

File tree

docs/cross_repo_linking.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ related_media:
187187
### SPARQL: Find Media for Peatland Communities
188188
189189
```sparql
190-
PREFIX cm: <https://w3id.org/culturebot-ai/communitymech/>
190+
PREFIX cm: <https://w3id.org/communitymech/>
191191

192192
SELECT ?community_name ?media_name ?culturemech_id ?relationship
193193
WHERE {
@@ -203,7 +203,7 @@ WHERE {
203203
### SPARQL: Find Ingredients for an Environment
204204

205205
```sparql
206-
PREFIX cm: <https://w3id.org/culturebot-ai/communitymech/>
206+
PREFIX cm: <https://w3id.org/communitymech/>
207207
208208
SELECT ?community_name ?ingredient ?mim_id ?relevance
209209
WHERE {
@@ -219,7 +219,7 @@ WHERE {
219219
### SPARQL: Full Cross-Repo Join via Shared ENVO Terms
220220

221221
```sparql
222-
PREFIX cm: <https://w3id.org/culturebot-ai/communitymech/>
222+
PREFIX cm: <https://w3id.org/communitymech/>
223223
PREFIX cult: <https://w3id.org/culturebot-ai/culturemech/>
224224
PREFIX mim: <https://w3id.org/culturebot-ai/mediaingredientmech/>
225225
@@ -240,7 +240,7 @@ WHERE {
240240
### SPARQL: Reverse Lookup -- Communities for a CultureMech Medium
241241

242242
```sparql
243-
PREFIX cm: <https://w3id.org/culturebot-ai/communitymech/>
243+
PREFIX cm: <https://w3id.org/communitymech/>
244244
245245
SELECT ?community_name ?environment ?relationship
246246
WHERE {

kb/communities/SPRUCE_Peatland_Methane_Cycling_Community.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,40 @@ environmental_factors:
168168
to the peatland's CH4/CO2 carbon-chemistry gradient and depth/water structure -
169169
reinforcing peat chemistry (alongside the existing pH/TOC quantification) as a
170170
principal driver of community composition.
171+
related_ingredients:
172+
- preferred_term: humic substances
173+
chebi_term:
174+
id: CHEBI:34818
175+
label: humic acid
176+
relevance: Peat soil organic matter serves as an electron-acceptor pool that
177+
sustains anaerobic respiration alongside methanogenesis at SPRUCE; humic
178+
substances are the dominant electron-accepting fraction of that pool.
179+
evidence:
180+
- reference: PMID:40715043
181+
supports: SUPPORT
182+
evidence_source: COMPUTATIONAL
183+
snippet: acquire electron acceptors from soil organic matter
184+
explanation: The paper's headline claim links the SPRUCE peat microbial
185+
community to soil-organic-matter electron acceptors, the humic-substance
186+
fraction of which would anchor any environment-analog medium for this
187+
community.
188+
- preferred_term: acetate
189+
chebi_term:
190+
id: CHEBI:30089
191+
label: acetate
192+
relevance: Acetate accumulates in deep peat from acetogenic Wood-Ljungdahl
193+
activity and is the dominant substrate for acetoclastic methanogenesis at
194+
the bog surface, so any cultivation medium designed around SPRUCE
195+
methanogens would need acetate as a primary carbon and energy source.
196+
evidence:
197+
- reference: PMID:40715043
198+
supports: SUPPORT
199+
evidence_source: COMPUTATIONAL
200+
snippet: the genomic potential for acetogenesis via the Wood-Ljungdahl pathway
201+
continues to increase, resulting in the highest concentrations of acetate
202+
in the deep peat
203+
explanation: Anchors acetate as the dominant environmentally relevant
204+
organic acid in SPRUCE peat porewater.
171205
associated_datasets:
172206
- name: SPRUCE peat metagenomes
173207
dataset_type: METAGENOME

src/communitymech/datamodel/communitymech.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Auto generated from communitymech.yaml by pythongen.py version: 0.0.1
2-
# Generation date: 2026-05-16T01:52:45
2+
# Generation date: 2026-05-23T01:23:35
33
# Schema: communitymech
44
#
5-
# id: https://w3id.org/culturebot-ai/communitymech
5+
# id: https://w3id.org/communitymech
66
# description: Schema for modeling microbial community structure, function, and ecological interactions
77
# license: BSD-3-Clause
88

@@ -36,7 +36,7 @@
3636
NCBITAXON = CurieNamespace("NCBITaxon", "http://purl.obolibrary.org/obo/NCBITaxon_")
3737
PMID = CurieNamespace("PMID", "http://www.ncbi.nlm.nih.gov/pubmed/")
3838
UBERON = CurieNamespace("UBERON", "http://purl.obolibrary.org/obo/UBERON_")
39-
COMMUNITYMECH = CurieNamespace("communitymech", "https://w3id.org/culturebot-ai/communitymech/")
39+
COMMUNITYMECH = CurieNamespace("communitymech", "https://w3id.org/communitymech/")
4040
DOI = CurieNamespace("doi", "https://doi.org/")
4141
LINKML = CurieNamespace("linkml", "https://w3id.org/linkml/")
4242
XSD = CurieNamespace("xsd", "http://www.w3.org/2001/XMLSchema#")

src/communitymech/schema/communitymech.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
id: https://w3id.org/culturebot-ai/communitymech
1+
id: https://w3id.org/communitymech
22
name: communitymech
33
title: Microbial Community Mechanisms Knowledge Base Schema
44
description: Schema for modeling microbial community structure, function, and ecological interactions
@@ -11,7 +11,7 @@ imports:
1111

1212
prefixes:
1313
linkml: https://w3id.org/linkml/
14-
communitymech: https://w3id.org/culturebot-ai/communitymech/
14+
communitymech: https://w3id.org/communitymech/
1515
NCBITaxon: http://purl.obolibrary.org/obo/NCBITaxon_
1616
ENVO: http://purl.obolibrary.org/obo/ENVO_
1717
CHEBI: http://purl.obolibrary.org/obo/CHEBI_

w3id/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# w3id.org redirect for CommunityMech
2+
3+
This directory stages the upstream pull request to
4+
[perma-id/w3id.org](https://github.com/perma-id/w3id.org) that registers
5+
`https://w3id.org/communitymech/` as a permanent identifier prefix for
6+
CommunityMech CURIEs.
7+
8+
## Files
9+
10+
- `communitymech/.htaccess` — redirect rules. Copy verbatim to
11+
`communitymech/.htaccess` in a fork of `perma-id/w3id.org` and open a PR.
12+
13+
## Resolution targets
14+
15+
| URL | Target |
16+
|--------------------------------------------------------------|-------------------------------------------------------------------------------------------|
17+
| `https://w3id.org/communitymech/` | `https://culturebotai.github.io/CommunityMech/` |
18+
| `https://w3id.org/communitymech/<Name>` | `https://culturebotai.github.io/CommunityMech/communities/<Name>.html` |
19+
| `https://w3id.org/communitymech/<Name>.html` | same as above |
20+
| `https://w3id.org/communitymech/<Name>.yaml` | `https://raw.githubusercontent.com/CultureBotAI/CommunityMech/main/kb/communities/<Name>.yaml` |
21+
| `https://w3id.org/communitymech/schema/communitymech.yaml` | `https://raw.githubusercontent.com/CultureBotAI/CommunityMech/main/src/communitymech/schema/communitymech.yaml` |
22+
23+
`<Name>` is the community filename slug (e.g., `EcoFAB_Ring_Trial_SynCom17`)
24+
that matches `kb/communities/<Name>.yaml`. CommunityMech also assigns each
25+
record a numeric identifier (`CommunityMech:NNNNNN`) which is recorded in
26+
the YAML body but not used as the URL path component.
27+
28+
## Schema prefix update
29+
30+
The LinkML schema's `communitymech` prefix was shortened from
31+
`https://w3id.org/culturebot-ai/communitymech/` to
32+
`https://w3id.org/communitymech/` in the same change that added this
33+
directory, so that the registered redirect matches the schema.
34+
35+
## Submission
36+
37+
1. Fork `perma-id/w3id.org`.
38+
2. Copy `communitymech/` from this directory into the fork root.
39+
3. Open a PR following the contribution guidelines in that repo
40+
(`CONTRIBUTING.md`). Use this directory's README as PR context.
41+
42+
Issue: [CultureBotAI/CommunityMech#12](https://github.com/CultureBotAI/CommunityMech/issues/12)

w3id/communitymech/.htaccess

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Redirect rules for https://w3id.org/communitymech/
2+
#
3+
# Owner: CultureBotAI (https://github.com/CultureBotAI)
4+
# Contact: marcinjoachimiak@gmail.com
5+
# Source repo: https://github.com/CultureBotAI/CommunityMech
6+
#
7+
# Pattern summary:
8+
# / -> CommunityMech docs landing page
9+
# /<Name> -> Per-community HTML page on github.io
10+
# /<Name>.html -> Same as /<Name>, idempotent
11+
# /<Name>.yaml -> Source YAML on GitHub raw
12+
# /schema/communitymech.yaml -> LinkML schema source
13+
#
14+
# CommunityMech identifiers in the LinkML schema use the CURIE form
15+
# `CommunityMech:NNNNNN` (e.g., CommunityMech:000024). The community
16+
# slug (filename without .yaml) is what resolves here; the numeric ID
17+
# is recorded in the YAML body. See the project's docs for the mapping.
18+
19+
Options +FollowSymLinks
20+
RewriteEngine On
21+
22+
# Schema source
23+
RewriteRule ^schema/communitymech\.yaml$ https://raw.githubusercontent.com/CultureBotAI/CommunityMech/main/src/communitymech/schema/communitymech.yaml [R=302,L]
24+
25+
# Per-community source YAML
26+
RewriteRule ^([A-Za-z0-9_]+)\.yaml$ https://raw.githubusercontent.com/CultureBotAI/CommunityMech/main/kb/communities/$1.yaml [R=302,L]
27+
28+
# Per-community HTML page (canonical)
29+
RewriteRule ^([A-Za-z0-9_]+)\.html$ https://culturebotai.github.io/CommunityMech/communities/$1.html [R=302,L]
30+
31+
# Per-community HTML page (extensionless CURIE local part)
32+
RewriteRule ^([A-Za-z0-9_]+)$ https://culturebotai.github.io/CommunityMech/communities/$1.html [R=302,L]
33+
34+
# Landing page
35+
RewriteRule ^$ https://culturebotai.github.io/CommunityMech/ [R=302,L]

0 commit comments

Comments
 (0)