-
Notifications
You must be signed in to change notification settings - Fork 2
Use-case : (Excel) tables generation from shapes #15
Comments
@tfrancart A pretty good use case indeed! But I would maybe add:
|
Ha yes of course, I forgot that ASC/DESC "detail". I would not use sh:path as you propose though, because what we are pointing at here are shapes, not properties. Why not simply a "non-semantic" property like
Yes
Probably this could be known from the datatype, and the datatype could indicate the sorting algorithm to use. |
Ha yeah, I didn't notice those
👍
That could work indeed, but I fear this might be limiting 🤔. If we define such relationship in a given shapes graph, it would force a specific sorting algorithm on all properties of a given datatype. And if we are in a case with those ids being "naively" typed as And another point adjacent to that: what about |
Yes, for these reasons the indication of a sorting algorithm could be attached to a property shape, but if none is found here, it could be looked up on the datatype indicated with sh:datatype, if any. |
What about adding it to the property shape? The order of the columns is already there. It would be the first place I would look for a sort property. Having a ex:sort [
ex:sortOrder 1;
ex:sortDirection ex:Asc
] |
I think you are actually right and this makes perfect sense. Just as the sh:order property is on a property shape, a sort order should be on property shapes. I was just worried that it makes property shapes not reusable outside of the context of the NodeShape they are attached to, but I guess we need to be consistent with what has been done with sh:order. |
I would totally consider the draft of |
I thought I had seen something like this before. How could I have missed it? |
The draft is notoriously hard to find :D |
Can we agree on using orderBy, as it's defined in SHACL Advanced Features? Leave a 👍 if you agree. |
I don't agree because i am not sure the semantic is the same. The link you provide points to an order by expression which consists of sh:orderBy + sh:nodes + sh:desc. I don't know what sh:nodes means; what is needed in the use-case is only sh:orderBy + sh:desc, not sh:nodes. And from I read one cannot use sh:desc in combination with sh:orderBy directly, using an order by expression is required. Also, as an order by expression is supposed to have exactly one value for sh:orderBy, how do you sort by more than one column ? So my proposal would be to attach it directly to property shapes, as you first proposed; we could reuse the same identifiers
|
By taking advantage od SHACL-AF we also avoid creating a new set of terms for similar purpose.
That is precisely what [
sh:path ex:P1 ;
sh:orderBy [
sh:path schema:name ;
sh:node [
sh:path schema:age ;
sh:desc true
] ;
] ;
] . Going inside out, the above would translate to SPARQL
Coming back to this, having compared our snippets. Are you talking about ordering columns or rows? For the former |
Overall I think that shapes are not always fully reusable. If you have a shape to generate an "excel" table, likely you would not use it directly in other context. If not, then maybe we could advise using a generic term such as |
rows. I do use sh:order to order columns.
Exactly. sh:order would be a safe choice to order columns between them. And for the same reason, a property like |
Only comes back to the question you asked. How do you define precedence? I realise my snippet was slightly misleading. You would order the entire table, not a property [
a sh:NodeShape ;
sh:orderBy [
sh:path schema:name ;
sh:nodes [
sh:path schema:age ;
sh:desc true
] ;
] ;
sh:property [
sh:path schema:name ; sh:order 1 ;
] ;
sh:property [
sh:path schema:age ; sh:order 2 ;
] ;
] . See, the ordering expressions and properties are separated. It makes no sense in this context but in other scenarios you may choose to order by properties which are not actually displayed (not in |
Well, I could just |
Yes, fixed
Agree. The complete draft of SHACL-AF is indeed quite complex |
This is a use-case description for potential use of what we are trying to define here.
I am specifying how some data should be presented in tables (Excel tabs) using shapes (much like https://datashapes.org/forms.html#ValueTableViewer).
Each tab structure is described as a NodeShape. Columns of each table are PropertyShapes. Lines are filled in with targets of each node shapes.
I would like to be able to specify how each table should be sorted. Something like
ex:myNodeShape sh:property ex:P1, ex:P2, ex:P3 ; xxx:somePropertyToIndicateSorting (ex:P2 ex:P3)
: the table would be sorted by whatever property is sh:path of P2, then whatever property is sh:path of P3.The text was updated successfully, but these errors were encountered: