regen-network / regen-registry-standards

:seedling: RDF and SHACL schemas for Regen Registry
4 stars 1 forks source link

Add additional fields to Project Page metadata #83

Open wgardiner opened 1 month ago

wgardiner commented 1 month ago

To enable implementation of third-party marketplaces we need to support additional metadata. Below is an example of the fields I propose adding to enable the implementation of the design here

    "regen:hasComplianceCredits": true,
    "regen:bioregion": ['amazon'], // 'amazon', 'andes', 'carribean', 'orinoco', 'pacific'
    "regen:biomeType": [],
    "regen:watershed": ['cauqua'],
    "regen:subWatershed": [],
    "regen:ecosystemType": ['cloud forest'], // 'cloud forest', 'tropical savannah', 'tropical dry forest', 'tropical forest'
    "regen:environmentalAuthority": {
        "@type": "schema:Organization",
        "schema:name": "Corantioquia",
    },
    "regen:admininstrativeArea": { // edit: added
        "@type": "schema:AdministrativeArea",
        "schema:name": "Antiquoa"
    },
    "regen:offchainCreditsInfo": {
        "regen:creditsRegistered": {
            "qudt:unit": "unit:HA",
            "qudt:numericValue": 1000
        },
        "regen:creditsAvailable": {
            "qudt:unit": "unit:HA",
            "qudt:numericValue": 900
        },
        "regen:creditsRetired": {
            "qudt:unit": "unit:HA",
            "qudt:numericValue": 100
        },
    }

Additional thoughts:

blushi commented 1 month ago

Looks good.

One question regarding regen:offchainCreditsInfo naming, do we expect those credits to always be compliance credits or could that be something else, which would explain why we use a more generic term offchain rather than compliance?

What about the TEBU factors related data, as show on https://www.figma.com/design/brkxGV5qNOkZUp0YQl1cxO/Terrasos-Phase-1?node-id=717-90878&node-type=frame&t=KdlrWtmX6iOUw9fr-0 ? I guess description/labels could be stored in sanity (like "Ecosystem with declining areas, severe degradation, and disrupted processes facing a very high collapse risk.") but the actual values should probably be in the project metadata as well.

Also looking at the compliance related info, I think we're missing "department" (https://www.figma.com/design/brkxGV5qNOkZUp0YQl1cxO/Terrasos-Phase-1?node-id=661-81286&node-type=frame&t=KdlrWtmX6iOUw9fr-0)

Last, I know we are using schema.org quite extensively in our existing project metadata but we wanted to rather move to using DCMI (like we did for data post) so not entirely sure if we should keep using it here.

wgardiner commented 1 month ago

@blushi Yes, the reason I named it regen:offchainCreditsInfo was to generalize, because in the future there's no reason we couldn't have on chain compliance credits, and Cory mentioned that Terrasos may want this at some point. This way it's decoupled from the type of credit, it's just indicating that inventory is not managed on chain.

Thanks for catching the missing Department field, I updated my original example to include it. I'll follow up with a revised example that includes the TEBU fields, I missed those on my first pass.

Regarding Schema.org versus alternatives I think it depends on the data that we're representing. For original content or data I see value in using ontologies and vocabularies that provide flexibility and facilitate collaboration with others, which seems to be the argument made in the discussion of Data Posts. I don't see a reason to eliminate use of Schema.org in appropriate situations, however.

I'm offering to use Schema.org ontologies in two places:

  1. regen:environmentalAuthority: here I think Schema.org Organization offers a convenient structure that's well defined and widely used, we could alternatively use FOAF Organization, DBPedia Organization, or W3C Organization. Dublin Core doesn't seem to have a concept of an Organization, but we could also choose to use the more abstract dcterms:Agent.
  2. regen:administrativeArea: here I proposed Schema.org AdministrativeArea, but DBPedia AdministrativeRegion also feels appropriate.
wgardiner commented 1 month ago

Here's a revised version of the additional Project Page metadata

{
    "regen:hasComplianceCredits": true,
    "regen:bioregion": ["regen:Amazon"], // as terms? "regen:Amazon", "regen:Andes", "regen:Carribean", "regen:Orinoco", "regen:Pacific"
    "regen:biomeType": [], // define enum of type terms
    "regen:watershed": ["Cauqua"], 
    "regen:subWatershed": [],
    "regen:ecosystemType": ["regen:CloudForest"], // 'regen:CloudForest', 'regen:TropicalSavannah', 'regen:TropicalDryForest', 'regen:TropicalForest', etc
    "regen:environmentalAuthority": {
        "@type": "schema:Organization",
        "schema:name": "Corantioquia",
    },
    "regen:offchainCreditsInfo": {
        "regen:creditsRegistered": {
            "qudt:unit": "unit:HA",
            "qudt:numericValue": 1000
        },
        "regen:creditsAvailable": {
            "qudt:unit": "unit:HA",
            "qudt:numericValue": 900
        },
        "regen:creditsRetired": {
            "qudt:unit": "unit:HA",
            "qudt:numericValue": 100
        },
    },

    // Additional data for populating the TEBU Factors section

    "regen:projectDuration": {
        "xsd:duration": "P10Y"
    },
    "regen:conservationStatus": "iucn:Endangered", // iucn:Collapsed, iucn:Endangered, iucn:Vulnerable, iucn:NearThreatened, iucn:LeastConcern, iucn:DataDeficient, iucn:NotEvaluated
    "regen:ecologicalConnectivityIndex": {
        "qudt:unit": "unit:Dimensionless",
        "qudt:numericValue": 88
    },
    "regen:socialCulturalIndex": {
        "qudt:unit": "unit:Dimensionless",
        "qudt:numericValue": 0.2,
    },
    "regen:managementAreas": [
        {
            "regen:activity": ["regen:Conservation"], // https://daf2e860.regen-data-standards.pages.dev/activity/conservation/
            "dcterms:extent": {
                "qudt:unit": "unit:HA",
                "qudt:numericValue": 50
            }
        },
        {
            "regen:activity": ["regen:EcosystemRestoration"], // https://daf2e860.regen-data-standards.pages.dev/activity/ecosystemrestoration/
            "dcterms:extent": {
                "qudt:unit": "unit:HA",
                "qudt:numericValue": 50
            }
        }
    ]
}

Changes to previous fields:

New fields for TEBU Factors section:

blushi commented 1 month ago

Nice work!

Just a few comments:

Not sure if that makes sense to have regen:bioregion as a term from regen schema, although I agree it would be relevant for regen:ecosystemType. The only thing is that the existing metadata we have that are using regen:ecosystemType just use simple strings but maybe that could work as long as both types of values are well documented.

For durations, we've been using schema:Duration type historically https://schema.org/Duration I don't have a preference over one or the other but I think we should be consistent as much as possible or make sure such differences are well justified and documented.

Does unit:Dimensionless refers to https://qudt.org/vocab/quantitykind/Dimensionless? I think now that we have a good start for these additional metadata fields, it would make sense to provide the @context as well.

wgardiner commented 1 month ago

I've written up a LinkML schema yaml and example data for the proposed Terrasos fields and used them to generate this JSON-LD example output with context. Here's my PR

I changed bioregion to be a string, switched duration to schema:Duration, and organization to regen:Organization

{
  "id": "http://dev.app.regen.com/projects/38",
  "environmentalAuthority": {
    "name": "Corantioquia",
    "url": "http://corantioquia.gov.co/"
  },
  "marketType": "rfs:ComplianceMarket",
  "bioregion": [
    "Amazon Basin"
  ],
  "biomeType": [
    "TropicalForest"
  ],
  "watershed": [
    "Amazon River"
  ],
  "subWatershed": [
    "Upper Amazon"
  ],
  "ecosystemType": [
    "rfs:CloudForest"
  ],
  "offchainCreditsInfo": {
    "creditsRegistered": {
      "numericValue": 1000.0,
      "unit": "unit:HA"
    },
    "creditsAvailable": {
      "numericValue": 800.0,
      "unit": "unit:HA"
    },
    "creditsRetired": {
      "numericValue": 200.0,
      "unit": "unit:HA"
    }
  },
  "projectDuration": "P1Y",
  "projectDurationMinimum": "P6M",
  "projectDurationMaximum": "P2Y",
  "managementAreas": [
    {
      "activity": [
        "rfs:Conservation"
      ],
      "extent": {
        "numericValue": 120.0,
        "unit": "unit:HA"
      }
    },
    {
      "activity": [
        "rfs:EcosystemRestoration"
      ],
      "extent": {
        "numericValue": 220.0,
        "unit": "unit:HA"
      }
    }
  ],
  "ecologicalConnectivityIndex": {
    "numericValue": 75.5,
    "unit": "unit:UNITLESS"
  },
  "socialCulturalIndex": {
    "numericValue": 85.0,
    "unit": "unit:UNITLESS"
  },
  "administrativeArea": {
    "name": "Antioquia"
  },
  "@type": "ProjectPage",
  "@context": {
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "dcterms": "http://purl.org/dc/terms/",
    "linkml": "https://w3id.org/linkml/",
    "qudt": "http://qudt.org/schema/qudt/",
    "rfs": "https://framework.regen.network/schema/",
    "schema": "http://schema.org/",
    "skos": "http://www.w3.org/2004/02/skos/core#",
    "unit": {
      "@id": "qudt:unit"
    },
    "@vocab": "https://framework.regen.network/schema/",
    "activity": {
      "@context": {
        "text": "skos:notation",
        "description": "skos:prefLabel",
        "meaning": "@id"
      },
      "@id": "activity"
    },
    "administrativeArea": {
      "@type": "@id",
      "@id": "schema:AdministrativeArea"
    },
    "biomeType": {
      "@id": "biomeType"
    },
    "bioregion": {
      "@id": "bioregion"
    },
    "ecologicalConnectivityIndex": {
      "@type": "@id",
      "@id": "ecologicalConnectivityIndex"
    },
    "ecosystemType": {
      "@context": {
        "text": "skos:notation",
        "description": "skos:prefLabel",
        "meaning": "@id"
      },
      "@id": "ecosystemType"
    },
    "environmentalAuthority": {
      "@type": "@id",
      "@id": "environmentalAuthority"
    },
    "extent": {
      "@type": "@id",
      "@id": "dcterms:extent"
    },
    "id": "@id",
    "managementAreas": {
      "@type": "@id",
      "@id": "managementAreas"
    },
    "marketType": {
      "@context": {
        "text": "skos:notation",
        "description": "skos:prefLabel",
        "meaning": "@id"
      },
      "@id": "marketType"
    },
    "name": {
      "@id": "schema:name"
    },
    "offchainCreditsInfo": {
      "@type": "@id",
      "@id": "offchainCreditsInfo"
    },
    "creditsAvailable": {
      "@type": "@id",
      "@id": "creditsAvailable"
    },
    "creditsRegistered": {
      "@type": "@id",
      "@id": "creditsRegistered"
    },
    "creditsRetired": {
      "@type": "@id",
      "@id": "creditsRetired"
    },
    "projectDuration": {
      "@id": "projectDuration"
    },
    "projectDurationMaximum": {
      "@id": "projectDurationMaximum"
    },
    "projectDurationMinimum": {
      "@id": "projectDurationMinimum"
    },
    "numericValue": {
      "@type": "xsd:float",
      "@id": "qudt:numericValue"
    },
    "showOnProjectPage": {
      "@type": "xsd:boolean",
      "@id": "showOnProjectPage"
    },
    "socialCulturalIndex": {
      "@type": "@id",
      "@id": "socialCulturalIndex"
    },
    "subWatershed": {
      "@id": "subWatershed"
    },
    "url": {
      "@id": "schema:url"
    },
    "watershed": {
      "@id": "watershed"
    },
    "AdministrativeArea": {
      "@id": "schema:AdministrativeArea"
    },
    "ManagementArea": {
      "@id": "ManagementArea"
    },
    "OffchainCreditsInfo": {
      "@id": "OffchainCreditsInfo"
    },
    "Organization": {
      "@id": "Organization"
    },
    "ProjectPage": {
      "@id": "ProjectPage"
    },
    "QuantityValue": {
      "@id": "qudt:QuantityValue"
    }
  }
}
blushi commented 1 month ago

Looks good, could you recreate your PR now that @paul121's one has been merged?

wgardiner commented 1 month ago

Sure thing, I just recreated the PR here