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

UCO OWL review of RDF List was scoped too broadly #571

Closed
15 tasks done
ajnelson-nist opened this issue Dec 5, 2023 · 1 comment · Fixed by #572 or #577
Closed
15 tasks done

UCO OWL review of RDF List was scoped too broadly #571

ajnelson-nist opened this issue Dec 5, 2023 · 1 comment · Fixed by #572 or #577

Comments

@ajnelson-nist
Copy link
Contributor

ajnelson-nist commented Dec 5, 2023

Bug description

As part of reviewing UCO's syntax for semi-open vocabularies before UCO 1.0.0 (done in Issue 406), some shapes were written to check the syntax for OWL definitions of custom datatypes. Those shapes recognized some requirements OWL makes on rdf:List, but incorrectly scoped them to apply to all rdf:Lists. This causes some issues with review of certain OWL "A-Box" review (used for representing individuals, i.e. instances of the classes and users of properties from the "T-Box"), as well as SHACL review.

The shapes around rdf:List, rdf:first, and rdf:rest currently in the UCO OWL shapes file need to be revised to be scoped to OWL. This will mean going with a more strict enumeration style, following the rule-matching in the OWL 2 Web Ontology Language Mapping to RDF Graphs (Second Edition).

This Issue houses a bug report and a remediating Change Proposal. It appears complex enough to me to need a Requirements Review vote.

Steps to reproduce

These RDF snippets should not cause UCO's SHACL validation to fail, but currently they do:

@prefix kb: <http://example.org/kb/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
kb:MyOrderedCollection
  a skos:OrderedCollection ;
  skos:memberList ( kb:X kb:Y kb:Z ) .

The above instance-data snippet is drawn from Example 41 in the SKOS reference Section 9.3.

@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

dash:DateOrDateTime
  a rdf:List ;
  rdf:first [
      sh:datatype xsd:date ;
    ] ;
  rdf:rest (
      [
        sh:datatype xsd:dateTime ;
      ]
    ) ;
  rdfs:comment "An rdf:List that can be used in property constraints as value for sh:or to indicate that all values of a property must be either xsd:date or xsd:dateTime." ;
  rdfs:label "Date or date time" ;
. 

The above SHACL supplementary snippet is drawn from DASH Data Shapes Vocabulary Section 8.1, where the prescribed usage of the shape follows this general form:

@prefix dash: <http://datashapes.org/dash#> .
@prefix ex: <http://example.org/shapes/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:DateOrDateTimeShape
	a sh:NodeShape ;
	sh:property [
		sh:path ex:timeStamp ;
		sh:or dash:DateOrDateTime ;
	] .

As an aside, a sibling shape snippet, dash:StringOrLangString, could support a goal in the CASE backlog (ONT-6) of supporting language strings without universally requiring language string annotations. (I was informed of this shape in discussion on this pySHACL issue.)

dash:StringOrLangString
  a rdf:List ;
  rdf:first [
      sh:datatype xsd:string ;
    ] ;
  rdf:rest (
      [
        sh:datatype rdf:langString ;
      ]
    ) ;
  rdfs:comment "An rdf:List that can be used in property constraints as value for sh:or to indicate that all values of a property must be either xsd:string or rdf:langString." ;
  rdfs:label "String or langString" ;
.   

Requirements

Requirement 1

UCO's OWL review must not prevent other RDF idioms that are not necessarily within OWL's purview (e.g. instance-data rdf:Lists and SHACL constructs).

Risk / Benefit analysis

Benefits

  • Fixes bug impacting applicability past UCO.
  • Updates UCO's implemented understanding of OWL 2 DL structural and syntactic nuances.

Risks

  • Stub increases: A migration has been proposed to the CDO Technical Steering Committee to export the UCO OWL review shapes into their own repository (described in CDOTSC-34). Some technical-logistical issues have arisen when testing CDO Profiles (profiles described here), delaying that migration. When completed, the new IRIs proposed as part of this Issue will become deactivated stub references.
    • This is believed to be no further operational risk compared to the current state of UCO's OWL (and possibly Collections Ontology) review shapes.
    • One issue that has been recently realized is that stub sh:PropertyShapes will likely need to remain sh:PropertyShapes when reduced to a deactivated stub, in order to continue satisfying any incorporations by the sh:property predicate.
  • A non-update on duplication in UCO: One grumble that the UCO Ontology Community collectively had (myself included) was that this OWL review mechanism induced a significant duplication of rdf:Lists used in support of UCO's semi-open vocabulary design pattern. Unfortunately, while the SHACL-specific lists can now be given IRIs and incorporated by IRI reference, the OWL custom-datatype definitions are still affected, so there may be only a few cases where a rdf:List can be de-duplicated in support of semi-open vocabularies.

Competencies demonstrated

UCO's OWL review should not raise any issues for the DASH and SKOS usage patterns described above. The examples are encoded in updated unit tests accompanying this Issue.

Solution suggestion

  • Deactivate uco-owl:List-shape; split its functionality into three other shapes.
    • uco-owl:Sequence-shape houses review rules for OWL Sequences, narrower in scope than rdf:Lists.
      • This shape avoids recursive shape references, to avoid infinite recursion issues.
      • This shape guarantees OWL Sequences use blank nodes, and makes no review of non-OWL-"T-Box" rdf:Lists.
      • This shape has no SHACL targeting predicate. Instead, it is adopted by other shapes using sh:node.
    • uco-owl:rdf-first-subjects-shape and uco-owl:rdf-rest-subjects-shape perform structural review that is generalizable to rdf:List - that if either predicate is used on some subject node N, then N has both of the predicates exactly once.
    • uco-owl:List-shape is retained, untargeting and deactivated, to maintain IRI availability as part of backwards compatibility.
  • For each of the sequence-valued OWL predicates noted in this document, particularly Section 3.2.4, define a shape targeting objects of the predicate that adopts the sequence node shape using sh:node.

For instance, for owl:oneOf, this new shape is defined:

uco-owl:oneOf-objects-shape
	a sh:NodeShape ;
	sh:node uco-owl:Sequence-shape ;
	sh:targetObjectsOf owl:oneOf ;
	.

This issue leaves the following out of scope, to remain focused on fixing the overly-broad review bug:

  • Any further constraints on the list members contextualized to the predicate. (E.g. owl:oneOf should be further constrained based on whether it is being used for an ObjectOneOf or DataOneOf construct. That will come in a future proposal.)
  • Any constraints on subjects of the newly-reviewed predicates. (E.g. several require use on blank nodes, e.g. for owl:Restrictions.)

Coordination

  • Tracking in Jira ticket OC-301
  • Administrative review completed, proposal announced to Ontology Committees (OCs) on 2023-12-04
  • Requirements to be discussed in OC meeting, 2023-12-12
  • Requirements Review vote occurred, passing, on 2023-12-12
  • Requirements development phase completed.
  • Solution announced to OCs on 2024-01-12
  • Solutions Approval to be discussed in OC meeting, 2024-01-18
  • Solutions Approval vote occurred, passing, on 2024-01-18
  • Solutions development phase completed.
  • Backwards-compatible implementation merged into develop for the next release
  • develop state with backwards-compatible implementation merged into develop-2.0.0
  • Backwards-incompatible implementation merged into develop-2.0.0 (N/A)
  • Milestone linked
  • Documentation logged in pending release page
  • Prerelease publication: CASE develop branch updated to track UCO's updated develop branch
  • Prerelease publication: CASE develop-2.0.0 branch updated to track UCO's updated develop-2.0.0 branch
@ajnelson-nist ajnelson-nist added this to the UCO 1.3.0 milestone Dec 5, 2023
ajnelson-nist added a commit that referenced this issue Dec 5, 2023
A follow-on patch will regenerate Make-managed files.

References:
* #571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit that referenced this issue Dec 5, 2023
References:
* #571

Signed-off-by: Alex Nelson <[email protected]>
@ajnelson-nist ajnelson-nist linked a pull request Dec 5, 2023 that will close this issue
13 tasks
ajnelson-nist added a commit to casework/CASE-Archive that referenced this issue Dec 5, 2023
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Archive that referenced this issue Dec 5, 2023
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Dec 5, 2023
A follow-on patch will regenerate Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Dec 5, 2023
References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Examples that referenced this issue Dec 5, 2023
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#563
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit that referenced this issue Dec 5, 2023
This causes `ValidationResult`s to yield sufficient information to find
the whole triple that should have used a sequence.  With the prior
spelling, only the object of the triple would have been directly
identified; the predicate could be manually deduced from the shape name;
and the subject was completely absent from the validation result.

The noted comment on PR 572 illustrates the difference in results when
testing CASE-Corpora.  The issue is replicated as new PASS and XFAIL
test members.

A follow-on patch will regenerate Make-managed files.

References:
* #571
* #572 (comment)

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit that referenced this issue Dec 5, 2023
References:
* #571
* #572 (comment)

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Archive that referenced this issue Dec 5, 2023
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Archive that referenced this issue Dec 5, 2023
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Corpora that referenced this issue Dec 5, 2023
The shape updates from UCO Issue 571 brought to light that owl:hasKey
only takes sequences as objects.

No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571
* https://www.w3.org/TR/2012/REC-owl2-mapping-to-rdf-20121211/

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Corpora that referenced this issue Dec 5, 2023
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#563
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Corpora that referenced this issue Dec 5, 2023
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Dec 5, 2023
A follow-on patch will regenerate Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Dec 5, 2023
References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Examples that referenced this issue Dec 5, 2023
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
@ajnelson-nist
Copy link
Contributor Author

Update: This proposal initially included several shapes using sh:targetObjectsOf on OWL sequence-valued predicates. In this comment on the PR, I concluded that it would be better for issue remediation to use sh:targetSubjectsOf instead, so the PR now implements shapes targeting predicates' subjects.

ajnelson-nist added a commit to ucoProject/ucoproject.github.io that referenced this issue Jan 19, 2024
References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
@ajnelson-nist ajnelson-nist linked a pull request Jan 19, 2024 that will close this issue
ajnelson-nist added a commit to casework/CASE-Archive that referenced this issue Jan 19, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Archive that referenced this issue Jan 19, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE that referenced this issue Jan 19, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Corpora that referenced this issue Jan 19, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Examples that referenced this issue Jan 19, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Jan 19, 2024
A follow-on patch will regenerate Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE that referenced this issue Jan 22, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Jan 22, 2024
A follow-on patch will regenerate Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Jan 22, 2024
References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Examples that referenced this issue Jan 22, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Corpora that referenced this issue Jan 22, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Jan 23, 2024
A follow-on patch will regenerate Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Jan 23, 2024
References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/casework.github.io that referenced this issue Jan 23, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Examples that referenced this issue Jan 24, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Corpora that referenced this issue Jan 24, 2024
No effects were observed on Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Utilities-Python that referenced this issue Jan 24, 2024
Adoption of CASE 1.3.0 happens to address `case-utils` Issue 142,
because UCO Issue 571 deactivated `uco-owl:List-shape`.

This patch considers some of the OWL shapes as applicable in ABox review.

* `uco-owl:distinctMembers-subjects-shape` and
  `uco-owl:members-subjects-shape` can be used in `owl:AllDifferent` to
  specify that some IRIs in the graph truly do not pertain to the same
  individual.
* `uco-owl:rdf-first-subjects-shape` and
  `uco-owl:rdf-rest-subjects-shape` serve as an RDF-wide syntax reviewer
  on `rdf:List`, confirming that lists are specified at least as much as
  they need to be, and also do not fork.

No effects were observed on Make-managed files.

References:
* #142
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to Cyber-Domain-Ontology/CDO-Shapes-OWL that referenced this issue Jan 25, 2024
These exemplars exercise properties with review shapes added as part of
UCO Issue 571.  For future `git bisect` purposes, they are added now so
`git bisect` may rely on `make check` passing on this commit.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to Cyber-Domain-Ontology/CDO-Shapes-OWL that referenced this issue Jan 25, 2024
A follow-on patch will regenerate Make-managed files.

References:
* ucoProject/UCO#571

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to Cyber-Domain-Ontology/CDO-Shapes-OWL that referenced this issue Jan 25, 2024
References:
* ucoProject/UCO#571

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
Projects
None yet
1 participant