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.
169 lines
5.5 KiB
169 lines
5.5 KiB
import { Schema } from "shexj";
|
|
|
|
/**
|
|
* =============================================================================
|
|
* wacSchema: ShexJ Schema for wac
|
|
* =============================================================================
|
|
*/
|
|
export const wacSchema: Schema = {
|
|
type: "Schema",
|
|
shapes: [
|
|
{
|
|
id: "http://www.w3.org/ns/auth/acls#Authorization",
|
|
type: "ShapeDecl",
|
|
shapeExpr: {
|
|
type: "Shape",
|
|
expression: {
|
|
id: "http://www.w3.org/ns/auth/acls#AuthorizationShape",
|
|
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/ns/auth/acl#Authorization"],
|
|
},
|
|
annotations: [
|
|
{
|
|
type: "Annotation",
|
|
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
object: {
|
|
value: "Denotes this as an acl:Authorization",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: "TripleConstraint",
|
|
predicate: "http://www.w3.org/ns/auth/acl#accessTo",
|
|
valueExpr: {
|
|
type: "NodeConstraint",
|
|
nodeKind: "iri",
|
|
},
|
|
min: 0,
|
|
max: 1,
|
|
annotations: [
|
|
{
|
|
type: "Annotation",
|
|
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
object: {
|
|
value: "The subject of this authorization",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: "TripleConstraint",
|
|
predicate: "http://www.w3.org/ns/auth/acl#default",
|
|
valueExpr: {
|
|
type: "NodeConstraint",
|
|
nodeKind: "iri",
|
|
},
|
|
min: 0,
|
|
max: 1,
|
|
annotations: [
|
|
{
|
|
type: "Annotation",
|
|
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
object: {
|
|
value: "The container subject of this authorization",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: "TripleConstraint",
|
|
predicate: "http://www.w3.org/ns/auth/acl#agent",
|
|
valueExpr: {
|
|
type: "NodeConstraint",
|
|
nodeKind: "iri",
|
|
},
|
|
min: 0,
|
|
max: -1,
|
|
annotations: [
|
|
{
|
|
type: "Annotation",
|
|
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
object: {
|
|
value:
|
|
"An agent is a person, social entity or software identified by a URI, e.g., a WebID denotes an agent",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: "TripleConstraint",
|
|
predicate: "http://www.w3.org/ns/auth/acl#agentGroup",
|
|
valueExpr: {
|
|
type: "NodeConstraint",
|
|
nodeKind: "iri",
|
|
},
|
|
min: 0,
|
|
max: -1,
|
|
annotations: [
|
|
{
|
|
type: "Annotation",
|
|
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
object: {
|
|
value:
|
|
"Denotes a group of agents being given the access permission",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: "TripleConstraint",
|
|
predicate: "http://www.w3.org/ns/auth/acl#agentClass",
|
|
valueExpr: {
|
|
type: "NodeConstraint",
|
|
values: [
|
|
"http://www.w3.org/ns/auth/acl#AuthenticatedAgent",
|
|
"http://xmlns.com/foaf/0.1/Agent",
|
|
],
|
|
},
|
|
min: 0,
|
|
max: -1,
|
|
annotations: [
|
|
{
|
|
type: "Annotation",
|
|
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
object: {
|
|
value:
|
|
"An agent class is a class of persons or entities identified by a URI.",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: "TripleConstraint",
|
|
predicate: "http://www.w3.org/ns/auth/acl#mode",
|
|
valueExpr: {
|
|
type: "NodeConstraint",
|
|
values: [
|
|
"http://www.w3.org/ns/auth/acl#Read",
|
|
"http://www.w3.org/ns/auth/acl#Write",
|
|
"http://www.w3.org/ns/auth/acl#Append",
|
|
"http://www.w3.org/ns/auth/acl#Control",
|
|
],
|
|
},
|
|
min: 0,
|
|
max: -1,
|
|
annotations: [
|
|
{
|
|
type: "Annotation",
|
|
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
object: {
|
|
value:
|
|
"Denotes a class of operations that the agents can perform on a resource.",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"],
|
|
},
|
|
},
|
|
],
|
|
};
|
|
|