Skip to content

Commit 9a2ee8a

Browse files
authored
chore(domain): add policy and context (#6)
1 parent 23859be commit 9a2ee8a

24 files changed

+782
-232
lines changed

.github/workflows/validate-schemas.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13+
- name: Domain consistency check
14+
run: ./scripts/check-domains.sh
1315
- name: Setup Node
1416
uses: actions/setup-node@v4
1517
with:

DOMAIN-POLICY.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Domain Policy
2+
3+
This repository defines the LocalLoop protocol assets and example payloads.
4+
5+
## Canonical domains
6+
7+
- Frontend (GitHub Pages): https://local-loop-io.github.io
8+
- Backend API: https://loop-api.urbnia.com
9+
10+
## Protocol namespace
11+
12+
All JSON-LD `@context` and schema `$id` references must live under:
13+
14+
- https://local-loop-io.github.io/projects/loop-protocol
15+
16+
JSON-LD contexts are published here:
17+
18+
- https://local-loop-io.github.io/projects/loop-protocol/contexts/
19+
20+
## Disallowed domains
21+
22+
Do not introduce or reference the following domains in code, docs, or tests:
23+
24+
- loop-protocol.org
25+
- localloop.org
26+
- local-loop.io
27+
- api.local-loop.io
28+
- local-loop.eu
29+
- materialdna.eu
30+
31+
## Enforcement
32+
33+
The CI workflow runs `scripts/check-domains.sh` on every push and PR.

SPECIFICATION.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ DE-MUC-2025-PLASTIC-B847F3
211211

212212
```json
213213
{
214-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v0.1.1",
214+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
215215
"@type": "MaterialDNA",
216216
"schema_version": "0.1.1",
217217
"id": "DE-MUC-2025-PLASTIC-B847F3",
@@ -310,7 +310,7 @@ Each node's LoopCoin configuration:
310310

311311
```json
312312
{
313-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
313+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
314314
"@type": "LoopCoinConfig",
315315
"issuer": "munich.loop",
316316
"currency_code": "LC-MUC",
@@ -329,7 +329,7 @@ Each node's LoopCoin configuration:
329329

330330
```json
331331
{
332-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
332+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
333333
"@type": "LoopCoinTransfer",
334334
"id": "550e8400-e29b-41d4-a716-446655440000",
335335
"from": "user:maria@munich.loop",
@@ -349,7 +349,7 @@ When LoopCoins cross node boundaries:
349349

350350
```json
351351
{
352-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
352+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
353353
"@type": "InterNodeSettlement",
354354
"from_node": "munich.loop",
355355
"to_node": "berlin.loop",
@@ -383,7 +383,7 @@ Community preferences for material categories:
383383

384384
```json
385385
{
386-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
386+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
387387
"@type": "LoopSignalConfig",
388388
"node": "munich.loop",
389389
"signals": {
@@ -417,7 +417,7 @@ Community preferences for material categories:
417417

418418
```json
419419
{
420-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
420+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
421421
"@type": "LoopVote",
422422
"node": "munich.loop",
423423
"vote_id": "2025-05-plastic-increase",
@@ -542,7 +542,7 @@ Content-Type: application/ld+json
542542
Authorization: Bearer {token}
543543
544544
{
545-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
545+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
546546
"@type": "MaterialDNA",
547547
"id": "DE-MUC-2025-PLASTIC-B847F3",
548548
"category": "plastic-pet",
@@ -552,7 +552,7 @@ Authorization: Bearer {token}
552552
553553
Response: 201 Created
554554
{
555-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
555+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
556556
"@type": "MaterialDNA",
557557
"id": "DE-MUC-2025-PLASTIC-B847F3",
558558
"status": "registered",
@@ -567,7 +567,7 @@ GET /api/v1/material/DE-MUC-2025-PLASTIC-B847F3
567567
568568
Response: 200 OK
569569
{
570-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
570+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
571571
"@type": "MaterialDNA",
572572
"id": "DE-MUC-2025-PLASTIC-B847F3",
573573
...
@@ -604,7 +604,7 @@ GET /api/v1/node/info
604604
605605
Response: 200 OK
606606
{
607-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
607+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
608608
"@type": "NodeInfo",
609609
"id": "munich.loop",
610610
"name": "Munich LOOP Node",
@@ -627,7 +627,7 @@ GET /api/v1/signals
627627
628628
Response: 200 OK
629629
{
630-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
630+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
631631
"@type": "LoopSignalConfig",
632632
"node": "munich.loop",
633633
"signals": {
@@ -649,7 +649,7 @@ Content-Type: application/ld+json
649649
Authorization: Bearer {token}
650650
651651
{
652-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
652+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
653653
"@type": "MaterialTransaction",
654654
"id": "TXN-2025-05-27-001",
655655
"material": "DE-MUC-2025-PLASTIC-B847F3",
@@ -664,7 +664,7 @@ Authorization: Bearer {token}
664664
665665
Response: 201 Created
666666
{
667-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
667+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
668668
"@type": "TransactionStatus",
669669
"transaction_id": "TXN-2025-05-27-001",
670670
"status": "pending",
@@ -684,7 +684,7 @@ POST /api/v1/federate/announce
684684
X-Node-Signature: {signature}
685685
686686
{
687-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
687+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
688688
"@type": "MaterialAnnouncement",
689689
"material": "DE-MUC-2025-PLASTIC-B847F3",
690690
"origin": "munich.loop",
@@ -699,7 +699,7 @@ POST /api/v1/federate/offer
699699
X-Node-Signature: {signature}
700700
701701
{
702-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
702+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
703703
"@type": "MaterialOffer",
704704
"material": "DE-MUC-2025-PLASTIC-B847F3",
705705
"from": "berlin.loop",
@@ -745,7 +745,7 @@ Nodes maintain a registry of peers:
745745

746746
```json
747747
{
748-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
748+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
749749
"@type": "NodeRegistry",
750750
"version": "2025-05-27",
751751
"nodes": [
@@ -875,7 +875,7 @@ Test suite MUST cover:
875875
```json
876876
POST munich.loop/api/v1/material
877877
{
878-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
878+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
879879
"@type": "MaterialDNA",
880880
"id": "DE-MUC-2025-FOOD-B847F3",
881881
"category": "organic-food",
@@ -892,7 +892,7 @@ POST munich.loop/api/v1/material
892892

893893
Response:
894894
{
895-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
895+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
896896
"@type": "MaterialDNA",
897897
"id": "DE-MUC-2025-FOOD-B847F3",
898898
"status": "registered"
@@ -904,7 +904,7 @@ Response:
904904
```json
905905
POST vienna.loop/api/v1/federate/announce
906906
{
907-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
907+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
908908
"@type": "MaterialAnnouncement",
909909
"material": "DE-MUC-2025-FOOD-B847F3",
910910
"origin": "munich.loop",
@@ -929,7 +929,7 @@ Total LoopCost: 104 LC
929929
```json
930930
POST munich.loop/api/v1/federate/offer
931931
{
932-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
932+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
933933
"@type": "MaterialOffer",
934934
"material": "DE-MUC-2025-FOOD-B847F3",
935935
"from": "vienna.loop",
@@ -958,7 +958,7 @@ POST munich.loop/api/v1/federate/offer
958958
```json
959959
// Proposal
960960
{
961-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
961+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
962962
"@type": "SignalProposal",
963963
"node": "munich.loop",
964964
"changes": [
@@ -975,7 +975,7 @@ POST munich.loop/api/v1/federate/offer
975975

976976
// Vote result
977977
{
978-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
978+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
979979
"@type": "LoopVote",
980980
"node": "munich.loop",
981981
"vote_id": "2025-06-plastic-increase",
@@ -1050,7 +1050,7 @@ Goal: Submit to standards body (W3C, IETF) after v1.0
10501050
{
10511051
"@context": {
10521052
"@version": 1.1,
1053-
"loop": "https://local-loop-io.github.io/projects/loop-protocol/v1/",
1053+
"loop": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld/",
10541054
"schema": "https://schema.org/",
10551055
"MaterialDNA": "loop:MaterialDNA",
10561056
"LoopCoin": "loop:LoopCoin",

contexts/loop-v0.1.1.jsonld

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"loop": "https://local-loop-io.github.io/projects/loop-protocol/contexts/",
5+
"schema_version": "loop:schema_version",
6+
"node_id": "loop:node_id",
7+
"name": "loop:name",
8+
"endpoint": "loop:endpoint",
9+
"capabilities": "loop:capabilities",
10+
"timestamp": {
11+
"@id": "loop:timestamp",
12+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
13+
},
14+
"MaterialDNA": "loop:MaterialDNA",
15+
"Offer": "loop:Offer",
16+
"Match": "loop:Match",
17+
"Transfer": "loop:Transfer",
18+
"id": "@id",
19+
"category": "loop:category",
20+
"quantity": {
21+
"@id": "loop:quantity",
22+
"@type": "@id"
23+
},
24+
"value": "loop:value",
25+
"unit": "loop:unit",
26+
"origin_city": "loop:origin_city",
27+
"current_city": "loop:current_city",
28+
"available_from": {
29+
"@id": "loop:available_from",
30+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
31+
},
32+
"available_until": {
33+
"@id": "loop:available_until",
34+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
35+
},
36+
"from_city": "loop:from_city",
37+
"to_city": "loop:to_city",
38+
"status": "loop:status",
39+
"matched_at": {
40+
"@id": "loop:matched_at",
41+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
42+
},
43+
"handoff_at": {
44+
"@id": "loop:handoff_at",
45+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
46+
},
47+
"received_at": {
48+
"@id": "loop:received_at",
49+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
50+
}
51+
}
52+
}

examples/01-material-registration.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v0.1.1",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
33
"@type": "MaterialDNA",
44
"schema_version": "0.1.1",
55
"id": "DE-MUC-2025-PLASTIC-B847F3",
@@ -13,13 +13,18 @@
1313
"current_city": "Munich",
1414
"location": {
1515
"lat": 48.1351,
16-
"lon": 11.5820,
16+
"lon": 11.582,
1717
"address": "Recycling Center Munich"
1818
},
1919
"available_from": "2025-05-27T10:00:00Z",
2020
"expires": "2025-06-03T10:00:00Z",
21-
"certifications": ["food-grade", "iso-14001"],
22-
"images": ["https://example.com/material-photo.jpg"],
21+
"certifications": [
22+
"food-grade",
23+
"iso-14001"
24+
],
25+
"images": [
26+
"https://example.com/material-photo.jpg"
27+
],
2328
"contact": {
2429
"name": "Munich Recycling Center",
2530
"email": "materials@munich.loop",

examples/02-loopcoin-transfer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
33
"@type": "LoopCoinTransfer",
44
"id": "550e8400-e29b-41d4-a716-446655440000",
55
"from": "user:maria@munich.loop",

examples/03-signal-voting.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
33
"@type": "LoopVote",
44
"node": "munich.loop",
55
"vote_id": "2025-06-plastic-increase",
66
"proposals": [
77
{
88
"category": "plastic-pet",
9-
"current_value": 0.20,
10-
"proposed_value": 0.30,
9+
"current_value": 0.2,
10+
"proposed_value": 0.3,
1111
"rationale": "Increase local plastic recycling"
1212
}
1313
],

examples/04-cross-city-trade.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/v1",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
33
"@type": "MaterialTransaction",
44
"id": "TXN-2025-05-27-001",
55
"material": "DE-MUC-2025-PLASTIC-B847F3",

0 commit comments

Comments
 (0)