moca-reader 0.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. moca_reader/__init__.py +84 -0
  2. moca_reader/_js.py +291 -0
  3. moca_reader/attestations.py +271 -0
  4. moca_reader/audience.py +49 -0
  5. moca_reader/backends/__init__.py +1 -0
  6. moca_reader/backends/bm25.py +118 -0
  7. moca_reader/backends/dense.py +146 -0
  8. moca_reader/backends/hybrid.py +73 -0
  9. moca_reader/backends/lexical.py +112 -0
  10. moca_reader/backends/memory_store.py +122 -0
  11. moca_reader/citation.py +213 -0
  12. moca_reader/codes.py +110 -0
  13. moca_reader/conformance.py +249 -0
  14. moca_reader/content.py +312 -0
  15. moca_reader/diagnostics.py +45 -0
  16. moca_reader/digest.py +92 -0
  17. moca_reader/dsse.py +97 -0
  18. moca_reader/ed25519.py +83 -0
  19. moca_reader/embedders.py +224 -0
  20. moca_reader/evidence_text.py +187 -0
  21. moca_reader/frontmatter.py +151 -0
  22. moca_reader/library.py +176 -0
  23. moca_reader/manifest.py +186 -0
  24. moca_reader/metadata.py +58 -0
  25. moca_reader/profiles.py +5 -0
  26. moca_reader/py.typed +0 -0
  27. moca_reader/reader.py +468 -0
  28. moca_reader/relations.py +46 -0
  29. moca_reader/resolver.py +33 -0
  30. moca_reader/reviews.py +18 -0
  31. moca_reader/schemas/ag-ui-citations.schema.json +36 -0
  32. moca_reader/schemas/citation-record.schema.json +326 -0
  33. moca_reader/schemas/manifest.schema.json +171 -0
  34. moca_reader/schemas/node.schema.json +372 -0
  35. moca_reader/schemas/review-predicate.schema.json +42 -0
  36. moca_reader/schemas/search-hit.schema.json +62 -0
  37. moca_reader/schemas/sidecar-index.schema.json +155 -0
  38. moca_reader/schemas/structure.schema.json +93 -0
  39. moca_reader/schemas/trust-root.schema.json +130 -0
  40. moca_reader/schemas.py +44 -0
  41. moca_reader/search.py +346 -0
  42. moca_reader/sidecar.py +228 -0
  43. moca_reader/source.py +285 -0
  44. moca_reader/state.py +119 -0
  45. moca_reader/strategies/__init__.py +1 -0
  46. moca_reader/strategies/diversify.py +28 -0
  47. moca_reader/strategies/ontology_guided.py +63 -0
  48. moca_reader/structure.py +385 -0
  49. moca_reader/structure_ops.py +160 -0
  50. moca_reader/unicode.py +33 -0
  51. moca_reader-0.6.0.dist-info/METADATA +209 -0
  52. moca_reader-0.6.0.dist-info/RECORD +55 -0
  53. moca_reader-0.6.0.dist-info/WHEEL +4 -0
  54. moca_reader-0.6.0.dist-info/licenses/LICENSE +201 -0
  55. moca_reader-0.6.0.dist-info/licenses/NOTICE +15 -0
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.5
2
+ Name: moca-reader
3
+ Version: 0.6.0
4
+ Summary: Reads, verifies, searches and cites MOCA packages (moca-spec 0.6).
5
+ Project-URL: Homepage, https://openmoca.org
6
+ Project-URL: Source, https://github.com/openmoca/moca-reader-python
7
+ Author: MOCA Standard Contributors
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ License-File: NOTICE
11
+ Keywords: ai,citations,knowledge packages,moca,rag,retrieval
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.11
18
+ Requires-Dist: cryptography>=44
19
+ Requires-Dist: jsonschema>=4.23
20
+ Requires-Dist: pyyaml>=6.0.2
21
+ Requires-Dist: rdflib>=7.1
22
+ Requires-Dist: rfc3339-validator>=0.1.4
23
+ Provides-Extra: onnx
24
+ Requires-Dist: numpy>=1.26; extra == 'onnx'
25
+ Requires-Dist: onnxruntime>=1.20; extra == 'onnx'
26
+ Requires-Dist: tokenizers>=0.20; extra == 'onnx'
27
+ Provides-Extra: sigstore
28
+ Requires-Dist: sigstore<5,>=4.5; extra == 'sigstore'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # moca-reader
32
+
33
+ The MOCA Reader for Python: open a package from a directory, a `.moca` archive
34
+ or a host-supplied source; check it; compute its digest; verify attestations
35
+ and evidence; resolve members; answer structure operations; produce citation
36
+ records; and search with one entry point over lexical, dense-sidecar, store or
37
+ hybrid backends.
38
+
39
+ It implements the Reader class of the
40
+ [Reader contract](https://github.com/openmoca/moca-spec/blob/main/spec/moca-reader-contract.md),
41
+ follows the
42
+ [Reader interface](https://github.com/openmoca/moca-spec/blob/main/spec/moca-reader-interface.md)
43
+ with Python names, passes the whole
44
+ [conformance corpus](https://github.com/openmoca/moca-spec/blob/main/conformance/README.md),
45
+ and returns the same ranked results as the reference Reader,
46
+ [moca-reader-typescript](https://github.com/openmoca/moca-reader-typescript).
47
+
48
+ ## Install
49
+
50
+ ```sh
51
+ pip install moca-reader
52
+ ```
53
+
54
+ Python 3.11 or later. [Getting started](docs/getting-started.md) takes you from
55
+ install to a cited search result and a conformance run in five steps.
56
+
57
+ ```python
58
+ from moca_reader import Library, read_package
59
+
60
+ pkg = read_package("support-kb.moca", trust_root="trust-root.json")
61
+ print(pkg.valid, pkg.digest, pkg.capabilities)
62
+
63
+ library = Library().add(pkg)
64
+ for record in library.search("refund window", audiences=["public"]):
65
+ print(record["node"]["title"], record["node"]["ref"], record["score"])
66
+ ```
67
+
68
+ A malformed package never raises: `pkg.valid` is False and `pkg.diagnostics`
69
+ says why. The Reader never reaches the network, or any file outside the
70
+ package, because a package names it. Citation records are plain dicts, the
71
+ same JSON every MOCA Reader produces (`citation-record.schema.json`).
72
+
73
+ ## The API
74
+
75
+ | Name | Purpose |
76
+ | --- | --- |
77
+ | `read_package(target, *, trust_root, resolve_member, strict, limits, known_profiles, now)` | Read and check a package: a path, a `.moca`/`.zip` path, or a host source with `list()` and `read(path)`. |
78
+ | `Library(clock=, overlays=, limits=)` | Holds verified packages, with bound sidecar chunks: `add`, `citations`, `get`, `search`, `structure`. |
79
+ | `Search(source, backend, audiences=, hooks=)` | One entry point over a backend: `search(query, limit=, include_all=, locale=, concepts=, scope=)`. The gate always runs last. `source` is a `Library`, or a `StoreScope(package_states, clock)` for a store backend: `package_state(result)` for each loaded package, so every library- and trust-dependent field is recomputed (contract §9.4). |
80
+ | `LexicalBackend`, `DenseBackend`, `MemoryStoreBackend`, `HybridBackend` | BM25 over package text or sidecar chunks; sidecar vectors with a host embedder (`S006`, `S007`); a reference in-memory store; Reciprocal Rank Fusion of a lexical and a dense backend. |
81
+ | `Embedder` | The protocol a host embedder follows: `name`, `version`, `dimensions`, `query_prefix`, `document_prefix`, `embed(texts, role)`. |
82
+ | `moca_reader.embedders` | MOCA's four standard embedding models run locally (`standard_embedder("bge-small-en-v1.5")`), with the `onnx` extra. |
83
+ | `SearchHooks`, `ontology_guided()`, `diversify(per_node=)` | Retrieval hooks: host code, never package content. |
84
+ | `bind_sidecar(target, pkg)` | Check a sidecar against a package and return usable chunks. |
85
+ | `directory_resolver(dirs)` | A simple member resolver over folders. |
86
+ | `TrustRoot` | A host trust root, from a path or a dict. |
87
+ | `flat_metadata(record)` | The consuming guide's flat `moca_*` fields for a citation record, for vector stores. |
88
+ | `library.structure` | `concept`, `requires`, `required_by`, `parts`, `narrower`, `broader`, `related`, `sequence`, `descendants`, `nodes`. |
89
+
90
+ The API is synchronous.
91
+
92
+ ## Framework bindings
93
+
94
+ Separate packages, each a thin adapter over the Reader
95
+ ([ADR-0002](docs/adr/0002-framework-bindings-as-thin-adapters.md)):
96
+
97
+ | Package | What it gives you |
98
+ | --- | --- |
99
+ | [`moca-reader-langchain`](packages/moca-reader-langchain/README.md) | `MocaRetriever`: a LangChain retriever returning `Document`s |
100
+ | [`moca-reader-llamaindex`](packages/moca-reader-llamaindex/README.md) | `MocaRetriever`: a LlamaIndex retriever returning scored nodes |
101
+
102
+ Both wrap a `Search` you build, so the gate and your audience filter always
103
+ apply, and carry the whole citation record and the consuming guide's flat
104
+ `moca_*` fields in each result's metadata. `flat_metadata(record)` gives you
105
+ the same fields for your own vector store.
106
+
107
+ ## Search by meaning with a standard model
108
+
109
+ With the `onnx` extra, `moca_reader.embedders` runs MOCA's four standard
110
+ embedding models locally, the way every MOCA tool does, so a query embedded
111
+ here matches an index built with `moca-index --model`:
112
+
113
+ ```sh
114
+ pip install "moca-reader[onnx]"
115
+ npx @openmoca/moca-embed models add bge-small-en-v1.5 # once: download and check the model
116
+ ```
117
+
118
+ ```python
119
+ from moca_reader import DenseBackend, HybridBackend, LexicalBackend
120
+ from moca_reader.embedders import standard_embedder
121
+
122
+ embedder = standard_embedder("bge-small-en-v1.5") # files checked against their pinned SHA-256
123
+ hybrid = HybridBackend(LexicalBackend(library), DenseBackend(library, embedder))
124
+ ```
125
+
126
+ Models are read from `~/.moca/models` (or `MOCA_MODELS`). The Reader never
127
+ downloads them.
128
+
129
+ ## Lexical search
130
+
131
+ The built-in lexical backend is BM25 (k1 1.2, b 0.75) over node text, or over
132
+ sidecar chunks when a sidecar is bound. Every MOCA Reader tokenises the same
133
+ way, so they return the same results:
134
+
135
+ - NFKC-normalise, then lower-case each code point (simple case mapping).
136
+ - Letters, digits and combining marks make words; anything else separates
137
+ them. Words in scripts with vowel signs, such as Devanagari, stay whole.
138
+ - Chinese, Japanese, Thai, Lao, Khmer and Myanmar text is split into each
139
+ character (with its marks) and each pair of neighbouring characters.
140
+ - No stemming. A host that needs it supplies its own lexical backend.
141
+ - Without a locale, every language of a node is searched and its best match
142
+ returned; with one, the representation package spec §5 selects.
143
+
144
+ Characters added in very recent Unicode versions can tokenise differently
145
+ across Readers, because each language runtime ships its own Unicode data.
146
+
147
+ ## Conformance
148
+
149
+ As [Reader contract §14](https://github.com/openmoca/moca-spec/blob/main/spec/moca-reader-contract.md#14-demonstrating-conformance)
150
+ asks:
151
+
152
+ | | |
153
+ | --- | --- |
154
+ | Class | Reader |
155
+ | Contract version | 0.6.0 |
156
+ | Implemented | Archives, host sources, DSSE attestations, sidecars (lexical and dense), the ontology profile |
157
+ | Sigstore | Offline only, with the `sigstore` extra (`pip install moca-reader[sigstore]`), against the host trust root's `sigstore.trustedRoot`. Without the extra, or without a trusted root, a `*.sigstore.json` attestation is unverifiable (`A003`). There is no online mode: refresh the trusted root yourself (moca-spec attestations §6) |
158
+
159
+ The conformance adapter ships with the package. From a moca-spec checkout:
160
+
161
+ ```sh
162
+ node scripts/run-conformance.mjs --reader "python -m moca_reader.conformance"
163
+ ```
164
+
165
+ ## Develop
166
+
167
+ You need [uv](https://docs.astral.sh/uv/). The tests read moca-spec's examples
168
+ and run its conformance corpus. Check out
169
+ [moca-spec](https://github.com/openmoca/moca-spec) beside this repository, or
170
+ set `MOCA_SPEC_DIR`. CI uses the tags pinned at the top of
171
+ `.github/workflows/test.yml` (`MOCA_SPEC_REF` and the like); check out the same
172
+ tags to match it.
173
+
174
+ ```sh
175
+ uv sync
176
+ uv run pytest
177
+ uv run ruff check && uv run ruff format --check
178
+ uv run mypy
179
+ ```
180
+
181
+ `tests/parity/parity.mjs` runs 18 search scenarios (87 queries) over
182
+ moca-spec's examples through this Reader and the reference Reader, and fails
183
+ on any difference in records, order, spans, text or scores. Dense sidecars use
184
+ a deterministic hashing embedder, so no model is needed. With
185
+ moca-reader-typescript and moca-tools (after `npm ci`) beside moca-spec:
186
+
187
+ ```sh
188
+ node tests/parity/parity.mjs
189
+ ```
190
+
191
+ ## Release
192
+
193
+ 1. Add a dated section to [CHANGELOG.md](CHANGELOG.md) and update `version` in
194
+ `pyproject.toml` and `__version__` in `src/moca_reader/__init__.py`.
195
+ 2. Point the `MOCA_*_REF` pins in `.github/workflows/test.yml` at the release tags
196
+ ([moca-spec docs/releasing.md](https://github.com/openmoca/moca-spec/blob/main/docs/releasing.md#moving-the-pins)).
197
+ 3. The tests, corpus and parity pass.
198
+ 4. Tag `vX.Y.Z` and publish a GitHub release whose notes are the changelog
199
+ section.
200
+ 5. `uv build --all-packages` and `uv publish` from the tagged commit: `moca-reader`
201
+ first, then its bindings, which release at the same version.
202
+
203
+ ## Licence
204
+
205
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
206
+
207
+ OpenMOCA™ is a trade mark of PI & Mash Solutions Ltd. The licence covers the
208
+ code, not the name: see the
209
+ [trade mark policy](https://github.com/openmoca/moca-spec/blob/main/TRADEMARKS.md).
@@ -0,0 +1,55 @@
1
+ moca_reader/__init__.py,sha256=6MSvDVKgrRouv6miDOQkQpdtIJas4zN7kuElSA2d3Dg,2539
2
+ moca_reader/_js.py,sha256=VFZie7EJHDPOc1HV9IxaZd_bAyn5f1INI9JLz3woPhE,10349
3
+ moca_reader/attestations.py,sha256=Y93Vl5mmHATveWkBKd5Y64yWuFvAmEB5aLanSMROitQ,12364
4
+ moca_reader/audience.py,sha256=lmEV11JGjJHVtfPMCItBBjXLZVO5hzYZTUxM8IUrn3M,1941
5
+ moca_reader/citation.py,sha256=5Z-OUgNQ5NpsbYhVPI93fPy7BO7GlasbS3-jbd2LyDk,8628
6
+ moca_reader/codes.py,sha256=DKORI-e8beH0KXaLRwJQ1wXTkCzXRy9Ga6BKzrPwTN8,6461
7
+ moca_reader/conformance.py,sha256=axLUcwRwx7HOSJw3_smrv93nS-laRDDH_kl1ySUnf3c,10249
8
+ moca_reader/content.py,sha256=0s52CiX1o0Ng514VkaarLZZ85Jej-7CcGt0Mi_4UCfw,13443
9
+ moca_reader/diagnostics.py,sha256=1FtPvxbkc0Ca35F-TXpojZKKDGMCC6be5t4gxatzLkM,1307
10
+ moca_reader/digest.py,sha256=KeWJJNJS8PW8OP8X8XtyLJs36Xz-Jb6pmVmZMCJn1d8,3511
11
+ moca_reader/dsse.py,sha256=e9Wh8LmqCOvFWlIhW7h3dbozN2fQPz4CsxVKOdfAmBk,3918
12
+ moca_reader/ed25519.py,sha256=ru5YKUbq-Eb24SPQGJZ6C0-4PaKny08iUikwBXD-oTA,2628
13
+ moca_reader/embedders.py,sha256=6LaZKsm85stniOe8UY4Jy1q3kjaPsTIbZ-aiPCfKQzQ,9853
14
+ moca_reader/evidence_text.py,sha256=I2I-XRQY7pwMEaDFgHKdUU8hytewBp1AUFbUXBUbziE,7293
15
+ moca_reader/frontmatter.py,sha256=wajiZuaBLySdo04MsQobWb6WFb-qOhjwfVANzVEEUZI,5469
16
+ moca_reader/library.py,sha256=4Rmpn2MNOzLPcZtKkrFBYjUITDnePnirJkmeqi1MxII,7469
17
+ moca_reader/manifest.py,sha256=58dRfUHYXoPem1oq_idDxLJCeU4Z5Ezs04QcWVRUm9U,4670
18
+ moca_reader/metadata.py,sha256=zp3vxSRL81dI1xdpXwRNa7vCSS0yZT1VInD7hxVqWEQ,2364
19
+ moca_reader/profiles.py,sha256=tebzLZD05JGSE4RuFtSX8fMf0fkQvcjJULCPxCdD9hk,235
20
+ moca_reader/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
+ moca_reader/reader.py,sha256=S6zYiSoETBnd0j3AIvb20xbBAIuODgdgY8sgh0MolyM,20148
22
+ moca_reader/relations.py,sha256=qRlSC542i-AygpDSqH6V-fLgA5mN0y-DAZYao_Bb68Y,1967
23
+ moca_reader/resolver.py,sha256=MZRse_ANml5Ix9ZMMjFcc78BuOjEOXgkf6am73aF7Qc,1415
24
+ moca_reader/reviews.py,sha256=gvvj4B1CyNmh0zkO4wwOGgCUZjW98PIDv0qjkWAOUn4,658
25
+ moca_reader/schemas.py,sha256=DGJQYxIKy2jsTbMz89ZWRFGAaybYtYrBzwst4wCNR10,1357
26
+ moca_reader/search.py,sha256=1qHrH63To1zP57oAU7_8stR6FX9JPwakAJqXy46B73s,14916
27
+ moca_reader/sidecar.py,sha256=cZXWDC2QDvGDkHvP97XlnLSWwZ6utsl3CrLu9QuZRfc,9237
28
+ moca_reader/source.py,sha256=MchJhOrDst14XLLYPFTaTUM1a1XjqlWKZcWiFSFqdxg,11727
29
+ moca_reader/state.py,sha256=OaCHrjvXUuF0eH1H96uaW9-1aPBKK5YM2fI_eEnEhuc,4573
30
+ moca_reader/structure.py,sha256=GV9xU5A6moaXlJ1_RRxue7Pb7ytwWic3ZrL2arTDvRc,15975
31
+ moca_reader/structure_ops.py,sha256=JNMHwC2nWaUSsy_65Xv81-trkQZt2tdyi2Jy1DoozUA,6755
32
+ moca_reader/unicode.py,sha256=ApJVFmp6F94-aiplLRGnzNV2qH-GkswJqe7NBbt7tBI,1295
33
+ moca_reader/backends/__init__.py,sha256=41mhI05_0QyMqJFcSyJJHz1vqjXilYg9ZFfQzd-S1b8,106
34
+ moca_reader/backends/bm25.py,sha256=tbsKYkaCYDUL1uVz36TYeu8xhHUzzXT-MXRHbuQb9EQ,4325
35
+ moca_reader/backends/dense.py,sha256=p3z5eA859xr_-jk9ng6sCwuZGComUBrj9_Vj3JRngsM,6689
36
+ moca_reader/backends/hybrid.py,sha256=KKeAm5hTNxJhs-5VNfX1aFeJmxG9Gzea5IXuk15xVy8,3432
37
+ moca_reader/backends/lexical.py,sha256=3p_5IX5-_QOXz0afQx8n5BiI-S9XejwpvfgP44s07uU,5776
38
+ moca_reader/backends/memory_store.py,sha256=yq5ubiNhIOVyHwTA9sm-mZOFhfS57IvABurjdvinotg,5516
39
+ moca_reader/schemas/ag-ui-citations.schema.json,sha256=jm_xO-mxcb8uRYee_jxgRymaDxvYrFZL4GvbrBcvav4,1758
40
+ moca_reader/schemas/citation-record.schema.json,sha256=_j6ClY7r-6OQDE8SlLzFX2-5a72djT4rvMz3Kh5RflA,8113
41
+ moca_reader/schemas/manifest.schema.json,sha256=aszAfvzmp54rJB3gNtvcq3GzAhnVdM8qCXmEzQoK0G8,4965
42
+ moca_reader/schemas/node.schema.json,sha256=v9WK28rPs9qd5zUBTUcS364zIHaLXd-U-4kOAuLQnwA,8099
43
+ moca_reader/schemas/review-predicate.schema.json,sha256=SBvXegNPfLm2_klTFYovwHPDsE2pUUer2nJd_LGMDAs,1071
44
+ moca_reader/schemas/search-hit.schema.json,sha256=95LKcC0rdjtVKX43GQ3lSRYZ-zEQXAeX57oJ9kA37kA,1736
45
+ moca_reader/schemas/sidecar-index.schema.json,sha256=vteyf5BcC7c2NVmAKWEN3Bx3f8KJObViKnUD6oW2rEk,3505
46
+ moca_reader/schemas/structure.schema.json,sha256=W_mw9xMHKwcluNA1RmO6_AGRMj0TGt75rZW_j-JuZEg,2268
47
+ moca_reader/schemas/trust-root.schema.json,sha256=0A151m9LxE4-dFtAuMna4g4xiQTpX3J5Jp021YZUahg,4266
48
+ moca_reader/strategies/__init__.py,sha256=ptwPaPXou4YYq5cBBcrPPtFNZBPk9uehU8FBbvHUY7g,79
49
+ moca_reader/strategies/diversify.py,sha256=tUn0pxtCWLeBB0pBwZx6t62rWKqFjFplAf1UqRP2_Qw,1082
50
+ moca_reader/strategies/ontology_guided.py,sha256=NPPBVNSwpBY1GbK7_pPnc6k5osssiP6VK4AfIonc-5A,2446
51
+ moca_reader-0.6.0.dist-info/METADATA,sha256=m7QWkAaDE26OICiyAKUHB8oeNXYL5El8t3S-pwQkM30,9857
52
+ moca_reader-0.6.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
53
+ moca_reader-0.6.0.dist-info/licenses/LICENSE,sha256=duX51DOvmDRpCBH_xYk0N0nd6tS8cN9eo2A7Rd-t9PM,11394
54
+ moca_reader-0.6.0.dist-info/licenses/NOTICE,sha256=1xuDLe0GQUPFpEd6vCMZ1MEwwTok2g9zboWCbBaCb_g,540
55
+ moca_reader-0.6.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Modular Ontology & Content Assembly (MOCA) Standard Contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,15 @@
1
+ MOCA — Modular Ontology, Content & Attestation
2
+ Copyright 2026 MOCA Standard Contributors
3
+
4
+ This product includes software developed by the MOCA Standard Contributors
5
+ (https://github.com/openmoca).
6
+
7
+ Licensed under the Apache License, Version 2.0. You may obtain a copy of the
8
+ License in the LICENSE file in this repository, or at
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ ---
12
+
13
+ The MOCA Reader for Python and its framework bindings (the files under src/,
14
+ packages/ and tests/). All of it is licensed under the Apache License,
15
+ Version 2.0.