Difference between revisions of "Help:Unknown Entities Pages"
Line 2: | Line 2: | ||
=TODO:= | =TODO:= | ||
+ | Add [[Template:Unknown Entities]] to all Forms | ||
+ | |||
Add "is unknown snippet to" Templates of | Add "is unknown snippet to" Templates of | ||
* [[:Category:Deployments]] - Done | * [[:Category:Deployments]] - Done |
Revision as of 16:14, 20 January 2022
TODO:[ ]
Add Template:Unknown Entities to all Forms
Add "is unknown snippet to" Templates of
- Category:Deployments - Done
- Category:Technology
- ...
How to create Unknown Entity Pages[ ]
Used extensions:
Used Templates:
- Template:Unknown_Entity_redlink - needs documentation
- Template:Unknown Entities - Adds links to create Unknown entities of all relevant categories
- Template:Create Unknown Entity - to be REMOVED
- Template:Unknown_Entity_forminput - to be REMOVED
- Template:Unknown Entity - to be REMOVED
Page name convention[ ]
Unknow_category_NNNN
ie Unknown_Deployments_0000, Unknown_Deployments_0001
Interface:[ ]
How to include/edit Unknown Entities interface:
The main interface is created by Template:Unknown Entities which can be invoked by === Create Unknown Entities===
Create Unknown_Deployments_0006
Create Unknown_Institution_0104
Template:Unknown Entities invokes the Template:Unknown_Entity_redlink with:
* {{Unknown_Entity_redlink|Dataset}}
Template:Unknown_Entity_redlink searches what is the last Unknown Entity of a given Category. It performs a +1 on the last Unknown Entity of a given Category. And creates a Page Forms #formredlink function, which prompts the user to create the unknown entity in a popup Form.
The pages with title: "Unknown are marked with the property [Property:Is unknown]] (bool) by adding the following snippet to the Template pages
{{#set: Is unknown={{#ifeq: {{#explode:{{PAGENAME}}| |0}}|Unknown|true|false}} }}
Page with title:
- "Unknown..." - Is unknown = true - in pages titles, that start with "Unknown"
- NOT "Unknown..." - Is unknown = false - all other pages
How to display Unknown Entity Pages[ ]
All Unknown Entities[ ]
Process:incremental creation of unknown entity pages[ ]
Extension:Create_Page function[ ]
{{#createpage:|Your page name|button text|Template:ThaWillFillPage}}
{{#createpage:|Your page name|button text|Template:ThaWillFillPage}}
which I can see being applied as
{{#createpage:|Unknown_Deployments_NNNN|Create Unknown Deployment|Template:Deployments}}
{{#createpage:|Unknown_Deployments_NNNN|Create Unknown Deployment|Template:Deployments}}
Querying unknown entity pages[ ]
{{#ask: [[Category:Deployments]][[~*Unknown_Deployment*]] |format=broadtable |limit=50 |offset=0 |link=subject |sort= |order=asc |headers=show |searchlabel=... further results |class=sortable wikitable smwtable }}
Unknown Deployments 0000 |
Unknown Deployments 0001 |
Unknown Deployments 0002 |
Unknown Deployments 0003 |
Unknown Deployments 0004 |
Unknown Deployments 0005 |
last Unknown_Deployment[ ]
{{#ask:[[Category:Deployments]][[~*Unknown_Deployment*]]|format=plainlist|limit=1|offset=0|link=none|sort=|order=desc|sep=, |searchlabel=}}
Unknown Deployments 0005
Parse the last Unknown_Deployment string[ ]
- Start from the string: "Unknown Deployments 0001"
- extract the last 4 characters of strings: use parser function:
- function:
{{#sub:{{#ask:[[Category:Deployments]][[~*Unknown_Deployment*]]|format=plainlist|limit=1|offset=0|link=none|sort=|order=desc|sep=, |searchlabel=}}|-4}}
- output: 0005
- function:
- add 1 to int Extension:ParserFunctions##expr
{{#expr: 1 + {{#sub:{{#ask:[[Category:Deployments]][[~*Unknown_Deployment*]]|format=plainlist|limit=1|offset=0|link=none|sort=|order=desc|sep=, |searchlabel=}}|-4}} }}
- output: 6
- pad with zeros: Magic_words#Formatting padleft
{{padleft:{{#expr: 1 + {{#sub:{{#ask:[[Category:Deployments]][[~*Unknown_Deployment*]]|format=plainlist|limit=1|offset=0|link=none|sort=|order=desc|sep=, |searchlabel=}}|-4}}}}|4|0}}
- output: 0006
Create Page & last unknown entity[ ]
{{#createpage: |Unknown_Deployment_{{padleft:{{#expr: 1 + {{#sub:{{#ask:[[Category:Deployments]][[~*Unknown_Deployment*]]|format=plainlist|limit=1|offset=0|link=none|sort=|order=desc|sep=, |searchlabel=}}|-4}}}}|4|0}} |Create Unknown Deployment |Template:Deployments }}
{{#createpage: |Unknown_Deployment_0006 |Create Unknown Deployment |Template:Deployments }}
Default value: when no results are returned[ ]
use Extension:ParserFunctions##if to assign a default value: "000" if the results of the query are None, else return the last item from the query
Example: True
{{#if: {{#ask:[[Category:Deployments]][[~*Unknown_Deployment*]]|format=plainlist}}|{{#ask:[[Category:Deployments]][[~*Unknown_Deployment*]]|format=plainlist|limit=1|offset=0|link=none|sort=|order=desc|sep=, |searchlabel=}}|000}}
Unknown Deployments 0005
Example: False
{{#if: {{#ask:[[Category:XYZ]][[~*Unknown_Deployment*]]|format=plainlist}}|{{#ask:[[Category:Deployments]][[~*Unknown_Deployment*]]|format=plainlist|limit=1|offset=0|link=none|sort=|order=desc|sep=, |searchlabel=}}|000}}
000
Page Forms/Linking to forms[ ]
There is 3 interface options to create links to form, as seen bellow, as created by Template:Template:Unknown_Entity
- #forminput
- #formlink
- #formredlink
Any of them can access the form in either a "popup" or "new window"
Which one of this 3 interface options and access methods would you prefer User:Ruben & User:Francesco
Deployments example Template:Unknown Entity
Technology example Template:Unknown Entity
- Francesco's comments: I'm not entirely sure how these three options would look when embedded in the form (if they will be embedded in the form). But I would go for the one that looks the most intuitive - maybe 1 or 3? What became however clear by trying them out here is that the popup version is less confusing than the new window option. Thanks!
- Ruben's comments: Great work. I largely agree with Francesco. I'd prefer the new window myself, but suspect most users would prefer the pop-in. I think the button is the "cleanest", but I can imagine the editabily of the text input field will come in handy. So I guess that version (1) has my preference.
Andre (talk) 13:41, 20 January 2022 (CET) Thanks you two. There seems to be a :
- decision on: popup
- option to make between one 1 and 3:
- 3 seems less intrusive and prevents users from changing the page name
- 1 is allow editing
In form[ ]
Andre (talk) 14:05, 20 January 2022 (CET) has put them in a form and you can decide what you prefer
User:Francesco & User:Ruben can you have a look at this form
And see the possible approaches:
- have all the Create unknown options at top of the form
- redlinks:
- forminput: self explanatory and clean
- Create Unknown_Institution_0001 (redlink)
- Unknown_Dataset_0001: seems messy
User:Andre prefers 1.2: cleanest, does not interfere with the form field, all options for creation are available, which can then be chosen in the Form.
Ruben (talk) 14:10, 20 January 2022 (CET) I think placing it in the relevant section of the form makes the most sense. Otherwise it could just as well be on another page. Although I agree with the sentiment that the way it looks now is a bit messy. Suggestion: making it smaller and perhaps _after_ the entry field, makes it a bit cleaner.
Francesco 14:17, 20 January 2022 (CET)I'm with Andre on this one: 1.2. I would have it as a red link in-line in the appropriate place in the form (thus not on the top). I understand Ruben's point on the possibility to change the title, but that's actually what we don't want, especially with the research assistants...And if the title really needs to be changed, we can either move individual pages.
Andre (talk) 14:50, 20 January 2022 (CET) Followed last User:Francesco last point and included all of the links to create Unknown entities of all relevant categories in Template:Unknown Entities. The template can be put at the bottom of the Form page, or anywhere where it is wished. An example can be seen at the bottom of this form