StroemPhi / DefinedTerm_profile

A LinkML schema to define a profile for the DefinedTermSet class from Schema.org.
MIT License
0 stars 0 forks source link

Shacl validation error for the examples #3

Open sneumann opened 7 months ago

sneumann commented 7 months ago

Hi, I used the example https://github.com/StroemPhi/DefinedTerm_profile/blob/960f98a038bda228e343d6b5c558d4a4917e96e7/examples/DefinedTerm-001.json-ld and the Shacl https://github.com/StroemPhi/DefinedTerm_profile/blob/960f98a038bda228e343d6b5c558d4a4917e96e7/project/shacl/definedterm_profile.shacl.ttl in https://shacl.org/playground/ and got the following two validation issues:

[
    a sh:ValidationResult ;
    sh:resultSeverity sh:Violation ;
    sh:sourceConstraintComponent sh:ClassConstraintComponent ;
    sh:sourceShape _:n25 ;
    sh:focusNode <http://purl.obolibrary.org/obo/HP_0000271> ;
    sh:value <http://purl.obolibrary.org/obo/hp/releases/2023-10-09/hp-base.owl> ;
    sh:resultPath schema1:inDefinedTermSet ;
    sh:resultMessage "Value does not have class schema1:DefinedTermSet" ;
] .
[
    a sh:ValidationResult ;
    sh:resultSeverity sh:Violation ;
    sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
    sh:sourceShape _:n26 ;
    sh:focusNode <http://purl.obolibrary.org/obo/HP_0000271> ;
    sh:resultPath schema1:identifier ;
    sh:resultMessage "Less than 1 values" ;
] .

Yours, Steffen

StroemPhi commented 7 months ago

I assume that the first error is thrown, because the validator expects the input JSON-LD to rather look like this:

 "inDefinedTermSet": {
    "@type": "DefinedTermSet",
    "identifier": "http://purl.obolibrary.org/obo/hp/releases/2023-10-09/hp-base.owl",
    "name": "Human Phenotype Ontology"
  },

@sneumann could you try the validation with this type key/value added, please

StroemPhi commented 7 months ago

So besides the obove mentioned error of not having a type designator in the generated JSON-LD output, the other validation error you provided is linked to this linkml issue imo. In this issue it is acknowledged that the autogenerated SHACL is wrong.