Will Stardog Studio 'Remove Constraint' remove all constraints? I tried change shacl and failed. It seems to me 'Remove Constraint' does not remove all constraints, or did I make any mistake?
I am using Stardog Studio PC version, server side is stardog 7.6.2.
I download stardog-tutorials from github. Modify the sample shacl file: shacl/music_shacl.ttl:
- Add a 'sh:maxLength 100 ' constraint to NameShape. add constraint and load valid.ttl, which is success. Then cleanup: remove data and constraint;
- Then I change Nameshape shacl maxLength to 'sh:maxLength 5 ;'; add constraint and load valid.ttl again, failed, which is expected because maxLength is only 5; Then cleanup: remove constraint;
- Then I change Nameshape shacl maxLength back to 'sh:maxLength 100 ;' add constraint and load valid.ttl again, FAIL, why??? We just prove 100 is a valid constraint in prior step.
Did I missing anything???
I also did other tests in different order, it seems to me that as long as shacl fail, it will always fail. 'Remove Constraint' can not remove the failed shacl.
Here is the complete nameshape that I changed, the only thing change is add a maxLength;
:NameShape a sh:Shape ;
sh:property [
sh:path :name ;
sh:minCount 1 ;
sh:maxLength 100 ; ----> change back and forth to 5, 100;
sh:datatype xsd:string
] .
Here are the detail steps:
-
Goto GitHub - stardog-union/stardog-tutorials: Data files for the Stardog tutorials clone
-
create a new database, turn database offline then change properties transaction->Serizable; ICV guard mode enabled; turn on database;
-
'Add Data' Band schema from music/music_schema.ttl:
:Band a rdfs:Class ;
rdfs:label "Band" ;
rdfs:comment "A music group; that is, is a group of people creating and performing music together." ;
rdfs:subClassOf :Artist . -
Add 'sh:maxLength 100 ;' to NameShape to shacl/music_shacl.ttl; then add constraints;
-
load data shacl/valid.ttl; success, which is expected;
-
Remove data valid.ttl, remove constraint music_schema.ttl;
-
Modify maxLength to 'sh:maxLength 5 ;' to NameShape to shacl/music_shacl.ttl; then add constraints;
-
load data shacl/valid.ttl; fail, which is also expected;
-
Remove constraints
-
Modify back 'sh:maxLength 100 ;' to NameShape to shacl/music_shacl.ttl; then add constraints;
-
load data shacl/valid.ttl; fail. WHY???? We just prove maxLength 100 is perfect fine in prior step.