-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current demo validates differently between shex and shacl (e.g. schema.org Event and Recipe samples) #42
Comments
@Gnomus042 any idea what is happening here? |
@ericprud and I took a look. There is a similar issue for 1st sample too (recipe). SHACL validation finds the interactionType property's value (http://schema.org/Comment) to fail. This fixes the example: "interactionStatistic": {
"@type": "InteractionCounter",
"interactionType": { "@type": "ConsumeAction" },
"userInteractionCount": "140"
}, // ...etc By contrast, ShEx validation doesn't complain. The official spec for interactiontype is that it has Action values, and is used on InteractionCounter. The current example (test 1) parses as a URI encoded as a string (this is dependent on schema.org context file and could potentially change). So the instance data looks like this. Something with an interactionType of some string.
Even if this was parsed as a URI, i.e.
....no type is declared so the validation (being somewhat closed world) should complain that we're not told this is some kind of Action. Why is ShEx not complaining? This specific issue seems to trace to the ShEx-generation code that populates validation/shex/raw_shapes directory. The SHACL and ShEx files generated from Schema.org's own definitions are organized in a type-centric way, so we find the generated rules for interactionType by looking for the type(s) that are schema:domainIncludes of this property. In fact, this is also puzzling. The only type where interactionType is expected is Action, and yet neither SHACL nor ShEx complain, despite it being used on InteractionCounter, which isn't an Action subtype. This needs investigation. Meanwhile, the values of interactionType: SHACL complains, ShEx doesn't. Hypothesis... In Action.shex in shex/raw_shapes we have this:
If we replace that final '*' with a '+' it may fix this for ShEx. SummaryInteractionCounter.shex is satisfied when it shouldn't be, because Action.shex doesn't require typing, since the 'a' line ends with '*' not '+'. Next steps
|
For the interactionType property, here is what schema.org release 14 says in the property definition:
|
Relaying from Aaron:
(I have verified this -- @danbri)
.
The text was updated successfully, but these errors were encountered: