]> Lady’s Gitweb - Etiquette/commitdiff
Apply some reformatting and make Reuse‐compliant current
authorLady <redacted>
Sat, 13 Sep 2025 16:50:38 +0000 (12:50 -0400)
committerLady <redacted>
Sat, 13 Sep 2025 16:50:38 +0000 (12:50 -0400)
16 files changed:
.gitmodules [new file with mode: 0644]
\99\93ð\9f§© [new submodule]
LICENSES/CC0-1.0.txt [new file with mode: 0644]
LICENSES/MPL-2.0.txt [moved from LICENSE with 100% similarity]
README.markdown
deno.json
deno.json.license [new file with mode: 0644]
deno.lock
deps.js
dev-deps.js
memory.js
memory.test.js
model.js
model.test.js
names.js
schema.js

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..56cc75b
--- /dev/null
@@ -0,0 +1,6 @@
+# SPDX-FileCopyrightText: 2024 Lady <https://www.ladys.computer/about/#lady>
+# SPDX-License-Identifier: CC0-1.0
+
+[submodule "Piscēs"]
+       path = .♓🧩
+       url = https://git.ladys.computer/Pisces.git
diff --git a/.â\99\93ð\9f§© b/.â\99\93ð\9f§©
new file mode 160000 (submodule)
index 0000000..6824f52
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 6824f52e3d692f16442008ebd933a5c1890f2c8c
diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt
new file mode 100644 (file)
index 0000000..0e259d4
--- /dev/null
@@ -0,0 +1,121 @@
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+    HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+  i. the right to reproduce, adapt, distribute, perform, display,
+     communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+     likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+     subject to the limitations in paragraph 4(a), below;
+  v. rights protecting the extraction, dissemination, use and reuse of data
+     in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+     European Parliament and of the Council of 11 March 1996 on the legal
+     protection of databases, and under any national implementation
+     thereof, including any amended or successor version of such
+     directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+     world based on applicable law or treaty, and any national
+     implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+    surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+    warranties of any kind concerning the Work, express, implied,
+    statutory or otherwise, including without limitation warranties of
+    title, merchantability, fitness for a particular purpose, non
+    infringement, or the absence of latent or other defects, accuracy, or
+    the present or absence of errors, whether or not discoverable, all to
+    the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+    that may apply to the Work or any use thereof, including without
+    limitation any person's Copyright and Related Rights in the Work.
+    Further, Affirmer disclaims responsibility for obtaining any necessary
+    consents, permissions or other rights required for any use of the
+    Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+    party to this document and has no duty or obligation with respect to
+    this CC0 or use of the Work.
similarity index 100%
rename from LICENSE
rename to LICENSES/MPL-2.0.txt
index 5cbcb8fafdcbab9d9c7d0769d13999bc64962561..ab5823e4c60b06c0e37331a10ab5af7aa26cfcff 100644 (file)
@@ -1,3 +1,7 @@
+<!--
+SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+SPDX-License-Identifier: CC0-1.0
+-->
 # 📧🏷️ Étiquette
 
 <b>Electronic tag processing.</b>
index d00db959f25bb2efc82a043ed5f2477c99ae9ed4..6a4e010129892469bcb43776aabbfbe70e49e232 100644 (file)
--- a/deno.json
+++ b/deno.json
@@ -1 +1,8 @@
-{ "fmt": { "lineWidth": 71 } }
+{ "fmt":
+  { "exclude": [".*/", "deno.json"]
+  , "lineWidth": 71
+  , "operatorPosition": "nextLine"
+  , "useBraces": "always" }
+, "lint": { "exclude": [".*/"] }
+, "lock": false
+, "test": { "exclude": [".*/"] } }
diff --git a/deno.json.license b/deno.json.license
new file mode 100644 (file)
index 0000000..399e2f2
--- /dev/null
@@ -0,0 +1,2 @@
+SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+SPDX-License-Identifier: CC0-1.0
index 3aecc25627495e165f45695cbe8ed4bc92b22337..ba9796ea5a5fc9f52a4eea5aa13c5ca2281a050a 100644 (file)
--- a/deno.lock
+++ b/deno.lock
@@ -8,12 +8,5 @@
     "https://deno.land/std@0.189.0/testing/asserts.ts": "e16d98b4d73ffc4ed498d717307a12500ae4f2cbe668f1a215632d19fcffc22f",
     "https://deno.land/std@0.189.0/testing/bdd.ts": "59f7f7503066d66a12e50ace81bfffae5b735b6be1208f5684b630ae6b4de1d0",
     "https://deno.land/std@0.189.0/testing/mock.ts": "220ed9b8151cb2cac141043d4cfea7c47673fab5d18d1c1f0943297c8afb5d13",
-    "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/binary.js": "b8691c74168fc7bc9e0c056df76a08ca5e3ffcd78b03d8e9c318e1bc78cf580b",
-    "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/collection.js": "4dfb83bbd082bef873c2ae8904a2ba3204379065b0244e8c5a737b7666888fdc",
-    "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/function.js": "d45970c39106ee652cf681ccf98dc7fa86fcd9578a86d2b65c49bf9fffd7f158",
-    "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/numeric.js": "cb6d0c224b36aec086cbf895c9a6aa593a0fbfdaccc346b0c5be1d1a0bfc1775",
-    "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/object.js": "932e9fa5b07db7b32815c7a7b21b63ef8a92b7de8fdc8bbde0e4ee70baf0b522",
-    "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/string.js": "38697c9a325937254d7de12633890b5848862ea6e7cd51bc08713b0fca86ac21",
-    "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/value.js": "d1e0bac8e3fc6403b67f0b2b979946a257935aa5c18bf1fbf5768a59e61bf59b"
   }
 }
diff --git a/deps.js b/deps.js
index 657026d12aae2410aff8d32576e04831fb90bbca..a64b6706b8655257438a189b93fde7ea51d4d0b5 100644 (file)
--- a/deps.js
+++ b/deps.js
@@ -1,14 +1,17 @@
-// 📧🏷️ Étiquette ∷ deps.js
-// ====================================================================
-//
-// Copyright © 2023 Lady [@ Lady’s Computer].
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+// SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+// SPDX-License-Identifier: MPL-2.0
+/**
+ * ⁌ 📧🏷️ Étiquette ∷ deps.js
+ *
+ * Copyright © 2023, 2025 Lady [@ Ladys Computer].
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+ */
 
 export {
+  identity,
   wrmgBase32Binary,
   wrmgBase32String,
-} from "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/binary.js";
-export { identity } from "https://git.ladys.computer/Pisces/blob_plain/0.3.1:/function.js";
+} from "./.♓🧩/mod.js";
index 4710b493edb5370e8bc259c9ec683d6d0169956a..1abccd3a2d98c90de77cfbc850ba3b8479aacbf5 100644 (file)
@@ -1,11 +1,14 @@
-// 📧🏷️ Étiquette ∷ dev-deps.js
-// ====================================================================
-//
-// Copyright © 2023 Lady [@ Lady’s Computer].
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+// SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+// SPDX-License-Identifier: MPL-2.0
+/**
+ * ⁌ 📧🏷️ Étiquette ∷ dev-deps.js
+ *
+ * Copyright © 2023, 2025 Lady [@ Ladys Computer].
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+ */
 
 export {
   assert,
index 252418b3f85e4e5c2493b8263399e0acb900267f..f4a861b1249ca82ad2e8bf5c82c3c9ad27ad31c0 100644 (file)
--- a/memory.js
+++ b/memory.js
@@ -1,14 +1,19 @@
-// 📧🏷️ Étiquette ∷ memory.js
-// ====================================================================
-//
-// Copyright © 2023 Lady [@ Lady’s Computer].
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+// SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+// SPDX-License-Identifier: MPL-2.0
+/**
+ * ⁌ 📧🏷️ Étiquette ∷ memory.js
+ *
+ * Copyright © 2023, 2025 Lady [@ Ladys Computer].
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+ */
 
 import { wrmgBase32Binary, wrmgBase32String } from "./deps.js";
 
+const ÉTIQUETTE = "📧🏷️ Étiquette";
+
 /**
  * A symbol which is used internally to identify the constructor
  * associated with a stored object.
@@ -23,7 +28,7 @@ const constructorSymbol = Symbol("constructor");
  * If an argument is provided, it is used as the underlying numeric
  * value for the identifier.
  *
- * The return value is a `String` *object* with a `.value` own property
+ * The return value is a `String´ ⹐object⹑ with a `.value´ own property
  * giving the underlying numeric value for the string.
  *
  * ※ This function is not exposed.
@@ -83,7 +88,7 @@ const normalizeID = ($) => {
     if (byteLength != 4) {
       // ☡ The identifier was of unexpected size.
       throw new RangeError(
-        `Expected id to fit within 4 bytes, but got ${byteLength}.`,
+        `${ÉTIQUETTE}: Expected id to fit within 4 bytes, but got ${byteLength}.`,
       );
     } else {
       // The identifier was correctly‐sized.
@@ -94,14 +99,16 @@ const normalizeID = ($) => {
         //
         // ※ This should be impossible and indicates something went
         // very wrong in base32 decoding.
-        throw new RangeError("Unexpected values in lower two bits");
+        throw new RangeError(
+          `${ÉTIQUETTE}: Unexpected values in lower two bits`,
+        );
       } else {
         // The final two bits are zero as expected.
         const number = value >>> 2;
         if (checksum != number % 37) {
           // ☡ The checksum does not match the number.
           throw new RangeError(
-            `Invalid checksum for id: ${identifier} (${number})`,
+            `${ÉTIQUETTE}: Invalid checksum for id: ${identifier} (${number})`,
           );
         } else {
           // The checksum matches. Mint a new identifier with the same
@@ -117,7 +124,7 @@ const normalizeID = ($) => {
  * A symbol which is used to identify the method for constructing a new
  * instance of a constructor based on stored data.
  *
- * ※ This value is exposed as `Storage.toInstance`.
+ * ※ This value is exposed as `Storage.toInstance´.
  */
 const toInstanceSymbol = Symbol("Storage.toInstance");
 
@@ -126,7 +133,7 @@ const toInstanceSymbol = Symbol("Storage.toInstance");
  * instance into an object of enumerable own properties suitable for
  * persistence.
  *
- * ※ This value is exposed as `Storage.toObject`.
+ * ※ This value is exposed as `Storage.toObject´.
  */
 const toObjectSymbol = Symbol("Storage.toObject");
 
@@ -136,7 +143,7 @@ const toObjectSymbol = Symbol("Storage.toObject");
  */
 export class Storage {
   static {
-    // Define `Storage.toInstance` and `Storage.toObject` as
+    // Define `Storage.toInstance´ and `Storage.toObject´ as
     // nonconfigurable, non·enumerable, read·only properties with the
     // appropriate values.
     Object.defineProperties(this, {
@@ -156,15 +163,15 @@ export class Storage {
   }
 
   /**
-   * A `Set` of deleted identifiers, to ensure they are not
+   * A `Set´ of deleted identifiers, to ensure they are not
    * re·assigned.
    *
-   * The identifier `000-0000` is deleted from the start and can only
+   * The identifier `000-0000´ is deleted from the start and can only
    * be manually set.
    */
   #deleted = new Set([`${mintID(0)}`]);
 
-  /** The `Map` used to actually store the data internally. */
+  /** The `Map´ used to actually store the data internally. */
   #store = new Map();
 
   /**
@@ -180,7 +187,7 @@ export class Storage {
       // ☡ There is no method on the constructor for generating an
       // instance.
       throw new TypeError(
-        "Constructor must implement Storage.toInstance for object to be retrieved.",
+        `${ÉTIQUETTE}: Constructor must implement Storage.toInstance for object to be retrieved.`,
       );
     } else {
       // Generate an instance and return it.
@@ -204,7 +211,7 @@ export class Storage {
       // The provided value does not have a method for generating an
       // object to store.
       throw new TypeError(
-        "Object must implement Storage.toObject to be stored.",
+        `${ÉTIQUETTE}: Object must implement Storage.toObject to be stored.`,
       );
     } else {
       // The provided value has a method for generating a storage
@@ -289,9 +296,9 @@ export class Storage {
    * constructed from data in storage.
    *
    * The callback function will be called with the constructed
-   * instance, its identifier, and this `Storage` instance.
+   * instance, its identifier, and this `Storage´ instance.
    *
-   * If a second argument is provided, it will be used as the `this`
+   * If a second argument is provided, it will be used as the `this´
    * value.
    */
   forEach(callback, thisArg = undefined) {
@@ -304,7 +311,7 @@ export class Storage {
 
   /**
    * Returns an instance constructed from the data stored at the
-   * provided identifier, or `null` if the identifier has no data.
+   * provided identifier, or `null´ if the identifier has no data.
    */
   get(id) {
     const store = this.#store;
@@ -336,7 +343,7 @@ export class Storage {
 
   /**
    * Sets the data for the provided identifier to be that generated
-   * from the provided instance, then returns this `Storage` object.
+   * from the provided instance, then returns this `Storage´ object.
    */
   set(id, instance) {
     this.#persist(instance, normalizeID(id));
@@ -347,7 +354,7 @@ export class Storage {
    * Returns the number of identifiers with data in storage.
    *
    * ☡ This number may be smaller than the actual number of used
-   * identifiers, as deleted identifiers are *not* freed up for re·use.
+   * identifiers, as deleted identifiers are ⹐not⹑ freed up for re·use.
    */
   get size() {
     return this.#store.size;
index b9217a6872ca81d5d7775edc6736ae9b8b5b6179..397a4c4db6e985b5f16b278b48530bae5fde079b 100644 (file)
@@ -1,11 +1,14 @@
-// 📧🏷️ Étiquette ∷ memory.test.js
-// ====================================================================
-//
-// Copyright © 2023 Lady [@ Lady’s Computer].
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+// SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+// SPDX-License-Identifier: MPL-2.0
+/**
+ * ⁌ 📧🏷️ Étiquette ∷ memory.test.js
+ *
+ * Copyright © 2023, 2025 Lady [@ Ladys Computer].
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+ */
 
 import {
   assert,
index 7e0fefc9e5836bcd5b3080708111dd10894b45b4..d2990ebbd47f2e6efb84d0c708e2f7b37f0b6211 100644 (file)
--- a/model.js
+++ b/model.js
@@ -1,67 +1,72 @@
-// 📧🏷️ Étiquette ∷ model.js
-// ====================================================================
-//
-// Copyright © 2023 Lady [@ Lady’s Computer].
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+// SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+// SPDX-License-Identifier: MPL-2.0
+/**
+ * ⁌ 📧🏷️ Étiquette ∷ model.js
+ *
+ * Copyright © 2023, 2025 Lady [@ Ladys Computer].
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+ */
 
 import { identity } from "./deps.js";
 import { Storage } from "./memory.js";
 import { taggingDiscoveryContext } from "./names.js";
 import schema from "./schema.js";
 
+const ÉTIQUETTE = "📧🏷️ Étiquette";
+
 /**
  * A tag.
  *
- * `Tag`s are not assigned identifiers and do not have side·effects on
- * other tags in the `TagSystem` until they are persisted with
- * `::persist`, at which point changes to their relationships are
+ * `Tag´s are not assigned identifiers and do not have side·effects on
+ * other tags in the `TagSystem´ until they are persisted with
+ * `::persist´, at which point changes to their relationships are
  * applied.
  *
- * `Tag`s are also not kept up‐to‐date, but persisting an outdated
- * `Tag` will *not* undo subsequent changes.
+ * `Tag´s are also not kept up‐to‐date, but persisting an outdated
+ * `Tag´ will ⹐not⹑ undo subsequent changes.
  *
  * ※ This class is not itself directly exposed, although bound
- * versions of it are via `TagSystem::Tag`.
+ * versions of it are via `TagSystem::Tag´.
  */
 class Tag {
-  /** The `TagSystem` this `Tag` belongs to. */
+  /** The `TagSystem´ this `Tag´ belongs to. */
   #system;
 
-  /** The `Storage` managed by this `Tag`’s `TagSystem`. */
+  /** The `Storage´ managed by this `Tag´s `TagSystem´. */
   #storage;
 
-  /** The schema in use for this `Tag`. */
+  /** The schema in use for this `Tag´. */
   #schema;
 
   /**
    * The 30‐bit W·R·M·G base32 identifier with leading checksum which
-   * has been assigned to this `Tag`.
+   * has been assigned to this `Tag´.
    *
-   * Will be `null` if this `Tag` has not been persisted. Otherwise,
-   * the format is `cxx-xxxx` (`c` = checksum; `x` = digit).
+   * Will be `null´ if this `Tag´ has not been persisted. Otherwise,
+   * the format is `cxx-xxxx´ (`c´ = checksum; `x´ = digit).
    */
   #identifier = null;
 
-  /** The kind of this `Tag`. */
+  /** The kind of this `Tag´. */
   #kind = "Tag";
 
   /**
-   * The data which was attached to this `Tag` the last time it was
+   * The data which was attached to this `Tag´ the last time it was
    * persisted or retrieved from storage.
    *
    * Diffing with this will reveal changes.
    */
   #persistedData = null;
 
-  /** The current (modified) data associated with this `Tag`. */
+  /** The current (modified) data associated with this `Tag´. */
   #data = tagData();
 
   /**
-   * Adds the provided label(s) to this `Tag` as the provided
-   * predicate, then returns this `Tag`.
+   * Adds the provided label(s) to this `Tag´ as the provided
+   * predicate, then returns this `Tag´.
    */
   #addLabel(predicate, ...labels) {
     const values = this.#data[predicate];
@@ -74,11 +79,11 @@ class Tag {
   }
 
   /**
-   * Adds the provided tags to the list of tags that this `Tag` is
-   * related to by the provided predicate, then returns this `Tag`.
+   * Adds the provided tags to the list of tags that this `Tag´ is
+   * related to by the provided predicate, then returns this `Tag´.
    *
    * Arguments may be string identifiers or objects with an
-   * `.identifier` property.
+   * `.identifier´ property.
    */
   #addTag(predicate, ...tags) {
     const storage = this.#storage;
@@ -89,26 +94,26 @@ class Tag {
       if (identifier == null) {
         // ☡ The current tag has no identifier.
         throw new TypeError(
-          `Cannot state ${predicate} of Tag: Identifier must not be nullish.`,
+          `${ÉTIQUETTE}: Cannot state ${predicate} of Tag: Identifier must not be nullish.`,
         );
       } else if (values.has(identifier)) {
         // Short‐circuit: The identifier has already been stated with
         // this predicate.
         /* do nothing */
       } else {
-        // The current tag has an identifier, but it hasnt been stated
+        // The current tag has an identifier, but it hasn¦t been stated
         // with this predicate yet.
         const tag = storage.get(identifier);
         if (tag == null) {
-          // ☡ The current tag has not been persisted to this `Tag`’s
+          // ☡ The current tag has not been persisted to this `Tag´s
           // storage.
           throw new RangeError(
-            `Cannot state ${predicate} of Tag: Identifier is not persisted: ${identifier}.`,
+            `${ÉTIQUETTE}: Cannot state ${predicate} of Tag: Identifier is not persisted: ${identifier}.`,
           );
         } else if (!this.#isTagInStorage(tag)) {
           // ☡ The current tag is not a tag in the correct tag system.
           throw new TypeError(
-            `Cannot state ${predicate} of Tag: Tags must be from the same Tag System, but got: ${identifier}.`,
+            `${ÉTIQUETTE}: Cannot state ${predicate} of Tag: Tags must be from the same Tag System, but got: ${identifier}.`,
           );
         } else if (
           !isObjectPredicateOK(
@@ -121,7 +126,7 @@ class Tag {
           // ☡ This tag and the current tag form an invalid pair for
           // this predicate.
           throw new TypeError(
-            `Cannot state ${predicate} of Tag: Not valid for domain and range: ${this.#kind}, ${tag.#kind}.`,
+            `${ÉTIQUETTE}: Cannot state ${predicate} of Tag: Not valid for domain and range: ${this.#kind}, ${tag.#kind}.`,
           );
         } else {
           // The current tag is a tag in the correct tag system; add
@@ -134,8 +139,8 @@ class Tag {
   }
 
   /**
-   * Removes the provided string label(s) from this `Tag` as the
-   * provided predicate, then returns this `Tag`.
+   * Removes the provided string label(s) from this `Tag´ as the
+   * provided predicate, then returns this `Tag´.
    */
   #deleteLabel(predicate, ...labels) {
     const values = this.#data[predicate];
@@ -148,11 +153,11 @@ class Tag {
   }
 
   /**
-   * Removes the provided tags from the list of tags that this `Tag` is
-   * related to by the provided predicate, then returns this `Tag`.
+   * Removes the provided tags from the list of tags that this `Tag´ is
+   * related to by the provided predicate, then returns this `Tag´.
    *
    * Arguments may be string identifiers or objects with an
-   * `.identifier` property.
+   * `.identifier´ property.
    */
   #deleteTag(predicate, ...tags) {
     const values = this.#data[predicate];
@@ -167,11 +172,11 @@ class Tag {
    * Returns whether or not the provided value is a tag which shares a
    * storage with this tag.
    *
-   * Sharing a storage also implies sharing a `TagSystem`.
+   * Sharing a storage also implies sharing a `TagSystem´.
    */
   #isTagInStorage($) {
     try {
-      // Try to compare the provided values internal store with
+      // Try to compare the provided values internal store with
       // the provided storage.
       return $.#storage == this.#storage;
     } catch {
@@ -181,7 +186,7 @@ class Tag {
   }
 
   /**
-   * Yields the labels of this `Tag` according to the provided
+   * Yields the labels of this `Tag´ according to the provided
    * predicate.
    */
   *#yieldLabels(predicate) {
@@ -189,7 +194,7 @@ class Tag {
   }
 
   /**
-   * Yields the tags that this `Tag` is related to by the provided
+   * Yields the tags that this `Tag´ is related to by the provided
    * predicate.
    */
   *#yieldTags(predicate) {
@@ -217,7 +222,7 @@ class Tag {
   }
 
   /**
-   * Yields the tags that this `Tag` is related to by the provided
+   * Yields the tags that this `Tag´ is related to by the provided
    * predicate, figured transitively.
    */
   *#yieldTransitiveTags(transitivePredicate, basePredicate) {
@@ -269,11 +274,11 @@ class Tag {
   }
 
   /**
-   * Constructs a new `Tag` of the provided kind and with the provided
+   * Constructs a new `Tag´ of the provided kind and with the provided
    * preferred label.
    *
    * ※ The first two arguments of this constructor are bound when
-   * generating the value of `TagSystem::Tag`. It isn’t possible to
+   * generating the value of `TagSystem::Tag´. It isn¦t possible to
    * access this constructor in its unbound form from outside this
    * module.
    *
@@ -287,7 +292,7 @@ class Tag {
     if (!(kindString in schema.classes)) {
       // The provided kind is not supported.
       throw new RangeError(
-        `Cannot construct Tag: Unrecognized kind: ${kind}.`,
+        `${ÉTIQUETTE}: Cannot construct Tag: Unrecognized kind: ${kind}.`,
       );
     } else {
       // The provided kind is one of the recognized tag kinds.
@@ -297,7 +302,7 @@ class Tag {
   }
 
   /**
-   * Returns a new `Tag` constructor for the provided system, storage,
+   * Returns a new `Tag´ constructor for the provided system, storage,
    * schema, created with an appropriate prototype for the properties
    * so defined.
    *
@@ -348,8 +353,8 @@ class Tag {
                     // The current key does not indicate an inverse
                     // property, so add and delete methods are also
                     // added.
-                    const cased = key[0].toUpperCase() +
-                      key.substring(1);
+                    const cased = key[0].toUpperCase()
+                      key.substring(1);
                     yield [`add${cased}Tag`, function (...tags) {
                       return this.#addTag(key, ...tags);
                     }];
@@ -362,8 +367,8 @@ class Tag {
                     /* do nothing */
                   }
                   if (
-                    subPropertyOf != null &&
-                    subPropertyOf in transitiveProperties
+                    subPropertyOf != null
+                    && subPropertyOf in transitiveProperties
                   ) {
                     // The current key indicates a subproperty of a
                     // transitive property; its method is also added.
@@ -384,9 +389,9 @@ class Tag {
                 // Iterate over each data property and yield any
                 // necessary method definitions.
                 if (key != "prefLabel") {
-                  // The current key is not `"prefLabel"`.
-                  const cased = key[0].toUpperCase() +
-                    key.substring(1);
+                  // The current key is not `"prefLabel"´.
+                  const cased = key[0].toUpperCase()
+                    key.substring(1);
                   yield [`${key}s`, function* () {
                     yield* this.#yieldLabels(key);
                   }];
@@ -397,7 +402,7 @@ class Tag {
                     return this.#deleteLabel(key, ...labels);
                   }];
                 } else {
-                  // The current key is `"prefLabel"`. This is a
+                  // The current key is `"prefLabel"´. This is a
                   // special case which is not handled by the schema.
                   /* do nothing */
                 }
@@ -422,7 +427,7 @@ class Tag {
   /**
    * Assigns the provided data and identifier to the provided tag.
    *
-   * ☡ This function throws if the provided tag is not a `Tag`.
+   * ☡ This function throws if the provided tag is not a `Tag´.
    *
    * ※ This function is not exposed.
    */
@@ -434,12 +439,38 @@ class Tag {
   }
 
   /**
-   * Returns the `TagSystem` that the provided value belongs to.
+   * Returns a new `Tag´ with the provided identifier, kind, and
+   * prefLabel.
+   *
+   * ※ This function exists to enable `TagSystem´s to replay Create
+   * activities, maintaining the identifier of the original.
+   *
+   * ☡ This function throws if the provided identifier is already in
+   * use.
+   *
+   * ※ This function is not exposed.
+   */
+  static new(system, identifier, kind = "Tag", prefLabel = "") {
+    const storage = (new system.Tag()).#storage;
+    if (storage.has(identifier)) {
+      throw new RangeError(
+        `${ÉTIQUETTE}: Cannot create Tag: Identifier already in use: ${identifier}.`,
+      );
+    } else {
+      const createdTag = new system.Tag(kind, prefLabel);
+      createdTag.#identifier = identifier;
+      createdTag.persist(true);
+      return createdTag;
+    }
+  }
+
+  /**
+   * Returns the `TagSystem´ that the provided value belongs to.
    *
    * ※ This function can be used to check if the provided value has
    * private tag features.
    *
-   * ※ `Tag::system` is an overridable, publicly‐accessible means of
+   * ※ `Tag::system´ is an overridable, publicly‐accessible means of
    * accessing the system.
    *
    * ※ This function is not exposed.
@@ -449,16 +480,16 @@ class Tag {
   }
 
   static {
-    // Overwrite the default `::constructor` method to instead give the
+    // Overwrite the default `::constructor´ method to instead give the
     // actual (bound) constructor which was used to generate a given
-    // `Tag`.
+    // `Tag´.
     Object.defineProperties(this.prototype, {
       constructor: {
         configurable: true,
         enumerable: false,
         get() {
-          // All `Tag`s are constructed via the `.Tag` constructor
-          // available in their `TagSystem`; return it.
+          // All `Tag´s are constructed via the `.Tag´ constructor
+          // available in their `TagSystem´; return it.
           return this.#system.Tag;
         },
         set: undefined,
@@ -466,47 +497,47 @@ class Tag {
     });
   }
 
-  /** Returns the authority (domain) name for this `Tag`. */
+  /** Returns the authority (domain) name for this `Tag´. */
   get authorityName() {
     return this.#system.authorityName;
   }
 
-  /** Returns the identifier of this `Tag`. */
+  /** Returns the identifier of this `Tag´. */
   get identifier() {
     return this.#identifier;
   }
 
-  /** Returns the I·R·I for this `Tag`. */
+  /** Returns the I·R·I for this `Tag´. */
   get iri() {
     const { identifier, iriSpace } = this;
     return identifier == null ? null : `${iriSpace}${identifier}`;
   }
 
-  /** Returns the I·R·I space for this `Tag`. */
+  /** Returns the I·R·I space for this `Tag´. */
   get iriSpace() {
     return this.#system.iriSpace;
   }
 
-  /** Returns the kind of this `Tag`. */
+  /** Returns the kind of this `Tag´. */
   get kind() {
     return this.#kind;
   }
 
   /**
-   * Returns the `TagSystem` for this `Tag`.
+   * Returns the `TagSystem´ for this `Tag´.
    *
-   * ※ Internally, `Tag.getSystem` is preferred.
+   * ※ Internally, `Tag.getSystem´ is preferred.
    */
   get system() {
     return this.#system;
   }
 
   /**
-   * Persist this `Tag` to storage and return an ActivityStreams
+   * Persist this `Tag´ to storage and return an ActivityStreams
    * serialization of a Tag Activity representing any changes, or
-   * `null` if no changes were made.
+   * `null´ if no changes were made.
    *
-   * If the second argument is `true`, the `Tag` will be persisted but
+   * If the second argument is `true´, the `Tag´ will be persisted but
    * no serialization will be made. This is somewhat more efficient.
    *
    * ※ Persistence can imply side‐effects on other objects, which are
@@ -532,8 +563,8 @@ class Tag {
       // Iterate over each entry of the tag data and create a diff
       // with the last persisted information.
       if (
-        objectProperties[key]?.inverseOf != null ||
-        silent && key in dataProperties
+        objectProperties[key]?.inverseOf != null
+        || silent && key in dataProperties
       ) {
         // The current property is one which is skipped in diffs.
         //
@@ -570,8 +601,8 @@ class Tag {
           }
           diffs[key] = { old: oldValues, new: newValues };
         } else if (
-          `${value}` != `${persisted}` ||
-          value.language != persisted.language
+          `${value}` != `${persisted}`
+          || value.language != persisted.language
         ) {
           // The current property is (optionally language‐tagged)
           // string‐valued and the value changed.
@@ -587,11 +618,11 @@ class Tag {
     }
     const identifier = this.#identifier;
     if (identifier != null) {
-      // This `Tag` has already been persisted; use its existing
+      // This `Tag´ has already been persisted; use its existing
       // identifier and persist.
       storage.set(identifier, this);
     } else {
-      // This `Tag` has not been persisted yet; save the new
+      // This `Tag´ has not been persisted yet; save the new
       // identifier after persisting.
       this.#identifier = storage.add(this);
     }
@@ -609,11 +640,11 @@ class Tag {
         // The current property is the inverse of a non‐transitive
         // property.
         for (const referencedIdentifier of diffs[term].old) {
-          // Iterate over the removed tags and remove this `Tag` from
+          // Iterate over the removed tags and remove this `Tag´ from
           // their inverse property.
           const referenced = storage.get(referencedIdentifier);
           try {
-            // Try removing this `Tag`.
+            // Try removing this `Tag´.
             referenced.#data[inverse].delete(persistedIdentifier);
             storage.set(referencedIdentifier, referenced);
           } catch {
@@ -629,7 +660,8 @@ class Tag {
             referenced.#data[inverse].add(persistedIdentifier);
             storage.set(referencedIdentifier, referenced);
           } catch {
-            // Adding failed, possibly because the other tag was deleted.
+            // Adding failed, possibly because the other tag was
+            // deleted.
             /* do nothing */
           }
         }
@@ -696,8 +728,8 @@ class Tag {
                     });
                   }
                 } catch {
-                  // Value resolution failed for some reason; perhaps the
-                  // tag was deleted.
+                  // Value resolution failed for some reason; perhaps
+                  // the tag was deleted.
                   /* do nothing */
                 }
               }
@@ -727,8 +759,8 @@ class Tag {
                     });
                   }
                 } catch {
-                  // Value resolution failed for some reason; perhaps the
-                  // tag was deleted.
+                  // Value resolution failed for some reason; perhaps
+                  // the tag was deleted.
                   /* do nothing */
                 }
               }
@@ -752,29 +784,30 @@ class Tag {
         })(),
       };
       if (
-        !Object.hasOwn(activity, "states") &&
-        !Object.hasOwn(activity, "unstates")
+        !Object.hasOwn(activity, "states")
+        && !Object.hasOwn(activity, "unstates")
       ) {
         // No meaningful changes were actually persisted.
         return null;
       } else {
-        // There were meaningful changes persisted regarding this `Tag`.
+        // There were meaningful changes persisted regarding this
+        // `Tag´.
         return activity;
       }
     }
   }
 
-  /** Returns the preferred label for this `Tag`. */
+  /** Returns the preferred label for this `Tag´. */
   get prefLabel() {
     return this.#data.prefLabel;
   }
 
-  /** Sets the preferred label of this `Tag` to the provided label. */
+  /** Sets the preferred label of this `Tag´ to the provided label. */
   set prefLabel($) {
     this.#data.prefLabel = langString($);
   }
 
-  /** Returns the Tag U·R·I for this `Tag`. */
+  /** Returns the Tag U·R·I for this `Tag´. */
   get tagURI() {
     const { identifier } = this;
     return identifier == null
@@ -782,12 +815,12 @@ class Tag {
       : `tag:${this.taggingEntity}:${identifier}`;
   }
 
-  /** Returns the tagging entity (domain and date) for this `Tag`. */
+  /** Returns the tagging entity (domain and date) for this `Tag´. */
   get taggingEntity() {
     return this.#system.taggingEntity;
   }
 
-  /** Returns the string form of the preferred label of this `Tag`. */
+  /** Returns the string form of the preferred label of this `Tag´. */
   toString() {
     return `${this.#data.prefLabel}`;
   }
@@ -809,14 +842,14 @@ class Tag {
 
 const {
   /**
-   * A `Tag` constructor function.
+   * A `Tag´ constructor function.
    *
    * This class extends the identity function, meaning that the object
    * provided as the constructor is used verbatim (with new private
    * fields added).
    *
    * ※ The instance methods of this class are provided as static
-   * methods on the superclass which all `Tag` constructors inherit
+   * methods on the superclass which all `Tag´ constructors inherit
    * from.
    *
    * ※ This class is not exposed.
@@ -824,7 +857,7 @@ const {
   TagConstructor,
 
   /**
-   * The exposed constructor function from which all `Tag` constructors
+   * The exposed constructor function from which all `Tag´ constructors
    * inherit.
    *
    * ☡ This constructor always throws.
@@ -835,26 +868,26 @@ const {
   return {
     TagConstructor: class extends identity {
       /**
-       * The `TagSystem` used for `Tag`s constructed by this
+       * The `TagSystem´ used for `Tag´s constructed by this
        * constructor.
        */
       #system;
 
-      /** The `Storage` managed by this constructor’s `TagSystem`. */
+      /** The `Storage´ managed by this constructors `TagSystem´. */
       #storage;
 
       /** The schema in use for this constructor. */
       #schema;
 
       /**
-       * Constructs a new `Tag` constructor by adding the appropriate
+       * Constructs a new `Tag´ constructor by adding the appropriate
        * private fields to the provided constructor, setting its
        * prototype, and then returning it.
        *
-       * ※ This constructor does not modify the `name` or `prototype`
+       * ※ This constructor does not modify the `name´ or `prototype´
        * properties of the provided constructor.
        *
-       * ※ See `Tag.For`, where this constructor is used.
+       * ※ See `Tag.For´, where this constructor is used.
        */
       constructor(constructor, system, storage, schema) {
         super(constructor);
@@ -865,7 +898,7 @@ const {
       }
 
       static {
-        // Define the superclass constructor which all `Tag`
+        // Define the superclass constructor which all `Tag´
         // constructors will inherit from.
         const superclass = tagConstructorBehaviours.TagSuper =
           function Tag() {
@@ -886,7 +919,7 @@ const {
       }
 
       /**
-       * Yields the tags in the `TagSystem` associated with this
+       * Yields the tags in the `TagSystem´ associated with this
        * constructor.
        */
       *all() {
@@ -894,23 +927,23 @@ const {
         const storage = this.#storage;
         for (const instance of storage.values()) {
           // Iterate over the entries and yield the ones which are
-          // `Tag`s in this `TagSystem`.
+          // `Tag´s in this `TagSystem´.
           if (Tag.getSystem(instance) == system) {
-            // The current instance is a `Tag` in this `TagSystem`.
+            // The current instance is a `Tag´ in this `TagSystem´.
             yield instance;
           } else {
-            // The current instance is not a `Tag` in this
-            // `TagSystem`.
+            // The current instance is not a `Tag´ in this
+            // `TagSystem´.
             /* do nothing */
           }
         }
       }
 
       /**
-       * Returns a new `Tag` resolved from the provided I·R·I.
+       * Returns a new `Tag´ resolved from the provided I·R·I.
        *
-       * ☡ This function throws if the I·R·I is not in the `.iriSpace`
-       * of the `TagSystem` associated with this constructor.
+       * ☡ This function throws if the I·R·I is not in the `.iriSpace´
+       * of the `TagSystem´ associated with this constructor.
        *
        * ※ If the I·R·I is not recognized, this function returns
        * `undefined`.
@@ -923,7 +956,7 @@ const {
         if (!name.startsWith(prefix)) {
           // The I·R·I does not begin with the expected prefix.
           throw new RangeError(
-            `I·R·I did not begin with the expected prefix: ${iri}`,
+            `${ÉTIQUETTE}: I·R·I did not begin with the expected prefix: ${iri}`,
           );
         } else {
           // The I·R·I begins with the expected prefix.
@@ -942,12 +975,12 @@ const {
       }
 
       /**
-       * Returns a new `Tag` resolved from the provided identifier.
+       * Returns a new `Tag´ resolved from the provided identifier.
        *
        * ☡ This function throws if the identifier is invalid.
        *
        * ※ If the identifier is valid but not recognized, this
-       * function returns `undefined`.
+       * function returns `undefined´.
        */
       fromIdentifier(identifier) {
         const system = this.#system;
@@ -959,13 +992,13 @@ const {
       }
 
       /**
-       * Returns a new `Tag` resolved from the provided Tag U·R·I.
+       * Returns a new `Tag´ resolved from the provided Tag U·R·I.
        *
        * ☡ This function throws if the provided Tag U·R·I does not
-       * match the tagging entity of this constructor’s `TagSystem`.
+       * match the tagging entity of this constructors `TagSystem´.
        *
        * ※ If the specific component of the Tag U·R·I is not
-       * recognized, this function returns `undefined`.
+       * recognized, this function returns `undefined´.
        */
       fromTagURI(tagURI) {
         const system = this.#system;
@@ -975,7 +1008,7 @@ const {
         if (!tagName.startsWith(tagPrefix)) {
           // The Tag U·R·I does not begin with the expected prefix.
           throw new RangeError(
-            `Tag U·R·I did not begin with the expected prefix: ${tagURI}`,
+            `${ÉTIQUETTE}: Tag U·R·I did not begin with the expected prefix: ${tagURI}`,
           );
         } else {
           // The I·R·I begins with the expected prefix.
@@ -994,7 +1027,7 @@ const {
       }
 
       /**
-       * Yields the tag identifiers in the `TagSystem` associated with
+       * Yields the tag identifiers in the `TagSystem´ associated with
        * this constructor.
        */
       *identifiers() {
@@ -1002,24 +1035,24 @@ const {
         const storage = this.#storage;
         for (const [identifier, instance] of storage.entries()) {
           // Iterate over the entries and yield the ones which are
-          // `Tag`s in this `TagSystem`.
+          // `Tag´s in this `TagSystem´.
           if (Tag.getSystem(instance) == system) {
-            // The current instance is a `Tag` in this `TagSystem`.
+            // The current instance is a `Tag´ in this `TagSystem´.
             yield identifier;
           } else {
-            // The current instance is not a `Tag` in this `TagSystem`.
+            // The current instance is not a `Tag´ in this `TagSystem´.
             /* do nothing */
           }
         }
       }
 
-      /** Returns the `TagSystem` for this `Tag` constructor. */
+      /** Returns the `TagSystem´ for this `Tag´ constructor. */
       get system() {
         return this.#system;
       }
 
       /**
-       * Returns a new `Tag` constructed from the provided data and
+       * Returns a new `Tag´ constructed from the provided data and
        * with the provided identifier.
        *
        * ※ This function is not really intended for public usage.
@@ -1245,8 +1278,8 @@ const {
         domainUnion.some((domain) =>
           domain == "Thing" || domains.has(domain)
         )
-      ) &&
-        rangeIntersection.every((rangeUnion) =>
+      )
+        && rangeIntersection.every((rangeUnion) =>
           rangeUnion.some((range) =>
             range == "Thing" || ranges.has(range)
           )
@@ -1257,8 +1290,8 @@ const {
 
 const {
   /**
-   * Returns the provided value converted into a `String` object with
-   * `.["@value"]` and `.["@language"]` properties.
+   * Returns the provided value converted into a `String´ object with
+   * `.["@value"]´ and `.["@language"]´ properties.
    *
    * The same object will be returned for every call with an equivalent
    * value.
@@ -1306,7 +1339,7 @@ const {
     }
   };
 
-  /** Returns the `.["@language"]` of this object. */
+  /** Returns the `.["@language"]´ of this object. */
   const getLanguage = Object.defineProperty(
     function () {
       return this["@language"] || null;
@@ -1316,9 +1349,9 @@ const {
   );
 
   /**
-   * A `FinalizationRegistry` for language string objects.
+   * A `FinalizationRegistry´ for language string objects.
    *
-   * This simply cleans up the corresponding `WeakRef` in the language
+   * This simply cleans up the corresponding `WeakRef´ in the language
    * map.
    */
   const langStringRegistry = new FinalizationRegistry(
@@ -1338,14 +1371,14 @@ const {
    */
   const languageMap = Object.create(null);
 
-  /** Returns the `.["@value"]` of this object. */
+  /** Returns the `.["@value"]´ of this object. */
   const toString = function () {
     return this["@value"];
   };
 
   /**
-   * Returns this object if it has a `.["@language"]`; otherwise, its
-   * `.["@value"]`.
+   * Returns this object if it has a `.["@language"]´; otherwise, its
+   * `.["@value"]´.
    */
   const valueOf = function () {
     return this["@language"] ? this : this["@value"];
@@ -1469,7 +1502,7 @@ const tagData = ($) => {
 /**
  * Returns an identifier corresponding to the provided object.
  *
- * This is either the value of its `.identifier` or its string value.
+ * This is either the value of its `.identifier´ or its string value.
  *
  * ※ This function is not exposed.
  */
@@ -1483,31 +1516,34 @@ const toIdentifier = ($) =>
 /**
  * A tag system, with storage.
  *
- * The `::Tag` constructor available on any `TagSystem` instance can be
- * used to create new `Tag`s within the system.
+ * The `::Tag´ constructor available on any `TagSystem´ instance can be
+ * used to create new `Tag´s within the system.
  */
 export class TagSystem {
-  /** The cached bound `Tag` constructor for this `TagSystem`. */
+  /** The cached bound `Tag´ constructor for this `TagSystem´. */
   #Tag = null;
 
-  /** The domain of this `TagSystem`. */
+  /** The domain of this `TagSystem´. */
   #domain;
 
-  /** The date of this `TagSystem`. */
+  /** The date of this `TagSystem´. */
   #date;
 
-  /** The identifier of this `TagSystem`. */
+  /** The identifier of this `TagSystem´. */
   #identifier;
 
-  /** The internal `Storage` of this `TagSystem`. */
+  /** The schema used by this `TagSystem´. */
+  #schema = schema;
+
+  /** The internal `Storage` of this `TagSystem´. */
   #storage = new Storage();
 
   /**
-   * Constructs a new `TagSystem` with the provided domain and date.
+   * Constructs a new `TagSystem´ with the provided domain and date.
    *
    * Only actual, lowercased domain names are allowed for the domain,
    * and the date must be “full” (include month and day components).
-   * This is for alignment with general best practices for Tag URI’s.
+   * This is for alignment with general best practices for Tag U·R·I¦s.
    *
    * ☡ This constructor throws if provided with an invalid date.
    */
@@ -1529,8 +1565,8 @@ export class TagSystem {
       // ☡ The domain is invalid.
       throw new RangeError(`Invalid domain: ${domain}.`);
     } else if (
-      !/^\d{4}-\d{2}-\d{2}$/u.test(dateString) ||
-      dateString != new Date(dateString).toISOString().split("T")[0]
+      !/^\d{4}-\d{2}-\d{2}$/u.test(dateString)
+      || dateString != new Date(dateString).toISOString().split("T")[0]
     ) {
       // ☡ The date is invalid.
       throw new RangeError(`Invalid date: ${date}.`);
@@ -1542,8 +1578,8 @@ export class TagSystem {
   }
 
   /**
-   * Returns a bound constructor for constructing `Tags` in this
-   * `TagSystem`.
+   * Returns a bound constructor for constructing `Tags´ in this
+   * `TagSystem´.
    */
   get Tag() {
     if (this.#Tag != null) {
@@ -1552,32 +1588,191 @@ export class TagSystem {
     } else {
       // No bound constructor has been created yet.
       const storage = this.#storage;
-      return this.#Tag = Tag.For(this, storage, schema);
+      return this.#Tag = Tag.For(this, storage, this.#schema);
+    }
+  }
+
+  /**
+   * Applies the provided activity to this `TagSystem´ by replaying its
+   * statement changes.
+   *
+   * ※ This method assumes that the provided activity conforms to the
+   * assumptions made by this module; i·e that its tags use the same
+   * identifier format and its activities do not use statements with
+   * inverse property predicates. It is not intended for the generic
+   * playback of activities produced by other scripts or mechanisms,
+   * for which a more sophisticated solution is required.
+   *
+   * ☡ This method throws an error if the provided activity cannot be
+   * processed.
+   */
+  apply(activity) {
+    const { Tag: TagConstructor } = this;
+    const {
+      classes,
+      objectProperties,
+      transitiveProperties,
+      dataProperties,
+    } = this.#schema;
+    const { object, states, unstates } = activity;
+    const activityTypes = [].concat(activity["@type"]);
+    if (!object) {
+      // ☡ The provided activity has no object.
+      throw new TypeError(
+        `${ÉTIQUETTE}: Cannot apply activity: Activity lacks an object.`,
+      );
+    } else {
+      // The provided activity has an object.
+      const iri = `${object}`;
+      const iriSpace = `${this.iriSpace}`;
+      const identifier = (() => {
+        // Extract the identifier from the object I·R·I.
+        if (!iri.startsWith(iriSpace)) {
+          // ☡ The object of the provided activity is not in the I·R·I
+          // space of this `TagSystem´.
+          throw new RangeError(
+            `Cannot apply activity: Object is not in I·R·I space: ${object}`,
+          );
+        } else {
+          // ☡ The object of the provided activity is in the I·R·I
+          // space of this `TagSystem´.
+          return iri.substring(iriSpace.length);
+        }
+      })();
+      const tag = (() => {
+        // Either resolve the identifier to an existing tag or create
+        // a new one.
+        if (activityTypes.includes("Create")) {
+          // The provided activity is a Create activity.
+          const kind = states.findLast(
+            ({ predicate, object }) =>
+              predicate == "a" && `${object}` in classes,
+          )?.object;
+          if (kind == null) {
+            // ☡ There is no recognized tag class provided for the tag;
+            // it cannot be created.
+            throw new RangeError(
+              `Cannot apply activity: Tag type not recognized.`,
+            );
+          } else {
+            // There is a recognized tag class provided for the tag.
+            return Tag.new(this, identifier, kind);
+          }
+        } else {
+          // The provided activity is not a Create activity.
+          return TagConstructor.fromIdentifier(identifier);
+        }
+      })();
+      if (!tag) {
+        // ☡ Resolving the tag identifier failed.
+        throw new RangeError(
+          `${ÉTIQUETTE}: Cannot apply activity: No tag for identifier: ${identifier}.`,
+        );
+      } else {
+        // Resolving the identifier succeeded; apply the changes to the
+        // tag and then silently persist it.
+        for (
+          const [statements, mode] of [
+            [unstates ?? [], "delete"],
+            [states ?? [], "add"],
+          ]
+        ) {
+          // Delete unstatements, then add statements.
+          for (const { predicate: $p, object: $o } of statements) {
+            // Iterate over the statements and apply them.
+            const predicate = `${$p}`;
+            const term = predicate in dataProperties
+              ? langString($o)
+              : predicate in objectProperties
+                  && !(predicate in transitiveProperties
+                    || objectProperties[predicate].inverseOf != null)
+              ? `${$o}`
+              : null;
+            if (term == null) {
+              // The provided predicate is not recognized; ignore it.
+              /* do nothing */
+            } else if (predicate == "prefLabel") {
+              // Preflabels are handled specially.
+              if (mode == "delete") {
+                // Unstating a preflabel has no effect unless a new one
+                // is also stated.
+                /* do nothing */
+              } else {
+                // Update the preflabel.
+                tag.prefLabel = term;
+              }
+            } else {
+              // The predicate is not `"prefLabel"´.
+              const related = (() => {
+                // If the predicate is an object property, attempt to
+                // resolve the object.
+                if (!(predicate in objectProperties)) {
+                  // The predicate is not an object property; return
+                  // null.
+                  return null;
+                } else {
+                  // The predicate is an object property.
+                  try {
+                    // Attempt to resolve the object.
+                    return TagConstructor.fromIRI(term);
+                  } catch {
+                    // Resolving failed; return undefined.
+                    return undefined;
+                  }
+                }
+              })();
+              if (related === undefined) {
+                // The predicate is an object property, but its object
+                // was not resolvable.
+                //
+                // ☡ This is a silent error to allow for selective
+                // replay of activities while ignoring terms which are
+                // not covered.
+                /* do nothing */
+              } else {
+                // The predicate is not an object property or has a
+                // resolvable object.
+                //
+                // Apply the statement.
+                tag[
+                  mode.concat(
+                    predicate[0].toUpperCase(),
+                    predicate.substring(1),
+                    predicate in objectProperties ? "Tag" : "",
+                  )
+                ](related ?? term);
+              }
+            }
+          }
+        }
+        tag.persist(true);
+        return tag;
+      }
     }
   }
 
-  /** Returns the authority name (domain) for this `TagSystem`. */
+  /** Returns the authority name (domain) for this `TagSystem´. */
   get authorityName() {
     return this.#domain;
   }
 
-  /** Returns the date of this `TagSystem`, as a string. */
+  /** Returns the date of this `TagSystem´, as a string. */
   get date() {
     return this.#date;
   }
 
   /**
-   * Yields the entities in this `TagSystem`.
+   * Yields the entities in this `TagSystem´.
    *
    * ※ Entities can hypothetically be anything. If you specifically
-   * want the `Tag`s, use `::Tag.all` instead.
+   * want the `Tag´s, use `::Tag.all´ instead.
    */
   *entities() {
     yield* this.#storage.values();
   }
 
   /**
-   * Returns the identifier of this `TagSystem`.
+   * Returns the identifier of this `TagSystem´.
    *
    * ※ Often this is just the empty string.
    */
@@ -1585,30 +1780,30 @@ export class TagSystem {
     return this.#identifier;
   }
 
-  /** Yields the identifiers in use in this `TagSystem`. */
+  /** Yields the identifiers in use in this `TagSystem´. */
   *identifiers() {
     yield* this.#storage.keys();
   }
 
-  /** Returns the I·R·I for this `TagSystem`. */
+  /** Returns the I·R·I for this `TagSystem´. */
   get iri() {
     return `${this.iriSpace}${this.identifier}`;
   }
 
   /**
-   * Returns the prefix used for I·R·I’s of `Tag`s in this `TagSystem`.
+   * Returns the prefix used for I·R·I¦s of `Tag´s in this `TagSystem´.
    */
   get iriSpace() {
     return `https://${this.authorityName}/tag:${this.taggingEntity}:`;
   }
 
-  /** Returns the Tag U·R·I for this `TagSystem`. */
+  /** Returns the Tag U·R·I for this `TagSystem´. */
   get tagURI() {
     return `tag:${this.taggingEntity}:${this.identifier}`;
   }
 
   /**
-   * Returns the tagging entity (domain and date) for this `TagSystem`.
+   * Returns the tagging entity (domain and date) for this `TagSystem´.
    */
   get taggingEntity() {
     return `${this.authorityName},${this.date}`;
index 4396d37def8892db01a6f32076ca066b31773a21..b3a1b1bfd0438bc7d41670542c1342730cc6a5a3 100644 (file)
@@ -1,11 +1,14 @@
-// 📧🏷️ Étiquette ∷ model.test.js
-// ====================================================================
-//
-// Copyright © 2023 Lady [@ Lady’s Computer].
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+// SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+// SPDX-License-Identifier: MPL-2.0
+/**
+ * ⁌ 📧🏷️ Étiquette ∷ model.test.js
+ *
+ * Copyright © 2023, 2025 Lady [@ Ladys Computer].
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+ */
 
 import {
   assert,
@@ -973,6 +976,208 @@ describe("TagSystem", () => {
     // `::[Storage.toObject]` is tested by `::persist`.
   });
 
+  describe("::apply", () => {
+    let system;
+    let Tag;
+
+    beforeEach(() => {
+      system = new TagSystem("example", "1972-12-31");
+      Tag = system.Tag;
+    });
+
+    it("[[Call]] throws if no activity is provided", () => {
+      assertThrows(() => {
+        system.apply();
+      });
+    });
+
+    it("[[Call]] throws with an invalid activity", () => {
+      assertThrows(() => {
+        system.apply({});
+      });
+    });
+
+    it("[[Call]] throws when specifying an invalid object", () => {
+      assertThrows(() => {
+        system.apply({
+          object: "",
+        });
+      });
+      assertThrows(() => {
+        system.apply({
+          object: `${system.iriSpace}000-0000`,
+        });
+      });
+    });
+
+    it("[[Call]] returns the tag being modified", () => {
+      const tag = new Tag();
+      tag.persist(true);
+      const applied = system.apply({ object: tag.iri });
+      assertStrictEquals(
+        Object.getPrototypeOf(applied),
+        system.Tag.prototype,
+      );
+      assertStrictEquals(tag.identifier, applied.identifier);
+    });
+
+    it("[[Call]] applies the changes", () => {
+      const broaderTag = new Tag();
+      const broaderActivity = broaderTag.persist();
+      const otherBroaderTag = new Tag();
+      const otherBroaderActivity = otherBroaderTag.persist();
+      const tag = new Tag("EntityTag", "my pref label");
+      tag.addHiddenLabel("label");
+      tag.addBroaderTag(broaderTag);
+      const createActivity = tag.persist();
+      tag.prefLabel = "new pref label";
+      tag.addAltLabel("alternative label");
+      tag.deleteHiddenLabel("label");
+      tag.addBroaderTag(otherBroaderTag);
+      tag.deleteBroaderTag(broaderTag);
+      const updateActivity = tag.persist();
+      const otherSystem = new TagSystem(
+        system.authorityName,
+        system.date,
+      );
+      otherSystem.apply(broaderActivity);
+      otherSystem.apply(otherBroaderActivity);
+      const appliedCreate = otherSystem.apply(createActivity);
+      assertStrictEquals(appliedCreate.kind, "EntityTag");
+      assertStrictEquals(appliedCreate.identifier, tag.identifier);
+      assertEquals(
+        { ...appliedCreate.prefLabel },
+        { "@value": "my pref label" },
+      );
+      assertEquals(
+        [...appliedCreate.hiddenLabels()].map(($) => ({ ...$ })),
+        [{ "@value": "label" }],
+      );
+      assertEquals(
+        [...appliedCreate.broaderTags()].map(($) => $.identifier),
+        [broaderTag.identifier],
+      );
+      const appliedUpdate = otherSystem.apply(updateActivity);
+      assertEquals(
+        { ...appliedUpdate.prefLabel },
+        { "@value": "new pref label" },
+      );
+      assertEquals(
+        [...appliedUpdate.altLabels()].map(($) => ({ ...$ })),
+        [{ "@value": "alternative label" }],
+      );
+      assertEquals([...appliedUpdate.hiddenLabels()], []);
+      assertEquals(
+        [...appliedUpdate.broaderTags()].map(($) => $.identifier),
+        [otherBroaderTag.identifier],
+      );
+    });
+
+    it("[[Call]] silently fails deleting preflabels", () => {
+      const tag = new system.Tag("Tag", "my pref label");
+      tag.persist(true);
+      const applied = system.apply({
+        object: tag.iri,
+        unstates: [{
+          predicate: "prefLabel",
+          object: "my pref label",
+        }],
+      });
+      assertEquals(
+        { ...applied.prefLabel },
+        { "@value": "my pref label" },
+      );
+    });
+
+    it("[[Call]] silently fails deleting unrecognized statements", () => {
+      const tag = new Tag();
+      tag.persist(true);
+      const otherTag = new Tag();
+      otherTag.persist(true);
+      const applied = system.apply({
+        object: tag.iri,
+        unstates: [{
+          predicate: "bad_statement",
+          object: otherTag.iri,
+        }],
+      });
+      assert(applied);
+    });
+
+    it("[[Call]] silently fails deleting immutable statements", () => {
+      const tag = new Tag();
+      tag.persist(true);
+      const applied = system.apply({
+        object: tag.iri,
+        unstates: [{ predicate: "a", object: "Tag" }],
+      });
+      assertStrictEquals(applied.kind, "Tag");
+    });
+
+    it("[[Call]] silently fails deleting inverse statements", () => {
+      const tag = new Tag();
+      tag.persist(true);
+      const otherTag = new Tag();
+      otherTag.addBroaderTag(tag);
+      otherTag.persist(true);
+      const applied = system.apply({
+        object: tag.iri,
+        unstates: [{ predicate: "narrower", object: otherTag.iri }],
+      });
+      assertStrictEquals(
+        [...applied.narrowerTags()][0].identifier,
+        otherTag.identifier,
+      );
+    });
+
+    it("[[Call]] sets preflabels", () => {
+      const tag = new Tag("Tag", "my pref label");
+      tag.persist(true);
+      const applied = system.apply({
+        object: tag.iri,
+        states: [{ predicate: "prefLabel", object: "new pref label" }],
+      });
+      assertEquals(
+        { ...applied.prefLabel },
+        { "@value": "new pref label" },
+      );
+    });
+
+    it("[[Call]] silently fails setting unrecognized statements", () => {
+      const tag = new Tag();
+      tag.persist(true);
+      const otherTag = new Tag();
+      otherTag.persist(true);
+      const applied = system.apply({
+        object: tag.iri,
+        states: [{ predicate: "bad_statement", object: otherTag.iri }],
+      });
+      assert(applied);
+    });
+
+    it("[[Call]] silently fails setting immutable statements", () => {
+      const tag = new Tag();
+      tag.persist(true);
+      const applied = system.apply({
+        object: tag.iri,
+        states: [{ predicate: "a", object: "RelationshipTag" }],
+      });
+      assertStrictEquals(applied.kind, "Tag");
+    });
+
+    it("[[Call]] silently fails setting inverse statements", () => {
+      const tag = new Tag();
+      tag.persist(true);
+      const otherTag = new Tag();
+      otherTag.persist(true);
+      const applied = system.apply({
+        object: tag.iri,
+        unstates: [{ predicate: "narrower", object: otherTag.iri }],
+      });
+      assertEquals([...applied.narrowerTags()], []);
+    });
+  });
+
   describe("::authorityName", () => {
     it("[[Get]] returns the authority name", () => {
       const system = new TagSystem("etaoin.example", "1972-12-31");
index 086e344f909edf45af69527fd1a0f408e5aedcc7..0313a8c7038c354514426566f86907238032e091 100644 (file)
--- a/names.js
+++ b/names.js
@@ -1,11 +1,14 @@
-// 📧🏷️ Étiquette ∷ names.js
-// ====================================================================
-//
-// Copyright © 2023 Lady [@ Lady’s Computer].
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+// SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+// SPDX-License-Identifier: MPL-2.0
+/**
+ * ⁌ 📧🏷️ Étiquette ∷ names.js
+ *
+ * Copyright © 2023, 2025 Lady [@ Ladys Computer].
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+ */
 
 export const taggingContext =
   "https://ns.1024.gdn/Tagging/context.jsonld";
index c708cfe83b13f9452651c96f43f6caea6447348a..f32ee451678df992f252fca2e5c93dcb30fc56e6 100644 (file)
--- a/schema.js
+++ b/schema.js
@@ -1,21 +1,22 @@
-// 📧🏷️ Étiquette ∷ schema.js
-// ====================================================================
-//
-// Copyright © 2023 Lady [@ Lady’s Computer].
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
-//
-// ___
-//
+// SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
+// SPDX-License-Identifier: MPL-2.0
+/**
+ * ⁌ 📧🏷️ Étiquette ∷ schema.js
+ *
+ * Copyright © 2023, 2025 Lady [@ Ladys Computer].
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+ */
+
 // ※ The definitions in this file are minimal and only really geared
 // towards supporting the functionality that 📧🏷️ Étiquette needs.
 
 /**
  * Supported class types.
  *
- * The class `"Thing"` is not defined, but is used as a generic
+ * The class `"Thing"´ is not defined, but is used as a generic
  * superclass.
  */
 const classes = {
This page took 0.191299 seconds and 4 git commands to generate.