Skip to content

Commit aafe9c4

Browse files
authored
Merge pull request #666 from melvincarvalho/document-namednodeurifield
Add documentation for NamedNodeURIField
2 parents b378977 + bfd7c89 commit aafe9c4

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

docs/form-examples/demo.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,25 @@ <h1>Form fields</h1>
246246
</td>
247247
<td class="output"></td>
248248
</tr>
249+
250+
<tr class="form-demo">
251+
<td class="input">
252+
<pre>
253+
# A field for entering a URI as a named node
254+
# (stores as RDF resource, not string literal)
255+
256+
ex:form
257+
a ui:NamedNodeURIField ;
258+
ui:label "Homepage" ;
259+
ui:property foaf:homepage .
260+
</pre
261+
>
262+
</td>
263+
<td class="target">
264+
<pre>ex:this foaf:homepage &lt;https://example.org/alice&gt; .</pre>
265+
</td>
266+
<td class="output"></td>
267+
</tr>
249268
</tbody>
250269
</table>
251270
</div>

docs/forms-intro.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,21 @@ <h3>Single Value fields - Text</h3>
396396

397397
<h4 class="class">SingleLineTextField</h4>
398398

399+
<h4 class="class">NamedNodeURIField</h4>
400+
401+
<p>
402+
A NamedNodeURIField is like a SingleLineTextField, except that the
403+
value it generates is not a literal string but an RDF named node with
404+
the given URI. Use this when users need to provide explicit URIs to things,
405+
storing them as proper RDF resources rather than text values.
406+
</p>
407+
408+
<p>
409+
Unlike PhoneField or EmailField which add URI scheme prefixes (<tt>tel:</tt>
410+
or <tt>mailto:</tt>), the NamedNodeURIField stores the URI exactly as
411+
entered by the user.
412+
</p>
413+
399414
<h4 class="class">MultiLineTextField</h4>
400415

401416
<h3>Complex fields</h3>

0 commit comments

Comments
 (0)