|
2 | 2 |
|
3 | 3 | [LinkML](https://linkml.io/) semantic schemas for Regen Network framework. |
4 | 4 |
|
| 5 | +These schemas define the structure and semantics for credit class and project metadata in the Regen Network ecosystem. They provide a standardized way to describe: |
| 6 | + |
| 7 | +- **Credit Class Information**: Metadata for carbon and biodiversity credit classes, including protocols, methodologies, eligible activities, and environment types |
| 8 | +- **Project Information**: Geospatial and descriptive data for projects enrolled in a given credit class |
| 9 | +- **Impact Tracking**: Primary impacts and co-benefits associated with projects |
| 10 | +- **Taxonomies**: Controlled vocabularies for activities, environment types, and impact types |
| 11 | + |
| 12 | +The schemas are designed to be converted to RDF/JSON-LD formats for semantic web integration and SPARQL querying. |
| 13 | + |
| 14 | +> **Note**: Current on-chain datasets may not fully reflect this schema. The schemas in this repository (and the playground folder) represent the latest up-to-date versions of all Regen Network datasets in a format consistent with current Regen Data Standards. |
| 15 | +
|
5 | 16 | ## Requirements |
6 | 17 |
|
7 | 18 | [Install LinkML](https://linkml.io/linkml/intro/install.html) to use the helper and generator commands for interacting with LinkML schemas and data. |
|
11 | 22 | - LinkML schemas are created in `schema/src`. |
12 | 23 | - Create separate schema files for each logical schema class and `import` into the root `schemas.yaml` file. |
13 | 24 | - Generated markdown from schemas: |
14 | | - ```shell |
15 | | - make gen-doc |
16 | | - ``` |
| 25 | + ```shell |
| 26 | + make gen-doc |
| 27 | + ``` |
17 | 28 | - Generate linkml enums for taxonomy terms: |
18 | | - ```shell |
19 | | - make gen-taxonomy |
20 | | - ``` |
| 29 | + ```shell |
| 30 | + make gen-taxonomy |
| 31 | + ``` |
21 | 32 |
|
22 | 33 | ## Playground |
23 | 34 |
|
24 | | -- Datasets are provided inside `schema/data/playground/{Credit-Class}/{LinkML-Class}/*.yaml` files |
25 | | -- Validate and generate RDF data. This creates `.ttl` and `.jsonld` files for each dataset. |
26 | | - ```shell |
27 | | - make gen-rdf |
28 | | - ``` |
29 | | -- Add data to graph. This adds all `.ttl` files to the graph. Override the `GRAPH_STORE_URL` env var: |
30 | | - ```shell |
31 | | - export GRAPH_STORE_URL=http://localhost:7878/store |
32 | | - make update-graph |
33 | | - ``` |
| 35 | +Datasets are provided inside `schema/data/playground/{Credit-Class}/{LinkML-Class}-*.yaml` files. All datasets are managed in github as YAML files as this is more lightweight and easier to manage (as the standardized source for LinkML datasets) than storing JSON-LD or TTL files in version control. |
| 36 | + |
| 37 | +There is a designated make task (`gen-rdf`) for validating and generating RDF data in formats besides YAML. This creates `.ttl` and `.jsonld` files for each dataset. To run the script, use the following command: |
| 38 | + |
| 39 | +```shell |
| 40 | +make gen-rdf |
| 41 | +``` |
| 42 | + |
| 43 | +## SPARQL Integration |
| 44 | + |
| 45 | +If you are running a SPARQL endpoint, you can use the following command to push datasets via a GRAPH_STORE API to update datasets to a live SPARQL store. This adds all `.ttl` files to the graph. Override the `GRAPH_STORE_URL` env var: |
| 46 | + |
| 47 | +```shell |
| 48 | +export GRAPH_STORE_URL=http://localhost:7878/store |
| 49 | +make update-graph |
| 50 | +``` |
0 commit comments