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

Define proper discovery mechanism for predefined SHACL shapes and viewport definition #25

Closed
ktk opened this issue Aug 20, 2020 · 20 comments · Fixed by #34
Closed

Define proper discovery mechanism for predefined SHACL shapes and viewport definition #25

ktk opened this issue Aug 20, 2020 · 20 comments · Fixed by #34
Assignees

Comments

@ktk
Copy link
Member

ktk commented Aug 20, 2020

IANA defines .well-known/void. That should be the entry point and in there we should follow the basic VoID and/or schema.org Dataset syntax to point to data.

  • In there we somehow point to SHACL shapes.
  • Another place defines where Viewports should be
@ktk ktk added the help wanted Extra attention is needed label Aug 20, 2020
@l00mi
Copy link
Contributor

l00mi commented Feb 5, 2021

Also compare #32 (comment)

@l00mi l00mi removed the help wanted Extra attention is needed label Feb 5, 2021
@ktk ktk changed the title Define proper SHACL shape location Define proper discovery mechanism for predefined SHACL shapes and viewport definition Feb 12, 2021
@martinmaillard
Copy link
Contributor

Some things that are not clear to me:

  • What should .well-known/void point to? Does it point to one Dataset, that is then split into multiple datasets using void:subset if the endpoint/graph contains multiple distinct datasets?
  • I didn't find anything related to describing the structure of the data with void as we want to do it with shapes. It defines some structural metadata, but it's quite different.
  • They already use void:classPartition and void:propertyPartition (subproperties of void:subset) to describe "all triples that describe entities that have this class" (https://www.w3.org/TR/void/#class-property-partitions). It looks somewhat similar to what we want to do with Viewpoints/Viewports... but not really

@l00mi
Copy link
Contributor

l00mi commented Mar 16, 2021

The classPartition and propertyPartition look quite promising? @bergos what do you think?

@martinmaillard
Copy link
Contributor

The issue with them is that they only allow creating a subset that contains one class or property. Not really what we want.

@l00mi
Copy link
Contributor

l00mi commented Mar 16, 2021

I read it as you can add multiple "partitions" to a dataset which allows you define one "view".

@bergos
Copy link

bergos commented Mar 18, 2021

I guess we have to use http://rdfs.org/ns/void#DatasetDescription or/and http://schema.org/DataCatalog as an entry point. There can be multiple Datasets, but there should be only one DatasetDescription. But how to attach it? I also don't see any property in void that looks suitable. We may also need some properties and classes for the viewports. I would propose to define a new namespace.

void:*Partition could be an alternative to my schema.org based set proposal. But if we use it, we will have additional Datasets for include/exclude sets. Is that ok? People/machines could get lost what is an actual dataset and what is just a set for a spex viewport.

@l00mi
Copy link
Contributor

l00mi commented Mar 18, 2021

I rather would add mulitple Datasets and then use a new namespace and class to addinally make it clear that its used as a viewport. E.g. spex:ViewPort?

@l00mi
Copy link
Contributor

l00mi commented Mar 19, 2021

@martinmaillard

  1. Can you please try to define the structure (with an example), without any namespaces for the ViewPort use case. Then we will give input on the final solution.

  2. @bergos will make a proposition how the SHACL shapes are attached to the .well-known/void

@bergos
Copy link

bergos commented Mar 19, 2021

Maybe it's easier to make the entry point not based on a class instead we just define that it must be attached to /.well-know/void.

The property used to point to the shapes would be defined in the spex: namespace. spex:shape should match with the shacl shape use case, but would also work for any other data that describes the shape of the data (not planned, just in case).

That property could be used to point to the shape for each class. But it would be also possible to use one shape as a collection for all class-related shapes. With an additional type, this collection shape could be flagged as the default shape. That would allow having alternative shapes for any future use cases, like actual data vs. model.

</.well-know/void>
  spex:shape [ a sh:NodeShape, spex:DefaultShapes;
    sh:node [ a sh:NodeShape;
      sh:targetClass <https://permits.ld.admin.ch/schema/Profession>;
      sh:property [ a sh:PropertyShape;
      ], [ a sh:PropertyShape;
      ]
    ], [ a sh:NodeShape;
      sh:targetClass <https://permits.ld.admin.ch/schema/...>;
      sh:property [ a sh:PropertyShape;
      ], [ a sh:PropertyShape;
      ]
    ]
  ].

@martinmaillard
Copy link
Contributor

martinmaillard commented Mar 22, 2021

I'll use the spex namespace for the prototype, but I was wondering: doesn't that introduce a really bad pattern where every tool requires specific metadata to describe a dataset?

Other thing: I'm a bit surprised that you used a surrounding sh:NodeShape and that classes are linked with sh:node. Can you explain the reasoning behind this?

Now to extend your example with viewpoints, I would see something like:

</.well-know/void>
  spex:shape [ 
    a sh:NodeShape, spex:DefaultShapes;
    sh:node [ a sh:NodeShape;
      sh:targetClass <https://permits.ld.admin.ch/schema/Profession>;
      sh:property [ a sh:PropertyShape;
      ], [ a sh:PropertyShape;
      ]
    ], [ a sh:NodeShape;
      sh:targetClass <https://permits.ld.admin.ch/schema/...>;
      sh:property [ a sh:PropertyShape;
      ], [ a sh:PropertyShape;
      ]
    ] ;
  ] ;
  spex:viewport [
    a spex:ViewPort ;
    schema:name "Only the Profession class" ;
    spex:includes <https://permits.ld.admin.ch/schema/Profession> ;
  ] ;
  spex:viewport [
    a spex:ViewPort ;
    schema:name "Everything but the Profession class" ;
    spex:excludes <https://permits.ld.admin.ch/schema/Profession> ;
  ] ;
.

@bergos in the discussion, you mention using one more level and hasPart for the items in the include and exclude sets. I'm not sure I understand the advantage.

@bergos
Copy link

bergos commented Mar 31, 2021

I'll use the spex namespace for the prototype, but I was wondering: doesn't that introduce a really bad pattern where every tool requires specific metadata to describe a dataset?

I agree on that, but to avoid getting lost now, let's define our structure and later we check how well it matches with existing stuff.

Other thing: I'm a bit surprised that you used a surrounding sh:NodeShape and that classes are linked with sh:node. Can you explain the reasoning behind this?

The additional level would allow to create bundles of shapes. The use case would be similar to branches in git. There could be one bundle of shapes that covers the current data and others to model possible extensions to the data model.

using one more level and hasPart for the items in the include and exclude sets

My idea was to hand over include and exclude arguments in the URL and by having a set which will be fetched and expanded by the code, the URLs should not explode. That's the URL arguments perspective.

From data structure perspective, I'm not sure if it makes sense. We use it for variables in pipelines. That allows to combine different sets of variables like <defaults> + <intEndpoint> and <defaults> + <prodEndpoint>, but as this will be done mainly by an UI, this is not required.

@l00mi
Copy link
Contributor

l00mi commented Apr 30, 2021

@martinmaillard did you implement something in this regard now? If yes can you point os to it that we can potentially officiate it.

@martinmaillard
Copy link
Contributor

Nothing done yet

@l00mi
Copy link
Contributor

l00mi commented Apr 30, 2021

So do you need anything more from here to advance on SPEX?

@martinmaillard
Copy link
Contributor

Time 😄

And if you have some inputs about the RDF structure I shared above, that's welcome too.

@martinmaillard
Copy link
Contributor

Let's say we keep the additional nesting level for the shapes. As @bergos mentioned, it could make it easier to allow multiple versions of the schema later (or something like that).

I don't really like the use of sh:NodeShape for the top-most level and sh:node to point to shapes. I feel like it's trying really hard to use SHACL, but the result doesn't mean anything. If I try to interpret it, I think it would mean "to satisfy this shape, the target must conform to all these sub-shapes".

Here's what I propose:

</.well-know/void> spex:shape [ 
-    a sh:NodeShape, spex:DefaultShapes;
+   a spex:DefaultShapes ;
-    sh:node [ 
+   schema:hasPart [
      a sh:NodeShape;
      sh:name "Profession" ;
      sh:targetClass <https://permits.ld.admin.ch/schema/Profession>;
    ], [ 
      a sh:NodeShape;
      sh:name "Something" ;
      sh:targetClass <https://permits.ld.admin.ch/schema/Something>;
    ] ;
  ] ;

@martinmaillard
Copy link
Contributor

One more question: which URI should I use for the spex prefix?

@l00mi
Copy link
Contributor

l00mi commented May 3, 2021

I would go for https://described.at/spex/ @sandhose @ludovicm67 where is the repo for described.at ? then we can add some triples there also.

@ludovicm67
Copy link
Member

The repo for described.at is here: https://gitlab.zazuko.com/docker/described.at

@martinmaillard
Copy link
Contributor

I implemented basic support for viewports. Only supporting spex:includes currently because I'm not sure what the semantics should be for includes + excludes.

@l00mi l00mi closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants