Skip to content

Commit

Permalink
Relaxed the constraints on verification materials
Browse files Browse the repository at this point in the history
  • Loading branch information
iherman committed Jan 25, 2021
1 parent 5e0287f commit 03947e7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 20 deletions.
25 changes: 19 additions & 6 deletions vocabs/DID-core-shape-v1.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"@id": "http://www.w3.org/ns/shacl#xone",
"@type": "@id"
},
"not": {
"@id": "http://www.w3.org/ns/shacl#not",
"@type": "@id"
},
"property": {
"@id": "http://www.w3.org/ns/shacl#property",
"@type": "@id"
Expand Down Expand Up @@ -149,7 +153,8 @@
"@id": "_:b2",
"datatype": "xsd:string",
"nodeKind": "sh:Literal",
"path": "did:publicKeyBase58"
"path": "did:publicKeyBase58",
"sh:maxCount": 1
},
{
"@id": "_:b20",
Expand Down Expand Up @@ -181,18 +186,26 @@
"did:keyAgreement",
"did:verificationMethod"
],
"xone": {
"@list": [
"_:b20",
"_:b19"
"not": {
"@type": "sh:NodeShape",
"property": [
{
"path": "did:publicKeyBase58",
"sh:minCount" : 1
},
{
"path": "did:publicKeyJwk",
"sh:minCount" : 1
}
]
}
},
{
"@id": "_:b6",
"datatype": "rdf:JSON",
"nodeKind": "sh:Literal",
"path": "did:publicKeyJwk"
"path": "did:publicKeyJwk",
"sh:maxCount": 1
},
{
"@id": "_:b7",
Expand Down
4 changes: 2 additions & 2 deletions vocabs/DID-core-shape-v1.shex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This shape expression is hosted at https://www.w3.org/ns/did/shex/v1
#
# You can run this (using https://www.npmjs.com/package/shex/v/0.5.5), for example, with:
# shex -x DID-core-shape.shex -d shape_test.ttl -n did:ex:12345 -s ObjectShape
# shex -x DID-core-shape-v1.shex -d shape_test.ttl -n did:ex:12345 -s ObjectShape
#

#
Expand All @@ -14,7 +14,7 @@ _:ControllerShape IRI /^did:[a-z0-9]+:[a-zA-Z0-9.-_:]+/
_:VerificationMethodShape IRI {
did:controller @_:ControllerShape+ ;
rdf:type IRI+ ;
(did:publicKeyJwk rdf:JSON {0,1} | did:publicKeyBase58 LITERAL {0,1} );
( did:publicKeyJwk rdf:JSON {0,1} | did:publicKeyBase58 LITERAL {0,1} ) {0,1};
}

_:ServiceShape IRI {
Expand Down
25 changes: 13 additions & 12 deletions vocabs/DID-core-shape-v1.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ _:VerificationMethodShape a sh:NodeShape ;
sh:path did:publicKeyJwk ;
sh:nodeKind sh:Literal ;
sh:datatype rdf:JSON ;
sh:maxCount 1;
],[
sh:path did:publicKeyBase58 ;
sh:nodeKind sh:Literal ;
sh:datatype xsd:string ;
sh:maxCount 1;
],[
sh:path did:controller ;
# A controller must be identified with a DID...
Expand All @@ -90,19 +92,18 @@ _:VerificationMethodShape a sh:NodeShape ;
sh:path rdf:type ;
sh:nodeKind sh:IRI ;
sh:minCount 1 ;
];
sh:not [
a sh:NodeShape ;
sh:property
[
sh:path did:publicKeyBase58 ;
sh:minCount 1 ;
],[
sh:path did:publicKeyJwk ;
sh:minCount 1 ;
];
] ;
sh:xone (
[
sh:path did:publicKeyBase58 ;
sh:minCount 1 ;
sh:maxCount 1 ;
]
[
sh:path did:publicKeyJwk ;
sh:minCount 1 ;
sh:maxCount 1 ;
]
) ;
.

#######################################################################################
Expand Down

0 comments on commit 03947e7

Please sign in to comment.