Skip to content
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

SHACL property shapes for action:actionStatus on action:ActionLifecycle are incorrect #442

Closed
2 of 4 tasks
sbarnum opened this issue Aug 10, 2022 · 3 comments
Closed
2 of 4 tasks
Labels
Milestone

Comments

@sbarnum
Copy link
Contributor

sbarnum commented Aug 10, 2022

Bug description

The current SHACL property shape for action:actionStatus on action:ActionLifecycle is

[
	sh:datatype vocabulary:ActionStatusTypeVocab ;
	sh:maxCount "0"^^xsd:integer ;
	sh:nodeKind sh:Literal ;
	sh:path action:actionStatus ;
]

This is the old style.
It should be the following like it is on action:Action

[
	sh:datatype vocabulary:ActionStatusTypeVocab ;
	sh:message "Value is outside the default vocabulary ActionStatusTypeVocab." ;
	sh:path action:actionStatus ;
	sh:severity sh:Info ;
] ,
[
	sh:maxCount "1"^^xsd:integer ;
	sh:nodeKind sh:Literal ;
	sh:or (
		[
			sh:datatype vocabulary:ActionStatusTypeVocab ;
		]
		[
			sh:datatype xsd:string ;
		]
	) ;
	sh:path action:actionStatus ;
] ,
[
	sh:message "Value is not member of the vocabulary ActionStatusTypeVocab." ;
	sh:or (
		[
			sh:datatype vocabulary:ActionStatusTypeVocab ;
			sh:in vocabulary:ActionStatusTypeVocab-members ;
		]
		[
			sh:datatype xsd:string ;
		]
	) ;
	sh:path action:actionStatus ;
]

Steps to reproduce

Any use of action:actionStatus on action:ActionLifecyle that is not a valid string member of ActionStatusTypeVocab should demonstrate the bug.

Coordination

  • Tracking in Jira ticket OC-262
  • Administrative review completed
  • Implementation has not been merged into develop
  • Milestone linked
  • Documentation logged in pending release page
@sbarnum sbarnum added the bug label Aug 10, 2022
@kchason
Copy link
Contributor

kchason commented Aug 17, 2022

If I understand this bug properly, this looks to have already been implemented in c22b4bae.

https://github.com/ucoProject/UCO/blob/master/ontology/action/action.ttl#L106

@ajnelson-nist
Copy link
Contributor

If I understand this bug properly, this looks to have already been implemented in c22b4bae.

https://github.com/ucoProject/UCO/blob/master/ontology/action/action.ttl#L106

The second place this was supposed to have been used is here:
https://github.com/ucoProject/UCO/blob/master/ontology/action/action.ttl#L313

I'd missed it. @sbarnum correctly caught that this was a miss.

@ajnelson-nist ajnelson-nist added this to the UCO 1.0.0 milestone Aug 17, 2022
@ajnelson-nist
Copy link
Contributor

I just realized this bug is actually moot.

The shape in question has a sh:maxCount 0 constraint. So, all of the other constraints, including the one that seemed to induce the semi-open vocabulary problem, are irrelevant.

This would have been made more clear if the SHIR update proposal had had a follow-on Issue enacted to remove redundant constraints.

I came across the "mootness" while implementing a resolution to Issue 445.

ajnelson-nist added a commit that referenced this issue Aug 18, 2022
These property shapes were identified by visual review of the results of
this query:

```sparql
SELECT DISTINCT ?nClass ?nSubClass ?nProperty
WHERE {
  ?nClass
    sh:property/sh:path ?nProperty ;
    .

  ?nSubClass
    rdfs:subClassOf+ ?nClass ;
    sh:property/sh:path ?nProperty ;
    .
}
ORDER BY ?nClass
```

(The difference since the last patch is `?nClass` is no longer tied to
`Facet`s.)

This patch alone will trigger a CI failure from the SHIR code base, due
to SHIR 0.2.0 flagging dropped constraints as errors.  A follow-on patch
will merge in the resolution to PR 417 in order to resolve this bug
without needing to work through addressing semi-open vocabulary issues
when subclasses are involved.  Incidentally, Issue 442 is now mooted.

References:
* #417
* #442
* #445

Signed-off-by: Alex Nelson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants