Rust implementation of NextGraph, a Decentralized and local-first web 3.0 ecosystem
https://nextgraph.org
byzantine-fault-tolerancecrdtsdappsdecentralizede2eeeventual-consistencyjson-ldlocal-firstmarkdownocapoffline-firstp2pp2p-networkprivacy-protectionrdfrich-text-editorself-hostedsemantic-websparqlweb3collaboration
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.4 KiB
71 lines
2.4 KiB
import type { Schema } from "@nextgraph-monorepo/ng-shex-orm";
|
|
|
|
/**
|
|
* =============================================================================
|
|
* personShapeSchema: Schema for personShape
|
|
* =============================================================================
|
|
*/
|
|
export const personShapeSchema: Schema = {
|
|
"http://example.org/Person": {
|
|
iri: "http://example.org/Person",
|
|
predicates: [
|
|
{
|
|
type: "literal",
|
|
literalValue: ["http://example.org/Person"],
|
|
maxCardinality: 1,
|
|
minCardinality: 1,
|
|
iri: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
readablePredicate: "type",
|
|
},
|
|
{
|
|
type: "string",
|
|
maxCardinality: 1,
|
|
minCardinality: 1,
|
|
iri: "http://example.org/name",
|
|
readablePredicate: "name",
|
|
},
|
|
{
|
|
type: "nested",
|
|
nestedShape:
|
|
"http://example.org/Person||http://example.org/address",
|
|
maxCardinality: 1,
|
|
minCardinality: 1,
|
|
iri: "http://example.org/address",
|
|
readablePredicate: "address",
|
|
},
|
|
{
|
|
type: "boolean",
|
|
maxCardinality: 1,
|
|
minCardinality: 1,
|
|
iri: "http://example.org/hasChildren",
|
|
readablePredicate: "hasChildren",
|
|
},
|
|
{
|
|
type: "number",
|
|
maxCardinality: 1,
|
|
minCardinality: 1,
|
|
iri: "http://example.org/numberOfHouses",
|
|
readablePredicate: "numberOfHouses",
|
|
},
|
|
],
|
|
},
|
|
"http://example.org/Person||http://example.org/address": {
|
|
iri: "http://example.org/Person||http://example.org/address",
|
|
predicates: [
|
|
{
|
|
type: "string",
|
|
maxCardinality: 1,
|
|
minCardinality: 1,
|
|
iri: "http://example.org/street",
|
|
readablePredicate: "street",
|
|
},
|
|
{
|
|
type: "string",
|
|
maxCardinality: 1,
|
|
minCardinality: 1,
|
|
iri: "http://example.org/houseNumber",
|
|
readablePredicate: "houseNumber",
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|