Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions scripts/check-metadata-and-immutability-dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
check_metadata_and_immutability.py

Validates SHACL shapes for:
- Required metadata (rdfs:label, dct:created, vs:term_status)
- Required metadata (sh:name, dct:created, vs:term_status)
- Correct metadata formats
- Status validity
- Immutability rules (placeholder for future logic)
Expand All @@ -12,7 +12,7 @@
import sys
import glob
from rdflib import Graph, Namespace
from rdflib.namespace import RDF, RDFS
from rdflib.namespace import RDF

# Namespaces
SH = Namespace("http://www.w3.org/ns/shacl#")
Expand Down Expand Up @@ -49,18 +49,18 @@ def report_error(file, shape, property_name, message, value=None, expected=None)

def check_shape_metadata(g, file, shape_uri):

label = g.value(shape_uri, RDFS.label)
label = g.value(shape_uri, SH.name)
created = g.value(shape_uri, DCT.created)
status = g.value(shape_uri, VS.term_status)

# rdfs:label
# sh:name
if not label:
report_error(
file,
shape_uri,
"rdfs:label",
"Missing required label for SHACL NodeShape.",
expected="Human readable label e.g. rdfs:label \"Person Shape\""
"sh:name",
"Missing required name for SHACL NodeShape.",
expected="Human readable name e.g. sh:name \"Person Shape\""
)

# dct:created
Expand Down
10 changes: 5 additions & 5 deletions scripts/check-metadata-and-immutability-file.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import sys
from rdflib import Graph, Namespace
from rdflib.namespace import RDF, RDFS
from rdflib.namespace import RDF

# Namespaces
SH = Namespace("http://www.w3.org/ns/shacl#")
Expand All @@ -36,14 +36,14 @@ def report_error(file, shape, property_name, message, value=None, expected=None)


def check_shape_metadata(g, file, shape_uri):
label = g.value(shape_uri, RDFS.label)
label = g.value(shape_uri, SH.name)
created = g.value(shape_uri, DCT.created)
status = g.value(shape_uri, VS.term_status)

if not label:
report_error(file, shape_uri, "rdfs:label",
"Missing required label.",
expected="Human readable label")
report_error(file, shape_uri, "sh:name",
"Missing required name.",
expected="Human readable name")
if not created:
report_error(file, shape_uri, "dct:created",
"Creation date missing.",
Expand Down
12 changes: 6 additions & 6 deletions shapes/acp-access-control.ttl → shapes/acp_access_control.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
@prefix dct: <http://purl.org/dc/terms/> .
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .

@prefix acp-policy-shape: <https://solidproject.org/shapes/acp-policy#> .
@prefix acp_policy_shape: <https://solidproject.org/shapes/acp_policy#> .

@prefix acp-access-control-shape: <https://solidproject.org/shapes/acp-access-control#> .
@prefix acp_access_control_shape: <https://solidproject.org/shapes/acp_access_control#> .

acp-access-control-shape:AcpAccessControlShape a sh:NodeShape ;
acp_access_control_shape:AcpAccessControlShape a sh:NodeShape ;
dc:source <https://github.com/solid/object/blob/main/src/acp/AccessControl.ts> ;
prov:wasDerivedFrom <https://github.com/solid/object/blob/main/src/acp/AccessControl.ts> ;
sh:codeIdentifier "AcpAccessControl";
rdfs:label "ACP Access Control Shape";
sh:name "ACP Access Control Shape";
dct:created "2026-03-18"^^xsd:date ;
vs:term_status "testing";

sh:property [
sh:path acp:apply ;
sh:node acp-policy-shape:AcpPolicyShape ;
rdfs:label "apply";
sh:node acp_policy_shape:AcpPolicyShape ;
sh:name "apply";
sh:codeIdentifier "apply";
] .
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
@prefix dct: <http://purl.org/dc/terms/> .
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .

@prefix acp-access-control-shape: <https://solidproject.org/shapes/acp-access-control#> .
@prefix acp-access-control-resource-shape: <https://solidproject.org/shapes/acp-access-control-resource#> .
@prefix acp_access_control_shape: <https://solidproject.org/shapes/acp_access_control#> .
@prefix acp_access_control_resource_shape: <https://solidproject.org/shapes/acp_access_control_resource#> .

# Shape for AccessControlResource
acp-access-control-resource-shape:AcpAccessControlResourceShape a sh:NodeShape ;
acp_access_control_resource_shape:AcpAccessControlResourceShape a sh:NodeShape ;
dc:source <https://github.com/solid/object/blob/main/src/acp/AccessControlResource.ts> ;
prov:wasDerivedFrom <https://github.com/solid/object/blob/main/src/acp/AccessControlResource.ts> ;
sh:codeIdentifier "AccessControlResource";
rdfs:label "Access Control Resource Shape";
sh:name "Access Control Resource Shape";
dct:created "2026-03-18"^^xsd:date ;
vs:term_status "testing";

# accessControl: multiple AccessControl objects
sh:property [
sh:path acp:accessControl ;
sh:node acp-access-control-shape:AcpAccessControlShape ;
sh:node acp_access_control_shape:AcpAccessControlShape ;
sh:codeIdentifier "accessControl";
] ;

Expand Down
8 changes: 4 additions & 4 deletions shapes/acp-matcher.ttl → shapes/acp_matcher.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
@prefix dct: <http://purl.org/dc/terms/> .
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .

@prefix acp-matcher-shape: <https://solidproject.org/shapes/acp-matcher#> .
@prefix acp_matcher_shape: <https://solidproject.org/shapes/acp_matcher#> .

acp-matcher-shape:AcpMatcherShape a sh:NodeShape ;
acp_matcher_shape:AcpMatcherShape a sh:NodeShape ;
dc:source <https://github.com/solid/object/blob/main/src/acp/Matcher.ts> ;
prov:wasDerivedFrom <https://github.com/solid/object/blob/main/src/acp/Matcher.ts> ;
sh:codeIdentifier "AcpMatcher";
rdfs:label "ACP Matcher Shape";
sh:name "ACP Matcher Shape";
dct:created "2026-03-18"^^xsd:date ;
vs:term_status "testing";

sh:property [
sh:path acp:agent ;
sh:nodeKind sh:IRI ;
rdfs:label "agent";
sh:name "agent";
sh:codeIdentifier "agent";
] ;

Expand Down
14 changes: 7 additions & 7 deletions shapes/acp-policy.ttl → shapes/acp_policy.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
@prefix dct: <http://purl.org/dc/terms/> .
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .

@prefix acp-policy-shape: <https://solidproject.org/shapes/acp-policy#> .
@prefix acp-matcher-shape: <https://solidproject.org/shapes/acp-matcher#> .
@prefix acp_policy_shape: <https://solidproject.org/shapes/acp_policy#> .
@prefix acp_matcher_shape: <https://solidproject.org/shapes/acp_matcher#> .


acp-policy-shape:AcpPolicyShape a sh:NodeShape ;
acp_policy_shape:AcpPolicyShape a sh:NodeShape ;
dc:source <https://github.com/solid/object/blob/main/src/acp/AccessControl.ts> ;
prov:wasDerivedFrom <https://github.com/solid/object/blob/main/src/acp/AccessControl.ts> ;
sh:codeIdentifier "AccessControlPolicy";
rdfs:label "ACP Policy Shape";
sh:name "ACP Policy Shape";
dct:created "2026-03-18"^^xsd:date ;
vs:term_status "testing";

sh:property [
sh:path acp:allow ;
sh:nodeKind sh:IRI ;
rdfs:label "allow";
sh:name "allow";
sh:codeIdentifier "allow";
] ;

sh:property [
sh:path acp:anyOf ;
sh:node acp-matcher-shape:AcpMatcherShape;
rdfs:label "any of";
sh:node acp_matcher_shape:AcpMatcherShape;
sh:name "any of";
sh:codeIdentifier "anyOf";
] .
9 changes: 4 additions & 5 deletions shapes/acp-typed.ttl → shapes/acp_typed.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
@prefix acp-typed-shape: <https://solidproject.org/shapes/acp-typed#> .
@prefix acp_typed_shape: <https://solidproject.org/shapes/acp_typed#> .

acp-typed-shape:AcpTypedShape a sh:NodeShape ;
acp_typed_shape:AcpTypedShape a sh:NodeShape ;
dc:source <https://github.com/solid/object/blob/main/src/acp/AccessControl.ts> ;
prov:wasDerivedFrom <https://github.com/solid/object/blob/main/src/acp/AccessControl.ts> ;
sh:codeIdentifier "AccessControlPolicy";
rdfs:label "ACP Policy Shape";
sh:name "ACP Policy Shape";
dct:created "2026-03-18"^^xsd:date ;
vs:term_status "testing";

sh:property [
sh:path rdf:type ;
sh:nodeKind sh:IRI ;
rdfs:label "type";
sh:name "type";
sh:codeIdentifier "type";
]

Expand Down
19 changes: 8 additions & 11 deletions shapes/address.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

@prefix address_shape: <https://solidproject.org/shapes/address#> .

@prefix address-shape: <https://solidproject.org/shapes/address#> .



address-shape:AddressShape
rdfs:label "Address";
address_shape:AddressShape
sh:name "Address";
sh:targetClass vcard:Address;
a sh:NodeShape ;
sh:codeIdentifier "Address";
Expand All @@ -24,7 +21,7 @@ address-shape:AddressShape


sh:property [
rdfs:label "Street Address";
sh:name "Street Address";
sh:path vcard:street-address ;
sh:datatype xsd:string ;
sh:maxLength 128 ;
Expand All @@ -33,7 +30,7 @@ address-shape:AddressShape
] ;

sh:property [
rdfs:label "Locality";
sh:name "Locality";
sh:path vcard:locality ;
sh:datatype xsd:string ;
sh:maxLength 128 ;
Expand All @@ -42,7 +39,7 @@ address-shape:AddressShape
] ;

sh:property [
rdfs:label "Postal Code";
sh:name "Postal Code";
sh:path vcard:postal-code ;
sh:datatype xsd:string ;
sh:maxLength 25 ;
Expand All @@ -51,7 +48,7 @@ address-shape:AddressShape
] ;

sh:property [
rdfs:label "Region";
sh:name "Region";
sh:path vcard:region ;
sh:datatype xsd:string ;
sh:maxLength 128 ;
Expand All @@ -60,7 +57,7 @@ address-shape:AddressShape
] ;

sh:property [
rdfs:label "Country Name";
sh:name "Country Name";
sh:path vcard:country-name ;
sh:datatype xsd:string ;
sh:maxLength 128 ;
Expand Down
36 changes: 18 additions & 18 deletions shapes/address-book.ttl → shapes/address_book.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

@prefix address-book-shape: <https://solidproject.org/shapes/address-book#> .
@prefix address_book_shape: <https://solidproject.org/shapes/address_book#> .

address-book-shape:AddressBookShape a sh:NodeShape ;
rdfs:label "AddressBook";
address_book_shape:AddressBookShape a sh:NodeShape ;
sh:name "AddressBook";
sh:targetClass vcard:AddressBook ;
rdfs:comment "Represents a collection of vCard people and/or vCard groups" ;
rdfs:comment "This class is not part of vCard as defined by the IETF" ;
sh:description "Represents a collection of vCard people and/or vCard groups" ;
sh:description "This class is not part of vCard as defined by the IETF" ;
dct:created "2026-03-12"^^xsd:date ;
vs:term_status "testing" ;
prov:wasDerivedFrom <https://github.com/SolidOS/contacts-pane/blob/main/shapes/contacts-shapes.ttl> ;
Expand All @@ -22,26 +22,26 @@ address-book-shape:AddressBookShape a sh:NodeShape ;
sh:codeIdentifier "AddressBook";

sh:property [
rdfs:label "Formatted name";
sh:name "Formatted name";
sh:path vcard:fn ;
sh:datatype xsd:string;
sh:minCount 1;
sh:codeIdentifier "formattedName";
];
sh:property [
rdfs:label "Name Email Index" ;
rdfs:comment "Links an AddressBook to a document containing Individuals that appear in it" ;
rdfs:comment "This property is not part of vCard as defined by the IETF" ;
sh:name "Name Email Index" ;
sh:description "Links an AddressBook to a document containing Individuals that appear in it" ;
sh:description "This property is not part of vCard as defined by the IETF" ;
sh:path vcard:nameEmailIndex ;
sh:datatype xsd:anyURI;
sh:minCount 1;
sh:codeIdentifier "nameEmailIndex";
];

sh:property [
rdfs:label "Group Index" ;
rdfs:comment "Links an AddressBook to a document containing all its includesGroup properties" ;
rdfs:comment "This property is not part of vCard as defined by the IETF" ;
sh:name "Group Index" ;
sh:description "Links an AddressBook to a document containing all its includesGroup properties" ;
sh:description "This property is not part of vCard as defined by the IETF" ;
sh:path vcard:groupIndex ;
sh:datatype xsd:anyURI;
sh:minCount 1;
Expand All @@ -50,19 +50,19 @@ address-book-shape:AddressBookShape a sh:NodeShape ;
] ;

sh:property [
rdfs:label "Includes Group" ;
rdfs:comment "When included in the group index document of an AddressBook, adds the group to the AddressBook" ;
rdfs:comment "This property is not part of vCard as defined by the IETF" ;
sh:name "Includes Group" ;
sh:description "When included in the group index document of an AddressBook, adds the group to the AddressBook" ;
sh:description "This property is not part of vCard as defined by the IETF" ;
sh:path vcard:includesGroup ;
sh:datatype xsd:anyURI;
sh:codeIdentifier "includesGroup";

] ;

sh:property [
rdfs:label "in AddressBook" ;
rdfs:comment "Indicates that an Individual appears in an AddressBook" ;
rdfs:comment "This property is not part of vCard as defined by the IETF" ;
sh:name "in AddressBook" ;
sh:description "Indicates that an Individual appears in an AddressBook" ;
sh:description "This property is not part of vCard as defined by the IETF" ;
sh:path vcard:inAddressBook ; ## Inverse
sh:datatype xsd:anyURI;
sh:minCount 1;
Expand Down
Loading
Loading