Skip to content

Commit

Permalink
Merge pull request #423 from okp4/feat/ontology-schemas
Browse files Browse the repository at this point in the history
Feat/ontology schemas
  • Loading branch information
ccamel authored Feb 9, 2024
2 parents eca60bc + 075d97b commit 4192cdb
Show file tree
Hide file tree
Showing 26 changed files with 1,112 additions and 327 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update-versioned-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Copy updated docs
run: |
rm -rf ${{ github.event.inputs.section }}/*
rsync -rmv --include='*/' --include='*.md' --include='*.json' --exclude='*' tmp/${{ github.event.inputs.docs_directory }} ${{ github.event.inputs.section }}
rsync -rmv --include='*/' --include='*.md' --include='*.mdx' --include='*.json' --exclude='*' tmp/${{ github.event.inputs.docs_directory }} ${{ github.event.inputs.section }}
git rm --ignore-unmatch --cached tmp
rm -rf .git/modules/tmp
rm -rf tmp
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
commit_user_name: ${{ secrets.OKP4_BOT_GIT_COMMITTER_NAME }}
commit_user_email: ${{ secrets.OKP4_BOT_GIT_COMMITTER_EMAIL }}
commit_author: ${{ secrets.OKP4_BOT_GIT_AUTHOR_NAME }} <${{ secrets.OKP4_BOT_GIT_AUTHOR_EMAIL }}>
commit_message: "docs: update draft docs for ${{ github.event.inputs.section }}"
commit_message: "feat(${{ github.event.inputs.section }}): update draft docs"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
Expand Down
2 changes: 1 addition & 1 deletion docs/academy/ai-factory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The AI factory is a decentralized framework where anyone can collaborate and gov

AI Factory is a set of :

- Rules & governance templates : data requirements defiitions, contribution quantification, token factory for DAOs
- Rules & governance templates : data requirements defiitions, contribution quantification, token factory for DAO's
- Open source algorithms ready to be trained and tailored services/workflows
- Integrations and connectors

Expand Down
6 changes: 3 additions & 3 deletions docs/academy/consume-resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This can be formalized very simply, with a set of resources as input and a set o

Once we have defined the elementary processing unit, we can combine them to form a more complex processing structure called a Workflow.
A workflow is a plan that outlines a series of activities, where some activities depend on the output of others. These interdependencies form a Directed Acyclic Graph (DAG) structure, ensuring that the workflow progresses without circular references or loops.
Lets consider an example to illustrate this concept:
Let's consider an example to illustrate this concept:

![consume-resources-2](/img/content/academy/consume-resources-2.webp)

Expand All @@ -47,7 +47,7 @@ Here's a detailed breakdown:

4. **Output and Integration**: The output of these workflows may vary based on the nature of the task. It could be a new dataset, data processing results, software outputs such as trained AI, etc. This output might also contribute to the Dataverse, further enriching the ecosystem.

5. **Payments**: Once the workflow is finished, tokens are sent to the different resource providers according to the business model. Excess tokens may be sent back to the consumer. Eventual slashing can be applied to providers who didnt provide the expected service.
5. **Payments**: Once the workflow is finished, tokens are sent to the different resource providers according to the business model. Excess tokens may be sent back to the consumer. Eventual slashing can be applied to providers who didn't provide the expected service.

6. **Flexibility and Adaptation**: Workflows in OKP4 are designed to be flexible, allowing for adaptation per changing needs or rules within the Zones. This ensures that workflows can evolve in response to new opportunities or requirements.

Expand All @@ -70,7 +70,7 @@ The workflow is purely declarative and merely expresses the activities to be per

![consume-resources-4](/img/content/academy/consume-resources-4.webp)

In its centralized perspective, orchestration relies on a single authority responsible for taking the necessary actions to accomplish a set of activities in response to a declarative expression of needs. This authority holds the logic for execution. Lets consider the example of Kubernetes — a well-known Container Orchestrator — its API enables the "declaration" of resources and will manage the operations and lifecycle logic associated with these resources.
In its centralized perspective, orchestration relies on a single authority responsible for taking the necessary actions to accomplish a set of activities in response to a declarative expression of needs. This authority holds the logic for execution. Let's consider the example of Kubernetes — a well-known Container Orchestrator — its API enables the "declaration" of resources and will manage the operations and lifecycle logic associated with these resources.

By adopting a decentralized approach, one would expect the blockchain to handle orchestration. However, due to its highly constrained communication capabilities with the external environment, it cannot fulfill this role effectively. Therefore, the most suitable approach is to delegate the execution of workflows to a dedicated off-chain resource: **the Orchestration Service**. This specific resource takes on the orchestration role while the protocol maintains its position as the source of truth and ultimate authority to which it must adhere.

Expand Down
4 changes: 2 additions & 2 deletions docs/academy/decentralized-identity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ You can use this tool to resolve a DID : https://resolver.identity.foundation/
### A verification method: the did:key Method

The **did:key method** is a specific way to create and use DIDs that is focused on simplicity and universality. Here's an overview of the main features:
Direct Incorporation of Public Key: In the did:key method, the DID directly encodes the public key itself. This means the DID is self-describing and doesnt require an external resolution to a DID document.
Direct Incorporation of Public Key: In the did:key method, the DID directly encodes the public key itself. This means the DID is self-describing and doesn't require an external resolution to a DID document.

- Simplicity: It is one of the simplest forms of DID, as it doesn't rely on a blockchain or a distributed ledger. The did:key method generates DIDs that are entirely independent of any registry, network, or company.
- Instantaneous Resolution: Because the public key information is embedded in the DID, resolving a did:key DID to its DID document is a straightforward, computation-only process. There is no need to interact with a ledger or network to retrieve the DID document.
Expand All @@ -184,7 +184,7 @@ Direct Incorporation of Public Key: In the did:key method, the DID directly enco
A did:key DID looks like this: did:key:z12ab34cd56ef78gh90i...

The limitations of the did:key method are:
- No Dynamic Updates: Since did:key DIDs are static and dont reference an external source for their DID document, they cannot be updated. Any change in the key or other details requires the generation of a new DID.
- No Dynamic Updates: Since did:key DIDs are static and don't reference an external source for their DID document, they cannot be updated. Any change in the key or other details requires the generation of a new DID.
- No Privacy Layer: The method exposes the public key openly, which might not be desirable in all scenarios, especially where privacy is a concern.

# Decentralized identity in OKP4 Protocol
Expand Down
14 changes: 7 additions & 7 deletions docs/academy/describe-resource.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The OKP4 Protocol can provide you keys (also called a wallet) and DID. A key pai
When creating a wallet, you're typically provided with a mnemonic consisting of 12, 24, or sometimes more words. This mnemonic acts as a human-readable representation of the underlying cryptographic information. It is easier to remember and write down than the complex numbers and characters representing the private key.
The mnemonic serves as a backup mechanism for the wallet. You can regenerate the key pair by inputting the mnemonic into any compatible wallet software to recover access to your funds.

Here, we dont create a wallet for cryptocurrency storage but for secure storage of identifiers: A wallet can securely store digital identifiers, such as proofs of identity, certificates, or other personal identification information.
Here, we don't create a wallet for cryptocurrency storage but for secure storage of identifiers: A wallet can securely store digital identifiers, such as proofs of identity, certificates, or other personal identification information.

:::danger
A keyring is a secure software utility designed to store and manage credentials, such as passwords, cryptographic keys, and API tokens, in a centralized and encrypted form. `--keyring-backend test` is a command parameter used to configure a keyring in test mode, which is helpful for development and testing but not for applications where private key security is a major concern. Be careful; this keyring is unsafe as the private keys are unencrypted on the file system.
Expand Down Expand Up @@ -104,7 +104,7 @@ For the dataset, instantiate the template [credential-dataset-description](https
For the service, instantiate the template [credential-digital-service-description](https://github.com/okp4/ontology/blob/main/src/example/digital-service/ipfs-digital-service-description.jsonld).

:::info
Would you like to describe your dataset with other properties? You can create your template of credentials. Dont directly add these properties in the DatasetDescriptionCredential as defined in the Ontology.
Would you like to describe your dataset with other properties? You can create your template of credentials. Don't directly add these properties in the DatasetDescriptionCredential as defined in the Ontology.
:::

### Description of the dataset
Expand All @@ -121,7 +121,7 @@ Here are the following metadata of the dataset [Crime Data from 2020 to Present]
| Temporal coverage | 2020 to Present |
| Topic | Security |

Lets fill in the template.
Let's fill in the template.

```json
{
Expand Down Expand Up @@ -223,7 +223,7 @@ Fields to modify:
- `hasPublisher': fill in the name of the entity primarily responsible for making the Digital Service available
- `hasTag`: fill in a list of tags
- `hasTitle`: fill in the title of the service
- `hasWebpage`: fill in the URL of the services webpage
- `hasWebpage`: fill in the URL of the service's webpage
- `id` (issuer): copy the did:key of the issuer
- `name`: put the issuer's name (string).

Expand All @@ -249,7 +249,7 @@ The OKP4 blockchain can only register VCs in N-Quads format. Then, you must conv

## Step 4: Register the credentials in the blockchain

The final step is to register the VCs in the OKP4 blockchain by submitting them to the Dataverse smart contract. Its the role of the Registrant (who can be the Holder or another entity).
The final step is to register the VCs in the OKP4 blockchain by submitting them to the Dataverse smart contract. It's the role of the Registrant (who can be the Holder or another entity).

:::info
Note that as you interact with the OKP4 blockchain, you must pay fees in $KNOW at each transaction.
Expand All @@ -270,5 +270,5 @@ The Protocol will check the signature and if the public key corresponds to the p
The command returns the hash of the transaction. You can find more details of this transaction in the [Explorer](https://explore.okp4.network/). Select the network (Currently Drunemeton-Testnet), click on the Search icon, and paste the transaction hash.

:::warning
Remember, the Resource Governance VC ensures the existence of a resource in the protocol: a resource or zone exists in the protocol only if governance is attached to it. Lets do it on the next page.
:::
Remember, the Resource Governance VC ensures the existence of a resource in the protocol: a resource or zone exists in the protocol only if governance is attached to it. Let's do it on the next page.
:::
14 changes: 7 additions & 7 deletions docs/academy/describe-zone.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A [zone](https://docs.okp4.network/whitepaper/solution#zone-overview) is a conce

All the workflows initiated within the OKP4 protocol must be defined in the context of a specific Zone. When the workflow is submitted, the protocol will check if all rules of the zone and of the engaged resources are respected and will apply the business model of the zone.

Lets see how to describe and register a zone in the OKP4 Protocol. Here are the four steps involved:
Let's see how to describe and register a zone in the OKP4 Protocol. Here are the four steps involved:

<center>
<img src="/img/content/academy/describe-resource-1.webp" alt="Steps to describe a resource in the Dataverse" style={{ maxHeight: "340px" }}></img>
Expand All @@ -30,7 +30,7 @@ The OKP4 Protocol can provide you keys (also called a wallet) and DID. A key pai
When creating a wallet, you're typically provided with a mnemonic consisting of 12, 24, or sometimes more words. This mnemonic acts as a human-readable representation of the underlying cryptographic information. It is easier to remember and write down than the complex numbers and characters representing the private key.
The mnemonic serves as a backup mechanism for the wallet. You can regenerate the key pair by inputting the mnemonic into any compatible wallet software to recover access to your funds.

Here, we dont create a wallet for cryptocurrency storage but for secure storage of identifiers: A wallet can securely store digital identifiers, such as proofs of identity, certificates, or other personal identification information.
Here, we don't create a wallet for cryptocurrency storage but for secure storage of identifiers: A wallet can securely store digital identifiers, such as proofs of identity, certificates, or other personal identification information.

:::danger
A keyring is a secure software utility designed to store and manage credentials, such as passwords, cryptographic keys, and API tokens, in a centralized and encrypted form. `--keyring-backend test` is a command used to configure a keyring in test mode, which is helpful for development and testing but not for applications where private key security is a major concern. Be careful; this keyring is unsafe as the private keys are unencrypted on the file system.
Expand Down Expand Up @@ -98,7 +98,7 @@ Find the credential templates you need in the [Ontology documentation](https://d
For the zone, instantiate the template [credential-zone-description](https://github.com/okp4/ontology/blob/main/src/example/zone/collab-ai-zone-description.jsonld).

:::info
Would you like to describe your zone with other properties? You can create your template of credentials. Dont directly add these properties in the ZoneDescriptionCredential as defined in the Ontology.
Would you like to describe your zone with other properties? You can create your template of credentials. Don't directly add these properties in the ZoneDescriptionCredential as defined in the Ontology.
:::

### Description of the Zone
Expand All @@ -112,7 +112,7 @@ Here are the following metadata of the zone Collaborative AI Zone
| Tags | AI, Collaboration, Machine learning |
| Topic | Other |

Lets fill in the template.
Let's fill in the template.

```json
{
Expand Down Expand Up @@ -178,7 +178,7 @@ The OKP4 blockchain can only register VCs in N-Quads format. Then, you must conv

## Step 4: Register the credentials in the blockchain

The final step is to register the VCs in the OKP4 blockchain by submitting them to the Dataverse smart contract. Its the role of the Registrant (who can be the Holder or another entity).
The final step is to register the VCs in the OKP4 blockchain by submitting them to the Dataverse smart contract. It's the role of the Registrant (who can be the Holder or another entity).

:::info
Note that as you interact with the OKP4 blockchain, you must pay fees in $KNOW at each transaction.
Expand All @@ -199,5 +199,5 @@ The Protocol will check the signature and if the public key corresponds to the p
The command returns the hash of the transaction. You can find more details of this transaction in the [Explorer](https://explore.okp4.network/). Select the network (Currently Drunemeton-Testnet), click on the Search icon, and paste the transaction hash.

:::warning
Remember, the Resource Governance VC ensures the existence of a resource in the protocol: a resource or zone exists in the protocol only if governance is attached to it. Lets do it on the next page.
:::
Remember, the Resource Governance VC ensures the existence of a resource in the protocol: a resource or zone exists in the protocol only if governance is attached to it. Let's do it on the next page.
:::
2 changes: 1 addition & 1 deletion docs/academy/resource-governance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ The VC is now in the hands of the Holder. Note that it is possible that the Issu

The OKP4 blockchain can only register VCs in N-Quads format. Then, you must convert the jsonld files in N-Quads. You can use this tool: https://transform.tools/jsonld-to-nquads .

The final step is to register the VCs in the OKP4 blockchain by submitting them to the Dataverse smart contract. Its the role of the Registrant (who can be the Holder or another entity).
The final step is to register the VCs in the OKP4 blockchain by submitting them to the Dataverse smart contract. It's the role of the Registrant (who can be the Holder or another entity).

:::info
Note that as you interact with the OKP4 blockchain, you must pay fees in $KNOW at each transaction.
Expand Down
4 changes: 2 additions & 2 deletions docs/academy/rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The OKP4 protocol acknowledges the dynamic nature of resource management. Rules

OKP4 rules are not isolated entities; they can interact with one another. Understanding and defining inter-rule relationships is a powerful aspect of OKP4's flexibility. For example, you can establish dependencies between rules, ensuring that certain conditions must be met before others come into effect.

The ability to define rules is a pivotal feature of the OKP4 protocol, offering an unprecedented level of control and customization. By leveraging these rules, participants can create diverse applications and ecosystems, each with unique governance and operational dynamics. This flexibility is central to OKP4s vision of fostering a decentralized, collaborative, and innovative digital resource environment.
The ability to define rules is a pivotal feature of the OKP4 protocol, offering an unprecedented level of control and customization. By leveraging these rules, participants can create diverse applications and ecosystems, each with unique governance and operational dynamics. This flexibility is central to OKP4's vision of fostering a decentralized, collaborative, and innovative digital resource environment.

## Prolog: Turing complete logical and declarative programming language

Expand Down Expand Up @@ -198,7 +198,7 @@ Given the interconnected nature of resources and their rules, OKP4 acknowledges

OKP4 places a premium on transparency in resource governance. Resource consents are designed to be transparent and auditable, allowing users and stakeholders to understand how each resource is governed. This transparency fosters trust and contributes to the overall security and accountability within the OKP4 ecosystem.

**7. Lets practice**
**7. Let's practice**

Let's consider a simple example of rules written in Prolog for a hypothetical resource-sharing scenario within the OKP4 context. In this example, we'll create rules for granting access to a specific dataset based on user roles and temporal constraints.

Expand Down
Loading

0 comments on commit 4192cdb

Please sign in to comment.