Skip to content

Create more specific shapes for Data Grant - one per data grant scope #109

@elf-pavlik

Description

@elf-pavlik

This issue captures train of thought started in https://gitter.im/solid/data-interoperability-panel?at=609d2763d523ee3d3e2de1a0

Currently shape for data grant is very permissive to accommodate for all posible scopes of the grant:

<#DataGrantShape> {
  a [ interop:DataGrant ] ;
  interop:hasAccessGrant @<#:AccessGrantShape> ;
  interop:satisfiesAccessNeed @<#:AccessNeedShape> ;
  interop:registeredShapeTree IRI ;
  interop:hasDataRegistration IRI ;  
  interop:accessMode @<#:AccessModes>+ ;
  interop:scopeOfGrant @<#:DataGrantScopes> ;  
  interop:hasDataInstance IRI* ;  
  interop:hasReferencedDataGrant @<#:ReferencedDataGrantShape> 
}

https://solid.github.io/data-interoperability-panel/specification/#shexDataGrant

For example interop:scopeOfGrant interop:SelectedInstances ; would require setting interop:hasDataInstance. But given shape above, zero or more interop:hasDataInstance are valid, no matter value of interop:scopeOfGrant. One approach of addressing it would be to only add more specific shapes, for example

<#DataGrantShapeSelectedInstances> {
  a [ interop:DataGrant ] ;
  interop:hasAccessGrant @<#:AccessGrantShape> ;
  interop:satisfiesAccessNeed @<#:AccessNeedShape> ;
  interop:registeredShapeTree IRI ;
  interop:hasDataRegistration IRI ;  
  interop:accessMode @<#:AccessModes>+ ;
  interop:scopeOfGrant [  interop:SelectedInstances ] ;  
  interop:hasDataInstance IRI+ ;  
  interop:hasReferencedDataGrant @<#:ReferencedDataGrantShape> 
}

Another one would be to instead of using interop:scopeOfGrant define subclass of Data Grant for each scope, with shape to validate it:

<#DataGrantForSelectedInstancesShape> {
  a [ interop:DataGrantForSelectedInstances ] ;
  interop:hasAccessGrant @<#:AccessGrantShape> ;
  interop:satisfiesAccessNeed @<#:AccessNeedShape> ;
  interop:registeredShapeTree IRI ;
  interop:accessMode @<#:AccessModes>+ ;
  interop:hasDataInstance IRI+ ;  
  interop:hasReferencedDataGrant @<#:ReferencedDataGrantShape> 
}

Either way at least having more specific shapes would help to verify that grant for specific scope has all required information.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions