-
Notifications
You must be signed in to change notification settings - Fork 34
Issue 537 UI widgets #572
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
base: gh-pages
Are you sure you want to change the base?
Issue 537 UI widgets #572
Conversation
Note that accessibility review will probably advise us to replace |
In this case the component would filter out any instances of the class that do not conform to the specified node shape. | ||
In the following example, the auto-complete would only show countries that are have <code>true</code> as their value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the component would filter out any instances of the class that do not conform to the specified node shape. | |
In the following example, the auto-complete would only show countries that are have <code>true</code> as their value | |
In this case, the component would filter out any instances of the class that do not conform to the specified node shape. | |
In the following example, the auto-complete would only show countries that have <code>true</code> as their value |
<p> | ||
<b>Score:</b> | ||
1 if the value is an IRI. | ||
0 otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 otherwise | |
0 otherwise. |
a read-only editor that displays the blank node similar to <a href="#BlankNodeViewer">BlankNodeViewer</a> | ||
yet allows the surrounding user interface to at least provide a delete button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a read-only editor that displays the blank node similar to <a href="#BlankNodeViewer">BlankNodeViewer</a> | |
yet allows the surrounding user interface to at least provide a delete button. | |
a read-only editor that displays the blank node, similar to <a href="#BlankNodeViewer">shui:BlankNodeViewer</a>, | |
yet allows the surrounding user interface to at least provide a delete button. |
<h4>shui:DetailsEditor</h4> | ||
<p> | ||
<b>Score:</b> | ||
<code>null</code> for non-literals, i.e. it can be selected manually via <code>shui:editor</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>null</code> for non-literals, i.e. it can be selected manually via <code>shui:editor</code>. | |
<code>null</code> for non-literals, i.e., it can be selected manually via <code>shui:editor</code>. |
This widget requires that the surrounding property (ex:weight above) declares sh:nodeKind sh:BlankNode | ||
and also has a sh:node constraint that points at a node shape that declares the properties that shall be editable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This widget requires that the surrounding property (ex:weight above) declares sh:nodeKind sh:BlankNode | |
and also has a sh:node constraint that points at a node shape that declares the properties that shall be editable. | |
This widget requires that the surrounding property (<code>ex:weight</code> above) declares <code>sh:nodeKind sh:BlankNode</code> | |
and also has a <code>sh:node</code> constraint that points at a node shape that declares the properties that shall be editable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comma, missing from @smessie's suggestion
This widget requires that the surrounding property (ex:weight above) declares sh:nodeKind sh:BlankNode | |
and also has a sh:node constraint that points at a node shape that declares the properties that shall be editable. | |
This widget requires that the surrounding property (<code>ex:weight</code>, above) declares <code>sh:nodeKind sh:BlankNode</code> | |
and also has a <code>sh:node</code> constraint that points at a node shape that declares the properties that shall be editable. |
The only example of such a viewer in SHACL UI is <a href="#ValueTableViewer"><code>shui:ValueTableViewer</code></a>, which displays | ||
all values of a property as an HTML table. | ||
In those cases, the notions of generic add and delete buttons do not apply. | ||
Such viewers are called <em>Multi Viewers</em> and are declared instance of <code>shui:MultiViewer</code> instead of <code>shui:SingleViewer</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such viewers are called <em>Multi Viewers</em> and are declared instance of <code>shui:MultiViewer</code> instead of <code>shui:SingleViewer</code>. | |
Such viewers are called <em>Multi Viewers</em> and are declared instances of <code>shui:MultiViewer</code> instead of <code>shui:SingleViewer</code>. |
<p> | ||
In this example we have used a <code>sh:values</code> rule to infer the values of the first column. | ||
In this case, the values are simply pointing back to the focus node of each row, using <code>sh:this</code>. | ||
Note that <code>dash:applicableToClass</code> or <code>sh:targetClass</code> are needed to get this inference correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here (reference to DASH)
|
||
ex:ConceptTableShape | ||
a sh:NodeShape ; | ||
dash:applicableToClass skos:Concept ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here (reference to DASH)
sh:path skos:altLabel ; | ||
sh:description "The third column shows the alternative labels." ; | ||
sh:name "alt labels" ; | ||
sh:or dash:StringOrLangString ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here (reference to DASH)
</p> | ||
<img src="images/viewers/ValueTableViewer.png" /> | ||
<p> | ||
In this example we have used a <code>sh:values</code> rule to infer the values of the first column. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this example we have used a <code>sh:values</code> rule to infer the values of the first column. | |
In this example, we have used a <code>sh:values</code> rule to infer the values of the first column. |
typing "Nig" then "Niger" and "Nigeria" would show up as possible choices. | ||
</p> | ||
<img src="images/editors/AutoCompleteEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
In the following example, the auto-complete would only show countries that are have <code>true</code> as their value | ||
for <code>ex:sovereign</code>. | ||
</p> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just made some small suggestions to use the respec css class for examples.
Also displays the current value (such as <code>"1"^^xsd:boolean</code>), but only allows to switch to true or false. | ||
</p> | ||
<img src="images/editors/BooleanSelectEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
a calendar-like date picker. | ||
</p> | ||
<img src="images/editors/DatePickerEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
a calendar-like date picker including a time selector. | ||
</p> | ||
<img src="images/editors/DateTimePickerEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
This is particularly useful for some types of blank nodes that only make sense to be edited in the context of their parent resource. | ||
</p> | ||
<img src="images/editors/DetailsEditor.png" width="782" height="364" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
a drop-down editor for enum fields (based on the <code>sh:in</code> list, in that order). | ||
</p> | ||
<img src="images/editors/EnumSelectEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
a multi-line text area to enter the value of a literal and a drop-down to select a language. | ||
</p> | ||
<img src="images/editors/TextAreaWithLangEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
an input field to enter the value of a literal, without the ability to change language or datatype. | ||
</p> | ||
<img src="images/editors/TextFieldEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
which is mandatory unless <code>xsd:string</code> is among the permissible datatypes. | ||
</p> | ||
<img src="images/editors/TextFieldWithLangEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
an input field to enter the URI of a resource, e.g. as value of <code>rdfs:seeAlso</code> or to enter the URL of an image on the web. | ||
</p> | ||
<img src="images/editors/URIEditor.png" /> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
In this case, the values are simply pointing back to the focus node of each row, using <code>sh:this</code>. | ||
Note that <code>dash:applicableToClass</code> or <code>sh:targetClass</code> are needed to get this inference correctly. | ||
</p> | ||
<pre class="example-shapes"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<pre class="example-shapes"> | |
<pre class="example"> |
<b>Rendering:</b> | ||
an auto-complete field to enter the label of instances of the class specified for the property. | ||
For example, if the <code>sh:class</code> of the property is <code>ex:Country</code> and the user starts | ||
typing "Nig" then "Niger" and "Nigeria" would show up as possible choices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typing "Nig" then "Niger" and "Nigeria" would show up as possible choices. | |
typing "Nig", then "Niger" and "Nigeria" would show up as possible choices. |
Implementations may also want to support the combination of <code>sh:class</code> with additional <code>sh:node</code> | ||
constraints to further narrow down the set of valid values. | ||
In this case the component would filter out any instances of the class that do not conform to the specified node shape. | ||
In the following example, the auto-complete would only show countries that are have <code>true</code> as their value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementations may also want to support the combination of <code>sh:class</code> with additional <code>sh:node</code> | |
constraints to further narrow down the set of valid values. | |
In this case the component would filter out any instances of the class that do not conform to the specified node shape. | |
In the following example, the auto-complete would only show countries that are have <code>true</code> as their value | |
Implementations may want to also support the combination of <code>sh:class</code> with <code>sh:node</code> | |
constraints to further narrow the set of valid values. | |
In this case, the component would filter out any instances of the class that do not conform to the specified node shape. | |
In the following example, the auto-complete would only show countries that have <code>true</code> as their value |
<p> | ||
<b>Score:</b> | ||
10 for <code>xsd:boolean</code> literals. | ||
0 for non-literals or if there is a <code>sh:datatype</code> constraint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 for non-literals or if there is a <code>sh:datatype</code> constraint. | |
0 for non-literals and when there is a <code>sh:datatype</code> constraint. |
</p> | ||
<p> | ||
<b>Rendering:</b> | ||
This may be an auto-complete widget to select a class or a class hierarchy widget, or a combination thereof. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming not meant as RFC2119, better not to use such terms, even in lowercase.
This may be an auto-complete widget to select a class or a class hierarchy widget, or a combination thereof. | |
This can be an auto-complete widget to select a class, a class hierarchy widget, or a combination thereof. |
0 if the property is marked <code>sh:singleLine true</code>. | ||
20 if the value is an <code>xsd:string</code> literal and <code>sh:singleLine false</code>. | ||
5 if the value is an <code>xsd:string</code> literal. | ||
2 if the property has <code>xsd:string</code> among the permissible datatypes. | ||
<code>null</code> if the property has a custom datatype (not from xsd or rdf namespaces but for example <code>geo:wktLiteral</code>). | ||
0 otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such long lists may be better as lists (I recommend <ul>
to prevent confusion between a numbered item in an <ol>
and the score discussed in that item. I think <ol>
is fine, since these are all disjoint, and can be presented in any order.), as the clarity of this manually linebroken source does not persist when all these lines fold into a single wrapping line. Such <ul>
or <ol>
lists should probably be used throughout, whenever there are multiple Score:
lines. (This is one argument to consistently wrap running prose at 80 chars in the source, and not at indefinite "sentence" or "thought" breaks — so source writers have some sense of how the content will be rendered for later readers.)
0 if the property is marked <code>sh:singleLine true</code>. | |
20 if the value is an <code>xsd:string</code> literal and <code>sh:singleLine false</code>. | |
5 if the value is an <code>xsd:string</code> literal. | |
2 if the property has <code>xsd:string</code> among the permissible datatypes. | |
<code>null</code> if the property has a custom datatype (not from xsd or rdf namespaces but for example <code>geo:wktLiteral</code>). | |
0 otherwise. | |
0 if the property is marked <code>sh:singleLine true</code>. | |
20 if the value is an <code>xsd:string</code> literal and <code>sh:singleLine false</code>. | |
5 if the value is an <code>xsd:string</code> literal. | |
2 if the property has <code>xsd:string</code> among the permissible datatypes. | |
<code>null</code> if the property has a custom datatype (not from <code>xsd:</code> nor <code>rdf:</code> namespaces, but, for example, <code>geo:wktLiteral</code>). | |
0 otherwise. |
</p> | ||
<p> | ||
<b>Rendering:</b> | ||
a multi-line text area to enter the value of a literal and a drop-down to select a language. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when a new language code is minted by the appropriate standards body? Or when setting/rendering a custom language is desired?
10 if the value is a IRI node and the property has <code>sh:nodeKind sh:IRI</code> and no <code>sh:class</code> constraint. | ||
null if the value is a IRI node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10 if the value is a IRI node and the property has <code>sh:nodeKind sh:IRI</code> and no <code>sh:class</code> constraint. | |
null if the value is a IRI node. | |
10 if the value is an IRI node and the property has <code>sh:nodeKind sh:IRI</code> and no <code>sh:class</code> constraint. | |
null if the value is an IRI node. |
</p> | ||
<p> | ||
<b>Rendering:</b> | ||
an input field to enter the URI of a resource, e.g. as value of <code>rdfs:seeAlso</code> or to enter the URL of an image on the web. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an input field to enter the URI of a resource, e.g. as value of <code>rdfs:seeAlso</code> or to enter the URL of an image on the web. | |
an input field to enter the URI of a resource, e.g., as value of <code>rdfs:seeAlso</code> or to enter the URL of an image on the web. |
10 if the value is a literal that is neither <code>rdf:langString</code> nor <code>xsd:boolean</code>. | ||
0 otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another global suggestion. Make the score values <code>
to set them slightly apart from the running text.
10 if the value is a literal that is neither <code>rdf:langString</code> nor <code>xsd:boolean</code>. | |
0 otherwise. | |
<code>10</code> if the value is a literal that is neither <code>rdf:langString</code> nor <code>xsd:boolean</code>. | |
<code>0</code> otherwise. |
<h4>shui:TextFieldWithLangEditor</h4> | ||
<p> | ||
<b>Score:</b> | ||
11 if the value is an <code>rdf:langString</code> literal or the property permits either (both) <code>rdf:langString</code> or <code>xsd:string</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permitting either
means it permits one datatype at a time, which I think is correct. Permitting both
means it permits two datatypes at the same time, which I think is incorrect, as I think these are disjoint types.
11 if the value is an <code>rdf:langString</code> literal or the property permits either (both) <code>rdf:langString</code> or <code>xsd:string</code>. | |
11 if the value is an <code>rdf:langString</code> literal or the property permits either <code>rdf:langString</code> or <code>xsd:string</code>. |
<h3>Viewers</h3> | ||
<p> | ||
The following sub-sections enumerate the currently defined instances of <code>shui:Viewer</code> from the SHACL UI namespace. | ||
Property shapes can explicitly specify the preferred viewer for its values using <code>shui:viewer</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Property shapes can explicitly specify the preferred viewer for its values using <code>shui:viewer</code>. | |
A property shape can have an explicitly specified preferred viewer for its values in <code>shui:viewer</code>. |
Most viewers render a single RDF value, typically as a single widget, on the screen. | ||
Form editors offer buttons to edit individual values and add or delete values. | ||
However, some viewers need to take more complete control over how multiple values of a property at a focus node are rendered. | ||
The only example of such a viewer in SHACL UI is <a href="#ValueTableViewer"><code>shui:ValueTableViewer</code></a>, which displays | ||
all values of a property as an HTML table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most viewers render a single RDF value, typically as a single widget, on the screen. | |
Form editors offer buttons to edit individual values and add or delete values. | |
However, some viewers need to take more complete control over how multiple values of a property at a focus node are rendered. | |
The only example of such a viewer in SHACL UI is <a href="#ValueTableViewer"><code>shui:ValueTableViewer</code></a>, which displays | |
all values of a property as an HTML table. | |
Most viewers render a single RDF value on the screen, typically as a single widget. | |
Form editors offer buttons to edit individual values and to add or delete values. | |
However, some viewers need to take more complete control over how multiple values of a property at a focus node are rendered. | |
The only example of such a viewer in SHACL UI is <a href="#ValueTableViewer"><code>shui:ValueTableViewer</code></a>, which displays | |
all values of a property as an HTML table. |
<p> | ||
<b>Score:</b> | ||
50 for IRI nodes or literals that have a case-insensitive recognized image ending such as | ||
<code>.png</code>, <code>.jpg</code>, <code>.jpeg</code>, <code>.gif</code> and <code>.svg</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>.png</code>, <code>.jpg</code>, <code>.jpeg</code>, <code>.gif</code> and <code>.svg</code>. | |
<code>.png</code>, <code>.jpg</code>, <code>.jpeg</code>, <code>.gif</code>, or <code>.svg</code>. |
<h4>shui:LabelViewer</h4> | ||
<p> | ||
<b>Score:</b> | ||
5 if the value is a IRI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 if the value is a IRI. | |
5 if the value is an IRI. |
<b>Rendering:</b> | ||
as a hyperlink to that URI based on the display label of the resource. | ||
The display label is typically based on the must suitable <code>rdfs:label</code> or | ||
<code>skos:prefLabel</code> for the current user, based on her language preferences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>skos:prefLabel</code> for the current user, based on her language preferences. | |
<code>skos:prefLabel</code> for the current user, based on their language preferences. |
<h4>shui:URIViewer</h4> | ||
<p> | ||
<b>Score:</b> | ||
1 if the value is a IRI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 if the value is a IRI. | |
1 if the value is an IRI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RDF 1.2 also has rdf:dirLangString
in addition to rdf:langString
Either include each time (spoec detail style), or say that rdf:dirLangString
can be accepted where rdf:dirLangString
occurs.
This PR adds the widgets from datashapes.org. The namespace was adapted, and other minor changes were made to align it with the other SHACL specifications.
The selection of widgets and the details in the widget should be handled in a separate PR. This is an initial starting point so that other PRs can refer to widgets.
dash:applicableToClass and dash:rootClass was kept as there is no matching SHACL property. The dash namespaces should be easier to notice when we work on the details.
Closes 537