Conversation
smessie
left a comment
There was a problem hiding this comment.
This PR is already a great start, thanks! Yet, I think it still needs some refinement.
I see you created this PR branch in your own fork. However that one is outdated, so we'll have to see that we don't have merge conflicts.
Is it enough to just link to the score validation shape or do we want to write something about it?
I don’t have a strong opinion yet, but I think we could definitely start with this. However, the document would surely benefit from some additional clarifications.
Should we merge the validation function with the matcher function?
No, I think it is nice to have them separate as the matcher function calls the validation function twice.
Should we remove the argument Shape node and just use the whole shapes graph always?
I believe it is good to have the shape node explicit. But I would need some arguments to reason further over it.
Was the JavaScript pseudo code intended to be in the spec?
Not sure, but I like how it is now with the algorithm defined as text. I don't necessarily see the need for the JavaScript pseudocode to be included as well.
How do we distinguish between editor and viewer? Two types? Traversing the widget property and then check the type? Two properties editor/viewer instances of the widget on the score instance?
This is probably a good discussion point for one of our next meetings.
shacl12-ui/index.html
Outdated
| </ol> | ||
| </section> | ||
|
|
||
| <section id="scoring-algorithm-algorithm-steps"> |
There was a problem hiding this comment.
I believe this section is actually the first draft of @edmondchuc which was now replaced by the above algorithm. If I'm correct, then this section should not be included in the document.
| <section id="scoring-system"> | ||
| <h2>Scoring System</h2> | ||
|
|
||
| <section id="scoring-system-intro"> |
There was a problem hiding this comment.
I would add a subsection in this section, and before starting the Validation Function and other functions, containing the steps in pseudocode (similar to the function sections) how to use the different functions defined below to come to the general scoring algorithm. A bit similar to the JavaScript pseudocode select I believe.
| <li><strong>Shapes graph</strong> - the <a href="https://www.w3.org/TR/shacl/#shapes-graph">shapes graph</a> containing the SHACL shapes that define constraints on the data graph and provide the structural and semantic model used to generate and render the user interface. </li> | ||
| <li><strong>Scoring graph</strong> — An RDF graph containing `shui:WidgetScore` instances that define how widgets are scored.</li> | ||
| <li><strong>Constraint shape</strong> — A SHACL shape subject in the shapes graph that defines the constraints and structure of the UI rendered for an editing or viewing context.</li> | ||
| <li><strong>Shapes graph</strong> — the <a href="https://www.w3.org/TR/shacl/#shapes-graph">shapes graph</a> containing the SHACL shapes that define constraints on the data graph and provide the structural and semantic model used to generate and render the user interface.</li> </ul> |
There was a problem hiding this comment.
| <li><strong>Shapes graph</strong> — the <a href="https://www.w3.org/TR/shacl/#shapes-graph">shapes graph</a> containing the SHACL shapes that define constraints on the data graph and provide the structural and semantic model used to generate and render the user interface.</li> </ul> | |
| <li><strong>Shapes graph</strong> — the <a href="https://www.w3.org/TR/shacl/#shapes-graph">shapes graph</a> | |
| containing the SHACL shapes that define constraints on the data graph and provide the | |
| structural and semantic model used to generate and render the user interface.</li> |
| <li><strong>Focus node</strong> - the node in the data graph for view, create, or update operations.</li> | ||
| <li><strong>Data graph</strong> - the <a href="https://www.w3.org/TR/shacl/#data-graph">data graph</a> containing the domain data being edited or viewed. This must be present if a focus node is provided.</li> | ||
| <li><strong>Focus node</strong> — the node in the data graph for view, create, or update operations.</li> | ||
| <li><strong>Data graph</strong> — the <a href="https://www.w3.org/TR/shacl/#data-graph">data graph</a> containing the domain data being edited or viewed. This must be present if a focus node is provided.</li> |
There was a problem hiding this comment.
| <li><strong>Data graph</strong> — the <a href="https://www.w3.org/TR/shacl/#data-graph">data graph</a> containing the domain data being edited or viewed. This must be present if a focus node is provided.</li> | |
| <li><strong>Data graph</strong> — the <a href="https://www.w3.org/TR/shacl/#data-graph">data graph</a> | |
| containing the domain data being edited or viewed. This must be present if a focus node is provided.</li> |
| <p> | ||
| At a high level, the scoring system is a function that takes a set of inputs and returns a set of score results, | ||
| sorted by their score value in descending order. | ||
| sorted by their score value in descending order, with ties broken and thenceforth ordered lexicographically by the Unicode codepoint values of `shui:widget` to ensure deterministic ordering. |
There was a problem hiding this comment.
| sorted by their score value in descending order, with ties broken and thenceforth ordered lexicographically by the Unicode codepoint values of `shui:widget` to ensure deterministic ordering. | |
| sorted by their score value in descending order, with ties broken and thenceforth ordered lexicographically | |
| by the Unicode codepoint values of `shui:widget` to ensure deterministic ordering. |
| <p> | ||
| The validation function used by the matcher function.<br/> | ||
| Inputs: | ||
| The validation function used by the <a href="#scoring-algorithm-matcher-function">matcher function</a> to validate the focus node against a list of shape nodes. |
There was a problem hiding this comment.
| The validation function used by the <a href="#scoring-algorithm-matcher-function">matcher function</a> to validate the focus node against a list of shape nodes. | |
| The validation function used by the <a href="#scoring-algorithm-matcher-function">matcher function</a> | |
| to validate the focus node against a list of shape nodes. |
| <section id="scoring-algorithm-matcher-function"> | ||
| <h4>Matcher Function</h4> | ||
| <p> | ||
| The matcher function used by the <a href="#scoring-algorithm-score-function">score function</a> and the <a href="#scoring-algorithm-accept-function">accept function</a> to validate whether a widget score applies to a given focus node and shape node. |
There was a problem hiding this comment.
| The matcher function used by the <a href="#scoring-algorithm-score-function">score function</a> and the <a href="#scoring-algorithm-accept-function">accept function</a> to validate whether a widget score applies to a given focus node and shape node. | |
| The matcher function used by the <a href="#scoring-algorithm-score-function">score function</a> and | |
| the <a href="#scoring-algorithm-accept-function">accept function</a> to validate whether a widget score | |
| applies to a given focus node and shape node. |
| <li>Return <code>results</code></li> | ||
| </ol> | ||
| </section> | ||
| <li>If no <strong>focus node</strong> is given, a value for the `shui:dataGraphShape` property is present, and no value for the `shui:shapesGraphShape` is present, return `false`</li> |
There was a problem hiding this comment.
| <li>If no <strong>focus node</strong> is given, a value for the `shui:dataGraphShape` property is present, and no value for the `shui:shapesGraphShape` is present, return `false`</li> | |
| <li>If no <strong>focus node</strong> is given, a value for the `shui:dataGraphShape` property | |
| is present, and no value for the `shui:shapesGraphShape` is present, return `false`</li> |
Closes #562, #609
This merge request adds the initial paragraphs of the scoring system.
Notes:
Things to discuss:
validationfunction with thematcherfunction?Shape nodeand just use the wholeshapes graphalways?