-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathindex.html
More file actions
2193 lines (2043 loc) · 85.1 KB
/
index.html
File metadata and controls
2193 lines (2043 loc) · 85.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="color-scheme" content="light dark" />
<title>SHACL 1.2 User Interfaces</title>
<script
src="https://www.w3.org/Tools/respec/respec-w3c"
class="remove"
></script>
<script class="remove">
function prepareSyntaxRules() {
specification
.querySelectorAll("[data-syntax-rule]")
.forEach((element) => {
let ruleId = element.getAttribute("data-syntax-rule");
let tr = document.createElement("tr");
tr.classList.add("syntax-rule-tr");
let td1 = document.createElement("td");
td1.classList.add("syntax-rule-id");
let a = document.createElement("a");
a.classList.add("syntax-rule-id-a");
a.href = "#syntax-rule-" + ruleId;
a.textContent = ruleId;
td1.appendChild(a);
let td2 = document.createElement("td");
td2.innerHTML = element.innerHTML;
tr.appendChild(td1);
tr.appendChild(td2);
// Replace <dfn> elements inside `tr` with <a> elements
tr.querySelectorAll("dfn").forEach((dfn) => {
let a = document.createElement("a");
a.textContent = dfn.textContent;
dfn.replaceWith(a);
});
document.getElementById("syntax-rules-table").appendChild(tr);
element.setAttribute("id", "syntax-rule-" + ruleId);
});
}
function prepareValidators() {
document.querySelectorAll("[data-validator]").forEach((element) => {
let validatorId =
element.getAttribute("data-validator") + "ConstraintComponent";
let tr = document.createElement("tr");
tr.classList.add("validator-tr");
let td = document.createElement("td");
tr.appendChild(td);
let a = document.createElement("a");
a.classList.add("validator-id-a");
a.href = `#validator-${validatorId}`;
a.textContent = `sh:${validatorId}`;
td.appendChild(a);
td.innerHTML += ": " + element.innerHTML;
document.getElementById("validators-table").appendChild(tr);
element.id = "validator-" + validatorId;
});
}
document.addEventListener("DOMContentLoaded", () => {
// Replace code div blocks in shapes, data, and results graph with tabs
for (const graph of document.querySelectorAll(
".shapes-graph, .data-graph, .results-graph"
)) {
const tabs = document.createElement("aside");
tabs.classList.add("ds-selector-tabs");
graph.firstElementChild.classList.add("selected");
for (const child of graph.children) {
child.classList.add("tab");
}
tabs.append(...graph.children);
graph.append(tabs);
}
// Generate buttons for the selection logic
for (const tabs of document.querySelectorAll(".ds-selector-tabs")) {
const selectors = document.createElement("div");
selectors.classList.add("selectors");
// Check if JSON-LD or shaclc div exists in this tab group
const hasJsonld = tabs.querySelector(".jsonld");
const hasShaclc = tabs.querySelector(".shaclc");
selectors.innerHTML = `
<button class="selected" data-selects="turtle">Turtle</button>
${hasJsonld ? '<button data-selects="jsonld">JSON-LD</button>' : ''}
${hasShaclc ? '<button data-selects="shaclc">SHACL-C</button>' : ''}
`;
tabs.prepend(selectors);
}
// Add example button selection logic
for (const button of document.querySelectorAll(
".ds-selector-tabs .selectors button"
)) {
button.onclick = () => {
const ex = button.closest(".ds-selector-tabs");
ex.querySelector("button.selected").classList.remove("selected");
ex.querySelector(".selected").classList.remove("selected");
button.classList.add("selected");
ex.querySelector("." + button.dataset.selects).classList.add(
"selected"
);
};
}
});
var respecConfig = {
localBiblio: {},
specStatus: "ED",
group: "wg/data-shapes",
github: "w3c/data-shapes",
//preProcess: [ ],
edDraftURI: "https://w3c.github.io/data-shapes/shacl12-ui/",
shortName: "shacl12-ui",
copyrightStart: "2025",
xref: ["RDF12-CONCEPTS", "SHACL-CORE"],
// (fix and) RemoveMe
lint: { "no-unused-dfns": false },
editors: [
{
name: "Edmond Chuc",
company: "KurrawongAI",
companyURL: "https://kurrawong.ai",
mailto: "edmond@kurrawong.ai",
url: "https://www.edmondchuc.com/",
w3cid: 163845,
},
{
name: "Thomas Bergwinkl",
company: "TopQuadrant, Inc.",
companyURL: "https://www.topquadrant.com/",
mailto: "tbergwinkl@topquadrant.com",
w3cid: 47803
},
{
name: "Ieben Smessaert",
company: "imec",
companyURL: "https://www.imec-int.com/",
url: "https://smessaert.be/",
w3cid: 165466
},
{
name: "Daniël Beeke",
company: "Triply",
companyURL: "https://triply.cc/",
url: "https://danielbeeke.nl/",
w3cid: 171503
},
],
};
</script>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<section id="abstract">
<p>
This specification describes Shapes Constraint Language (SHACL) User
Interfaces.
</p>
<p>
This specification is published by the
<a href="https://www.w3.org/groups/wg/data-shapes"
>Data Shapes Working Group</a
>.
</p>
</section>
<section id="sotd"></section>
<section
id="specifications"
class="introductory"
data-include="../shacl12-common/specifications.html"
></section>
<section class="introductory">
<h2>Document Outline</h2>
<p>Content.</p>
</section>
<section id="introduction" class="appendix informative">
<h2>Introduction</h2>
<p>
RDF applications commonly provide user interfaces that allow users to view and edit RDF resources.
SHACL Core, together with vocabularies such as DASH, has often been used for this purpose by
describing the structure, constraints, labels, and presentation-relevant metadata associated with
RDF data.
</p>
<p>
SHACL User Interfaces are defined by this specification as a complementary vocabulary and rendering model for
generating forms from SHACL shapes. It introduces UI-specific concepts and processing rules for
determining widgets, resolving labels, and grouping and ordering the form components used to manage
RDF resources.
</p>
<p>
Existing SHACL shapes and RDF data can be used to generate functional forms without additional
SHACL UI annotations. SHACL UI annotations allow authors to provide more specific rendering
information, enabling implementations to generate more tailored and consistent forms.
The goal is to improve interoperability between SHACL-based form generation systems
by defining common behavior across implementations.
</p>
<p>
This specification is intended for RDF application developers, RDF data editors, and authors of SHACL
shapes who wish to generate forms for their data.
</p>
<section id="scope" class="appendix informative">
<h3>Scope</h3>
<p>
The scope of this specification is limited to form rendering for viewing and editing RDF resources
using SHACL Core concepts such as shapes, constraints, and property paths. It defines processing
behavior for label and language resolution, field grouping and ordering, and widget determination
for value nodes.
</p>
<p>
This specification does not define the visual styling of the user interface, including the styling of individual widgets or the form as a whole.
Although it addresses some presentation-adjacent aspects, such as field grouping through <code>sh:PropertyGroup</code> and label handling, it defines how these are processed rather than how they are displayed.
</p>
<p>
This specification also does not define broader application-level user interface features such as search, filtering, or navigation.
It does not define a protocol for updating data stores, nor does it define form submission handling, validation behavior, or error handling.
Accessibility requirements for implementations and rendered interfaces are also out of scope, though implementations are encouraged to follow relevant accessibility guidelines.
</p>
</section>
<section id="terminology">
<h3>Terminology</h3>
<p>
Terminology used throughout this specification is taken from several
sources:
</p>
<dl>
<dt>
<a href="https://w3c.github.io/data-shapes/shacl12-core/"
>SHACL 1.2 Core</a
>
specification
</dt>
<dd>
technical terms for SHACL and RDF, the latter from
[[rdf12-concepts]]
</dd>
</dl>
<p>
The SHACL & RDF terms include:
<dfn data-lt="bindings">
<a href="https://www.w3.org/TR/shacl/#dfn-binding">binding</a>
</dfn>
,
<dfn data-lt="blank nodes">
<a href="https://www.w3.org/TR/shacl/#dfn-blank-node">blank node</a>
</dfn>
,
<dfn data-lt="conform|conforms">
<a href="https://www.w3.org/TR/shacl/#dfn-conforms">conformance</a>
</dfn>
,
<dfn data-lt="constraints">
<a href="https://www.w3.org/TR/shacl/#dfn-constraint">constraint</a>
</dfn>
,
<dfn data-lt="constraint components">
<a href="https://www.w3.org/TR/shacl/#dfn-constraint-component"
>constraint component</a
>
</dfn>
,
<dfn data-lt="data graphs">
<a href="https://www.w3.org/TR/shacl/#dfn-data-graph">data graph</a>
</dfn>
,
<dfn data-lt="datatypes">
<a href="https://www.w3.org/TR/shacl/#dfn-datatype">datatype</a>
</dfn>
,
<dfn data-lt="failures">
<a href="https://www.w3.org/TR/shacl/#dfn-failure">failure</a>
</dfn>
,
<dfn data-lt="focus nodes">
<a href="https://www.w3.org/TR/shacl/#dfn-focus-node">focus node</a>
</dfn>
,
<dfn data-lt="RDF graphs|graphs|graph">
<a href="https://www.w3.org/TR/shacl/#dfn-rdf-graph">RDF graph</a>
</dfn>
,
<dfn
><a href="https://www.w3.org/TR/shacl/#dfn-ill-formed"
>ill-formed</a
></dfn
>
,
<dfn data-lt="IRIs"
><a href="https://www.w3.org/TR/shacl/#dfn-iri">IRI</a></dfn
>
,
<dfn data-lt="literals">
<a href="https://www.w3.org/TR/shacl/#dfn-literal">literal</a>
</dfn>
,
<dfn data-lt="local names">
<a href="https://www.w3.org/TR/shacl/#dfn-local-name">local name</a>
</dfn>
,
<dfn data-lt="members">
<a href="https://www.w3.org/TR/shacl/#dfn-members">member</a>
</dfn>
,
<dfn data-lt="nodes|RDF node">
<a href="https://www.w3.org/TR/shacl/#dfn-node">node</a>
</dfn>
,
<dfn data-lt="node shapes">
<a href="https://www.w3.org/TR/shacl/#dfn-node-shape">node shape</a>
</dfn>
,
<dfn data-lt="objects">
<a href="https://www.w3.org/TR/shacl/#dfn-object">object</a>
</dfn>
,
<dfn data-lt="parameters">
<a href="https://www.w3.org/TR/shacl/#dfn-parameters">parameter</a>
</dfn>
,
<dfn data-lt="pre-bind|pre-bound">
<a href="https://www.w3.org/TR/shacl/#pre-binding">pre-binding</a>
</dfn>
,
<dfn data-lt="predicates">
<a href="https://www.w3.org/TR/shacl/#dfn-predicate">predicate</a>
</dfn>
,
<dfn data-lt="property paths">
<a href="https://www.w3.org/TR/shacl/#dfn-shacl-property-path"
>property path</a
>
</dfn>
,
<dfn data-lt="property shapes">
<a href="https://www.w3.org/TR/shacl/#dfn-property-shape"
>property shape</a
>
</dfn>
,
<dfn data-lt="RDF terms|terms|term">
<a href="https://www.w3.org/TR/shacl/#dfn-rdf-term">RDF term</a>
</dfn>
,
<dfn data-lt="SHACL instances">
<a href="https://www.w3.org/TR/shacl/#dfn-shacl-instance"
>SHACL instance</a
>
</dfn>
,
<dfn data-lt="SHACL lists">
<a href="https://www.w3.org/TR/shacl/#dfn-shacl-list">SHACL list</a>
</dfn>
,
<dfn data-lt="SHACL subclasses">
<a href="https://www.w3.org/TR/shacl/#dfn-shacl-subclass"
>SHACL subclass</a
>
</dfn>
,
<dfn data-lt="shapes">
<a href="https://www.w3.org/TR/shacl/#dfn-shape">shape</a>
</dfn>
,
<dfn data-lt="shapes graphs">
<a href="https://www.w3.org/TR/shacl/#dfn-shapes-graph"
>shapes graph</a
>
</dfn>
,
<dfn data-lt="solutions">
<a href="https://www.w3.org/TR/shacl/#dfn-solution">solution</a>
</dfn>
,
<dfn data-lt="subjects">
<a href="https://www.w3.org/TR/shacl/#dfn-subject">subject</a>
</dfn>
,
<dfn data-lt="targets">
<a href="https://www.w3.org/TR/shacl/#dfn-target">target</a>
</dfn>
,
<dfn data-lt="triples">
<a href="https://www.w3.org/TR/shacl/#dfn-rdf-triple">triple</a>
</dfn>
,
<dfn
><a href="https://www.w3.org/TR/shacl/#dfn-validation"
>validation</a
></dfn
>
,
<dfn data-lt="validation reports">
<a href="https://www.w3.org/TR/shacl/#dfn-validation-report"
>validation report</a
>
</dfn>
,
<dfn data-lt="validation results">
<a href="https://www.w3.org/TR/shacl/#dfn-validation-results"
>validation result</a
>
</dfn>
,
<dfn data-lt="validators">
<a href="https://www.w3.org/TR/shacl/#dfn-validators">validator</a>
</dfn>
,
<dfn data-lt="values">
<a href="https://www.w3.org/TR/shacl/#dfn-value">value</a>
</dfn>
,
<dfn data-lt="value nodes">
<a href="https://www.w3.org/TR/shacl/#dfn-value-nodes"
>value node</a
>
</dfn>
.
</p>
<div class="def">
<div class="term-def-header">Language Resolution</div>
<div>
<dfn data-lt="language resolution">Language Resolution</dfn> is the process of determining and ordering the
values associated with a given subject-predicate pair, prioritizing the preferred or most relevant language
value for display.
</div>
</div>
<div class="def">
<div class="term-def-header">Label Resolution</div>
<div>
<dfn data-lt="label resolution">Label Resolution</dfn> is the process of selecting the most appropriate
display label for an RDF resource, or generating a fallback value when no suitable value exists. It
applies to both value nodes and properties identified by <code>sh:path</code>, the latter of which is commonly used to label form elements.
The process includes <a>language resolution</a> and considers labeling-related annotations from the
<a>shapes graph</a>, <a>data graph</a>, application environment, and user preferences, to determine the best label for UI presentation.
</div>
</div>
<div class="def">
<div class="term-def-header">Property UI Component</div>
<div>
A <dfn data-lt="property ui component">Property UI Component</dfn> is a combination of <a>constraints</a>
across multiple <a>property shapes</a> that share the same <a>focus node</a> and <a>property path</a>.
</div>
</div>
<div class="def">
<div class="term-def-header">Node UI Component</div>
<div>
A <dfn data-lt="node ui component">Node UI Component</dfn> is generated from a single <a>focus node</a>,
typically containing one or more <a>property UI components</a>. It is often derived from one or more
<a>node shapes</a> that apply to the <a>focus node</a>.
</div>
</div>
<div class="def">
<div class="term-def-header">SHACL Renderer</div>
<div>
A <dfn data-lt="shacl Renderer">SHACL Renderer</dfn> is software that processes SHACL
<a>shapes</a> and data and dynamically generates a user-interface using one
or more <a>node UI components</a>. Implementations may add supplementary UI elements, such as a submit
button to save changes, controls to toggle between edit and view modes, selectors for <a>focus node</a> and
<a>node shape</a>, or visualizations of <a>validation report</a> messages.
They may also provide:
<ul>
<li>State management for editing, viewing, and tracking data changes</li>
<li>Widget management, including widget selection strategies</li>
<li>Logic for determining the initial focus node (target) and the best suited node shape</li>
<li>An interface to interact with the data layer</li>
</ul>
A SHACL Renderer operates on a <a>data graph</a> and a <a>shapes graph</a>, and may also take a
<a>focus node</a> and a <a>node shape</a>. When all four inputs are provided, the renderer
operates in <strong>manual mode</strong>. When the focus node or node shape is not provided,
the renderer may operate in <strong>automatic mode</strong>, in which case the application determines
appropriate values for the missing inputs.
</div>
</div>
</section>
<section id="conventions">
<h3>Document Conventions</h3>
<p>
Within this specification, the following namespace prefix definitions
are used:
</p>
<table class="term-table">
<tr>
<th>Prefix</th>
<th>Namespace</th>
</tr>
<tr>
<td><code>rdf:</code></td>
<td><code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code></td>
</tr>
<tr>
<td><code>rdfs:</code></td>
<td><code>http://www.w3.org/2000/01/rdf-schema#</code></td>
</tr>
<tr>
<td><code>sh:</code></td>
<td><code>http://www.w3.org/ns/shacl#</code></td>
</tr>
<tr>
<td><code>shui:</code></td>
<td><code>http://www.w3.org/ns/shacl-ui#</code></td>
</tr>
<tr>
<td><code>xsd:</code></td>
<td><code>http://www.w3.org/2001/XMLSchema#</code></td>
</tr>
<tr>
<td><code>ex:</code></td>
<td><code>http://example.com/ns#</code></td>
</tr>
<tr>
<td><code>dct:</code></td>
<td><code>http://purl.org/dc/terms/</code></td>
</tr>
</table>
<p>Within this specification, the following JSON-LD context is used:</p>
<pre class="jsonld">
{
"@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"sh": "http://www.w3.org/ns/shacl#",
"shui": "http://www.w3.org/ns/shacl-ui#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"ex": "http://example.com/ns#",
"dct": "http://purl.org/dc/terms/"
}
}</pre
>
<p>
Note that the URI of the graph defining the SHACL vocabulary itself is
equivalent to the namespace above, i.e., it includes the
<code>#</code>. References to the SHACL vocabulary, e.g., via
<code>owl:imports</code> should include the <code>#</code>.
</p>
<p>
Throughout the specification, color-coded boxes containing RDF graphs
in Turtle and JSON-LD will appear. The color and title of a box
indicate whether it is a Shapes graph, a Data graph, or something
else. The Turtle specification fragments use the prefix bindings given
above. The JSON-LD specification fragments use the context given
above. Only the Turtle specifications will have parts highlighted.
</p>
<div class="shapes-graph">
<div class="turtle">
# This box represents an input shapes graph
<s> <p> <o> .
</div>
<div class="jsonld">
<pre class="text">// This box represents an input shapes graph</pre>
<pre class="jsonld">
{
"@id": "ex:s",
"ex:p": {
"@id": "ex:o"
}
}</pre
>
</div>
</div>
<div class="data-graph">
<div class="turtle">
# This box represents an input data graph.
# When highlighting is used in the examples:
# Elements highlighted in blue are <a>focus nodes</a>
<span class="focus-node-selected">ex:Bob</span> a ex:Person .
# Elements highlighted in red are focus nodes that fail validation
<span class="focus-node-error">ex:Alice</span> a ex:Person .
</div>
<div class="jsonld">
<pre class="text">// This box represents an input data graph</pre>
<pre class="jsonld">
{
"@graph": [
{
"@id": "ex:Alice",
"@type": "ex:Person"
},
{
"@id": "ex:Bob",
"@type": "ex:Person"
}
]
}</pre
>
</div>
</div>
<div class="results-graph">
<div class="turtle">
# This box represents an output results graph
</div>
<div class="jsonld">
<pre class="text">
// This box represents an output results graph</pre
>
</div>
</div>
<p class="syntax">
Grey boxes such as this include syntax rules that apply to the
<a>shapes graph</a>.
</p>
<p>
<code>true</code> denotes the RDF term
<code>"true"^^xsd:boolean</code>. <code>false</code> denotes the RDF
term <code>"false"^^xsd:boolean</code>.
</p>
</section>
<section id="conformance">
<p>TODO: define conformance criteria for SHACL UI implementations.</p>
</section>
<section id="compatibility">
<h2>RDF Abstract Model Compatibility</h2>
<p class="ednote">
At the time of writing, RDF 1.2 is a Working Draft. This section will be reviewed and updated when RDF 1.2 becomes a W3C Recommendation.
</p>
<p>
SHACL Renderers implementing this specification MUST support RDF 1.1 and SHOULD support RDF 1.2. When RDF 1.2 is supported, and unless
stated otherwise in this document, implementations SHOULD prefer RDF 1.2 syntax and data model features over their RDF 1.1 counterparts.
</p>
</section>
</section>
<section id="getting-started">
<h2>Getting Started with SHACL UI</h2>
<p>TODO: provide an introduction, use cases, and examples on SHACL UI basics.</p>
<p class="note">Add conceptual model diagram and UI mockups to illustrate the concepts.</p>
<section id="use-cases">
<h3>Use Cases</h3>
<p>Content.</p>
</section>
</section>
<section id="concepts">
<h2>SHACL UI Concepts</h2>
<p>This section explains the UI concepts and how they work together.</p>
<section id="renderer">
<h3>SHACL Renderer</h3>
<p>Content.</p>
</section>
<section id="node-ui-component">
<h3>Node UI Component</h3>
<p>Content.</p>
</section>
<section id="property-ui-component">
<h3>Property UI Component</h3>
<p>Content.</p>
</section>
<p class="note">Describe the constraint collection/aggregation behaviour here for both Node and Property UI Component.</p>
</section>
<section id="widgets">
<h2>Widgets</h2>
<p class="note">TODO: consider moving this section under "SHACL UI Concepts".</p>
<section id="editors">
<h3>Editors</h3>
<p>
The following sub-sections enumerate the currently defined instances of <code>shui:Editor</code> from the SHACL UI namespace.
Property shapes can explicitly specify the preferred editor for its values using <code>shui:editor</code>.
If no such value has been specified, the system should pick a suitable default viewer based on the
<a href="#score">scoring system</a> outlined for each widget.
</p>
</section>
<section id="viewers">
<h3>Viewers</h3>
<p>
The following sub-sections enumerate the currently defined instances of <code>shui:Viewer</code> from the SHACL UI namespace.
A property shape can have an explicitly specified preferred viewer for its values in <code>shui:viewer</code>.
If no such value has been specified, the system should pick a suitable default viewer based on the
<a href="#score">scoring system</a> outlined for each widget.
</p>
<p id="multi">
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.
In such cases, the notions of generic add and delete buttons do not apply.
Such viewers are called <em>Multi Viewers</em> and are declared instances of <code>shui:MultiViewer</code> instead of <code>shui:SingleViewer</code>.
The equivalent classes for editors are <code>shui:MultiEditor</code> and <code>shui:SingleEditor</code>.
</p>
</section>
</section>
<section id="score">
<h2>Widget Scoring System</h2>
<p>Content.</p>
</section>
<section id="core-constraints">
<h2>Core Constraints</h2>
<p>Content.</p>
</section>
<section id="property-paths">
<h2>Property Paths</h2>
<p>
<a href="../shacl12-core/#property-paths">SHACL Property Paths</a> can be used to render a SHACL shape as a
user interface.
Property paths define how data values are accessed or modified relative to a focus node.
</p>
<p>
The following subsections outline the scenarios in which SHACL UI implementations are expected to
support different kinds of property paths for viewing and editing operations.
</p>
<section id="property-paths-view">
<h3>View Mode</h3>
<p>
In view mode, property paths are used to retrieve and display data values associated with a shape.
A SHACL UI implementation must provide mechanisms to resolve these paths for visualization.
</p>
<section id="view-predicate-paths">
<h4>Predicate and Inverse Paths</h4>
<p>
SHACL UI implementations MUST support both
<a href="../shacl12-core/#property-path-predicate">predicate paths</a> and
<a href="../shacl12-core/#property-path-inverse">inverse paths</a> in view mode.
This ensures that values reachable via simple forward or inverse relationships can be displayed to
the user.
</p>
<p>
The following example illustrates how predicate and inverse paths are used in view mode to access
and display values, either directly from the focus node or through incoming relationships from other
nodes.
</p>
<aside class="example" title="Predicate and inverse paths in view mode">
<div class="shapes-graph">
<div class="turtle">
ex:PersonShape
a sh:NodeShape ;
sh:property [
sh:path foaf:name ;
sh:name "Name" ;
sh:datatype xsd:string ;
] ;
sh:property [
sh:path [ sh:inversePath ex:member ] ;
sh:name "Department" ;
] .
</div>
</div>
<div class="data-graph">
<div class="turtle">
ex:alice a ex:Person ;
foaf:name "Alice" .
ex:researchDept a ex:Department ;
ex:member ex:alice ;
rdfs:label "Research Department" .
</div>
</div>
<p>
A SHACL UI could display the person’s <code>foaf:name</code> as text and list departments that
reference the person via <code>ex:member</code>.
</p>
</aside>
</section>
<section id="view-complex-paths">
<h4>Complex Paths</h4>
<p>
SHACL UI implementations SHOULD support complex property paths in view mode. Complex paths include
<a href="../shacl12-core/#property-path-sequence">sequence paths</a>,
<a href="../shacl12-core/#property-path-alternative">alternative paths</a>,
<a href="../shacl12-core/#property-path-zero-or-more">zero-or-more paths</a>,
<a href="../shacl12-core/#property-path-one-or-more">one-or-more paths</a>,
and
<a href="../shacl12-core/#property-path-zero-or-one">zero-or-one paths</a> as defined in SHACL
Core.
</p>
<p>
Support for complex paths is recommended, but can be left out in cases where the implementation aims
to provide symmetry between view and edit modes, and complex paths are not supported in edit mode.
</p>
<p>
The following examples illustrate a sequence path and an alternative path, both of which may be used
for richer data traversal in view mode.
</p>
<aside class="example" title="Complex paths in view mode">
<div class="shapes-graph">
<div class="turtle">
ex:PersonShape
a sh:NodeShape ;
sh:property [
sh:path ( ex:address ex:cityName ) ;
sh:name "City" ;
sh:datatype xsd:string ;
] .
ex:BookShape
a sh:NodeShape ;
sh:property [
sh:path [
sh:alternativePath ( dct:title rdfs:label )
] ;
sh:name "Title" ;
sh:datatype xsd:string ;
] .
</div>
</div>
<div class="data-graph">
<div class="turtle">
ex:alice a ex:Person ;
ex:address ex:aliceAddress .
ex:aliceAddress ex:cityName "Ghent" .
ex:book1 a ex:Book ;
dct:title "Linked Data Design" .
</div>
</div>
<p>
A SHACL UI could display Alice’s city as "Ghent" by traversing the <code>ex:address</code> node,
and display the title of <code>ex:book1</code> as “Linked Data Design”.
</p>
</aside>
</section>
</section>
<section id="property-paths-edit">
<h3>Edit Mode</h3>
<p>
In edit mode, property paths determine how changes to data and the creation of new data are applied
through the user interface.
</p>
<section id="edit-predicate-paths">
<h4>Predicate and Inverse Paths</h4>
<p>
SHACL UI implementations MUST support
<a href="../shacl12-core/#property-path-predicate">predicate paths</a> and
<a href="../shacl12-core/#property-path-inverse">inverse paths</a> in edit mode.
This allows users to modify data linked by simple properties or inverse properties.
</p>
<p>
The following example illustrates how predicate and inverse paths can be used in edit mode to modify
a person’s name and manage their membership in departments.
</p>
<aside class="example" title="Predicate and inverse paths in edit mode">
<div class="shapes-graph">
<div class="turtle">
ex:PersonShape
a sh:NodeShape ;
sh:property [
sh:path foaf:name ;
sh:name "Name" ;
sh:datatype xsd:string ;
] ;
sh:property [
sh:path [ sh:inversePath ex:member ] ;
sh:name "Department" ;
sh:class ex:Department ;
] .
</div>
</div>
<div class="data-graph">
<div class="turtle">
ex:bob a ex:Person ;
foaf:name "Bob" .
ex:engDept a ex:Department ;
ex:member ex:bob ;
rdfs:label "Engineering Department" .
</div>
</div>
<p>
A SHACL UI might render a text input for <code>foaf:name</code> and a selector for the
departments.
Editing inverse paths requires the UI to ensure consistent updates on the related nodes.
</p>
</aside>
</section>
<section id="edit-alternative-paths">
<h4>Alternative Paths</h4>
<p>
SHACL UI implementations SHOULD support
<a href="../shacl12-core/#property-path-alternative">alternative paths</a> in edit mode.
This enables editing where a shape can constrain multiple potential properties, and the UI can allow
users to choose which alternative to use when entering or modifying data.
</p>
<p>
When editing existing or newly created statements, the UI SHOULD provide a mechanism to update the
predicate to one of the enumerated paths in the <code>sh:alternativePath</code> list, but only if
those paths are either <a
href="../shacl12-core/#property-path-predicate">predicate paths</a> or <a
href="../shacl12-core/#property-path-inverse">inverse paths</a>. This restriction is necessary
because the object of <code>sh:alternativePath</code> is a SHACL list that may contain any valid
property path expression, including complex path types that are not generally feasible to edit
directly through a user interface.
</p>
<p class="note">
Although redundant, SHACL permits nesting of <code>sh:alternativePath</code> expressions.
Such nesting simply flattens to a single list of predicate or inverse paths and does not alter the
effective set of alternatives available for editing.
</p>
<p>
The following example illustrates how an alternative path can be used in edit mode to allow a book's
title to be provided through either <code>dct:title</code> or <code>rdfs:label</code>.
</p>
<aside class="example" title="Alternative paths in edit mode">
<div class="shapes-graph">
<div class="turtle">
ex:BookShape
a sh:NodeShape ;
sh:property [
sh:path [
sh:alternativePath ( dct:title rdfs:label )
] ;
sh:name "Title" ;
sh:datatype xsd:string ;
] .
</div>
</div>
<div class="data-graph">
<div class="turtle">
ex:book2 a ex:Book ;
rdfs:label "Semantic Web Foundations" .
</div>
</div>
<p>
A SHACL UI could show the existing title “Semantic Web Foundations” and allow the user to choose
whether
to edit it via <code>dct:title</code> or <code>rdfs:label</code>.
</p>
</aside>
</section>
<section id="edit-other-complex-paths">
<h4>Other Complex Paths</h4>
<p>
SHACL UI implementations MAY support the other complex paths (i.e.,
<a href="../shacl12-core/#property-path-sequence">sequence paths</a>,
<a href="../shacl12-core/#property-path-zero-or-more">zero-or-more paths</a>,
<a href="../shacl12-core/#property-path-one-or-more">one-or-more paths</a>, and
<a href="../shacl12-core/#property-path-zero-or-one">zero-or-one paths</a>)
in edit mode.
</p>
<p>