Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Semantic Forms and Family – introductory tutorial
1. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
SEMANTIC FORMS
& FAMILY
a story with a happy ending
SMWCon Fall 2016
Tutorial Day
2. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
A SEMANTIC FORM
The Hero of the Story
3. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
SEMANTIC FORMS
• use with Semantic MediaWiki,
Cargo or independently
• add data via forms
• style outputs with templates
• documentation on mediawiki.org
4. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
SEMANTIC FORMS
üeasy data input and editing – no
wikitext needed
üidentical styling of printout
üautomatic storage of properties
üarraymap (& arraymaptemplate)
Help: arraymap
5. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
SEMANTIC FORMS
Let‘s standardize display and
creation of book pages!
6. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A NEW FORM
Get to know the classy family
7. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
A FORM‘S FAMILY (= CLASS)
template
property
form category
8. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A NEW FORM
• create with Special:CreateClass
• create individually
1. properties & their data types
2. templates
3. forms
4. categories
9. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A CLASS
• create with Special:CreateClass
• add field names, property names,
data types, allowed values
• job queue!
10. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATECLASS
• create with Special:CreateClass
• add field names, property names,
data types, allowed values
• job queue!
11. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
DATA STRUCTURE
FIELD
NAME
INPUT
VALUE
PROPERTY DATA
TYPE ALLOWED
VALUES
Author Hermann
Hesse
Has
author Page
Publishing
year
1974 Was
published
in
Year/Date YYYY
12. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE INDIVIDUALLY
• create individually
1. properties > Special:CreateProperty
2. templates > Special:CreateTemplate
3. forms > Special:CreateForm
4. categories > Special:CreateCategory
Help: special pages
13. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE INDIVIDUALLY
• create individually
1. properties > Special:CreateProperty
2. templates > Special:CreateTemplate
3. forms > Special:CreateForm
4. categories > Special:CreateCategory
14. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A TEMPLATE
• create individually
1. properties > Special:CreateProperty
2. templates > Special:CreateTemplate
3. forms > Special:CreateForm
4. categories > Special:CreateCategory
15. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A TEMPLATE
16. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A TEMPLATE
Special:CreateTemplate
17. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A TEMPLATE
• table, side infobox, plain text,
sections
18. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A TEMPLATE
semantic storage & styling
<noinclude>[[Category:Book
form]]</noinclude>
19. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
USE THE TEMPLATE
20. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
USE THE TEMPLATE
but that‘s tedious to write!
21. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A FORM
22. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
A SIMPLE FORM
{{{for template|Book}}}
{| class="formtable“
! Author:
| {{{field|Author|mandatory}}}
|-
! Publisher:
| {{{field|Publisher}}}
|}
{{{end template}}}
23. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
CREATE A NEW FORM
• create individually
1. properties > Special:CreateProperty
2. templates > Special:CreateTemplate
3. forms > Special:CreateForm
4. categories > Special:CreateCategory
24. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
1 form can fill 1 or more templates
25. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
properties are taken from template
26. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
extra parameters according to input type
27. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
PARAMETERS
• mandatory– *
• restricted – only for
admins
• class
• default value
• preload content
• size, rows/columns,
maxlength, autogrow
• placeholder
• uploadable, default
filename
• values – set ofvalues:
values from property,
from category, from
namespace, from concept,
from url
• list, delimiter
• show on select (input type
dropdown)
28. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
missing the ”Edit with form” tab?
29. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
Don’t forget the category:
{{#default_form:Book}}
• based on category, namespace or
single page
Help: the "edit with form" tab
30. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
FORM:BOOK
31. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
FORM:BOOK
32. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
FORM:BOOK
OK, but I want:
• text area instead of text!
• date instead of year!
• a country dropdown field!
33. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
FORM:BOOK
So I make those changes:
• {{{field|Title|mandatory|input
type=text}}}
• {{{field|Publishing year|input
type=year}}}
• {{{field|Publishing country|values
from property=Has publishing
country}}}
• {{{field|Author|input
type=combobox}}}
34. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
THE FORM IN DETAIL
35. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
A SIMPLE FORM
{{{for template|Book}}}
{| class="formtable“
! Author:
| {{{field|Author|mandatory}}}
|-
! Publisher:
| {{{field|Publisher}}}
|}
{{{end template}}}
Help: defining forms
36. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
„For TEMPLATE“ Tag
{{{for template|Book}}}
multiple
label= for multiple instances
display= table/spreadsheet
add button text
37. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
„Info“ Tag
{{{info}}}
{{{for template|Book}}}
{| class="formtable“
! Author:
| {{{field|Author|mandatory}}}
|-
! Publisher:
| {{{field|Publisher}}}
|}
{{{end template}}}
38. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
„Info“ Tag
{{{info}}}
partial form
create title
edit title
query title
page name= formula 1-step-process!
onlyinclude free text
39. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
„field“ Tag
{{{field|Author}}}
input type=
hidden
mandatory
restricted
default
class
property
cargo table, cargo field
list, delimiter
holds template
unique, unique for
category/for
namespace/for concept
40. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
STANDARD INPUTS
• {{{standard input|free text|rows=10}}}
• {{{standard input|summary}}}
• {{{standard input|minor edit}}}
• {{{standard input|watch}}}
• {{{standard input|save}}}
• {{{standard input|preview}}}
• {{{standard input|changes}}}
• {{{standard input|cancel}}}
41. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
INPUT TYPES
42. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
INPUT TYPES
text (with autocomplete)
textarea (with
autocomplete)
combobox
tokens
radiobutton
dropdown
checkboxes
listbox
tree
checkbox
date
datetime
year
datepicker
openlayers, googlemaps
regexp
Help: input types
43. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
TEXT & TEXTAREA
with autocomplete
44. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
COMBOBOX
45. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
LISTBOX
46. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
TOKENS
47. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
DROPDOWN, CHECKBOXES,
RADIOBUTTON
48. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
DATEPICKER
49. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
LINK TO THE NEW FORM
• add links to forms (on startpage, in
templates)
– categories have default forms
– links in sidebar and on pages
– #formredlink
Help: #formredlink
50. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
BEST PRACTICES
51. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
data structure
DISPLAY
TITLE
FIELD INPUT
VALUE
PROPERTY DATA
TYPE INPUT
TYPE
Author Author Hermann
Hesse
Has
author Page Text
with
autocompl
ete
Publishing
year
Year 1974 Was
published
in
Year/Date Datetime/Y
ear/Datepi
cker
52. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
name properties wisely
• generic vs specific
• thinking in sentences to make the
direction clear
• Capital vs. Is capital of / Has capital
53. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
2-step vs. 1-step process
page name is
created during
input, related to
input or not
important.
page name is created by user
54. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
2-step vs. 1-step process
{{#formlink:form=Book
|link text=Create a new book
|link type=button
|namespace=Books
|new window}}
{{{info|page name=B<unique
number start=000001>}}}
Special:FormEdit/Book
{{#forminput:form=Book}}
Help: one-step process
55. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
care for your dropdowns
(and users)
{{{field|Country|input
type=dropdown|values from
property=takes place in the
country}}}
56. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
care for your dropdowns
{{Countrylist}}
57. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
care for your users
• add placeholder text & tooltips
• use meaningful input type
• group long forms into sections
Help: tooltips
Help: input types
58. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
keep it all together
keep all corresponding pages (pages, forms,
templates, properties, categories in one
category for easy administraion
59. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
use #if to style your tables and
sideboxes
Help: #if parser function
60. SMWCon Fall 2016 in Frankfurt am Main | Tutorial Day |Sabine Melnicki
WikiAhoi
www.wikiahoi.at
@WikiAhoi
Volles Wissen voraus!