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

Customize validation of some constraints #94

Open
labra opened this issue Jul 16, 2019 · 1 comment
Open

Customize validation of some constraints #94

labra opened this issue Jul 16, 2019 · 1 comment

Comments

@labra
Copy link
Contributor

labra commented Jul 16, 2019

This feature has been requested by a simple use case. Some users want to use the same shapes to describe data which validate the same data before and after applying inference.

For example, imagine some RDF data like the following:

:alice a :Teacher ;
         schema:name "Alice" .

:Teacher rdfs:subClassOf :Person .

A possible shape for teachers before RDFS inference could be:

<TeacherShape> {
 a [ :Teacher]  ;
 schema:name xsd:string ;
}

but if we apply inference, that node would no longer conform, because the inference system would add the triple :alice a :Person.

A possible shape for teachers after inference could be:

<TeacherShape> {
 a [ :Teacher]  ;
 a [:Person ] ;
 schema:name xsd:string ;
}

But in this case, the node before inference would not conform as expected.

Although this is right, from a practical point of view, keeping two set of shapes, one for shapes of nodes before inference and another for shapes of nodes after inference can be problematic so some users (see this issue ), are requesting some solution to have a single shape file which can be used to validate both before and after inference.

One solution could be to define some annotations to disable the validation of some constraints when some conditions are met

For example, a shape for the previous case could be:

<TeacherShape> {
 a [ :Teacher]  ;
 a [:Person ] ;  // sx:applyWhen sx:RDFSEntailment 
 schema:name xsd:string ;
}

where the annotation sx:applyWhen defines that the triple constraint a [:Person] should only be applied when the validation is performed after RDFS inference.

Maybe there are other solutions or best practices that we could recommend for this use case.

@ericprud
Copy link
Contributor

@hsolbrig had a similar issue where his data had non-redundant type arcs; when validating an instance of :Dog as :Animal, it would be nice to infer that the

<S> { a [:Animal] }

constraint was met by the data:

<n> a :Dog .

Would such inference by specified by RDFS written in another graph?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants