Re: using Shape Expressions to validate RDF graphs

On Fri, Jul 11, 2014 at 5:35 PM, Peter F. Patel-Schneider <
pfpschneider@gmail.com> wrote:

> I've been looking through the Shape Expressions submission.  I'm having a
> hard time figuring out how it can be used to validate RDF graphs.
>
> The kind of validation I'm thinking of is constraining the elements of
> various RDF types, perhaps requiring something like
>

I will give a first try...


> - the spouse of every person is a person
>

This could be declared as:

<Person> {  a (:Person) , :spouse @<Person>? }

meaning that the shape Person has type :Person and can have an optional
triple :spouse of shape <Person>

You can play with the example here: http://goo.gl/pcL0ix

- the university of every graduate student is a research university
>

I declared it as:

<GradStudent> { :university @<ResearchUniversity> }

<ResearchUniversity> { a (:ResearchUniversity) }

You can also play with the example here: http://goo.gl/fkx71w

Taking a look at your examples, I would like to comment that there is a
difference between the domain of discourse of RDF Data Shapes and OWL.

OWL is very well suited to describe concepts like Person, Graduate Student,
University, etc. while RDF Data Shapes are more oriented towards RDF data
representations, although they can be related, it is not always the case.

For example, the constraints that I would express in RDF Data Shapes would
be something like:

"In this RDF graph, the representation of a Person (or the shape of the
resource Person) has a property rdf:type with value :Person and can have a
property spouse which must have the shape of a Person"

I mean, OWL and Shape Expressions have different goals...with OWL you model
an ontology of concepts, while with Shape Expressions you just describe the
shapes of RDF graphs.

Best regards, Jose Labra

Received on Friday, 11 July 2014 16:32:16 UTC