import { Schema } from "shexj"; /** * ============================================================================= * contactSchema: ShexJ Schema for contact * ============================================================================= */ export const contactSchema: Schema = { type: "Schema", shapes: [ { id: "did:ng:n:g:x:social:contact#NGSocialContact", type: "ShapeDecl", shapeExpr: { type: "Shape", expression: { type: "EachOf", expressions: [ { type: "TripleConstraint", predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", valueExpr: { type: "NodeConstraint", values: ["http://www.w3.org/2006/vcard/ns#Individual"], }, annotations: [ { type: "Annotation", predicate: "http://www.w3.org/2000/01/rdf-schema#comment", object: { value: "Defines the node as an Individual (from vcard)", }, }, ], }, { type: "TripleConstraint", predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", valueExpr: { type: "NodeConstraint", values: ["http://schema.org/Person"], }, annotations: [ { type: "Annotation", predicate: "http://www.w3.org/2000/01/rdf-schema#comment", object: { value: "Defines the node as a Person (from Schema.org)", }, }, ], }, { type: "TripleConstraint", predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", valueExpr: { type: "NodeConstraint", values: ["http://xmlns.com/foaf/0.1/Person"], }, annotations: [ { type: "Annotation", predicate: "http://www.w3.org/2000/01/rdf-schema#comment", object: { value: "Defines the node as a Person (from foaf)", }, }, ], }, { type: "TripleConstraint", predicate: "http://www.w3.org/2006/vcard/ns#fn", valueExpr: { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, min: 0, max: 1, annotations: [ { type: "Annotation", predicate: "http://www.w3.org/2000/01/rdf-schema#comment", object: { value: "The formatted name of a person. Example: John Smith", }, }, ], }, { type: "TripleConstraint", predicate: "http://www.w3.org/2006/vcard/ns#hasEmail", valueExpr: { type: "NodeConstraint", datatype: "http://www.w3.org/2001/XMLSchema#string", }, min: 0, max: 1, annotations: [ { type: "Annotation", predicate: "http://www.w3.org/2000/01/rdf-schema#comment", object: { value: "The person's email.", }, }, ], }, ], }, extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"], }, }, ], };