Difference between revisions of "Maker Hub Wiki"
Line 15: | Line 15: | ||
}}</nowiki> | }}</nowiki> | ||
− | The [https://www.semantic-mediawiki.org/wiki/Help:Inline_queries#Parser_function_.23ask '''ask'''] directive is a [https://www.semantic-mediawiki.org/wiki/Help:Inline_queries Semantic MediaWiki inline query]. This particular query searches the wiki pages for pages that have the property [[Property:Is facility|Is facility]] set to True. ''(There is an article on [https://www.semantic-mediawiki.org/wiki/Help:Property_naming Property naming] and in the best practices section | + | The [https://www.semantic-mediawiki.org/wiki/Help:Inline_queries#Parser_function_.23ask '''ask'''] directive is a [https://www.semantic-mediawiki.org/wiki/Help:Inline_queries Semantic MediaWiki inline query]. This particular query searches the wiki pages for pages that have the property [[Property:Is facility|Is facility]] set to True. ''(There is an article on [https://www.semantic-mediawiki.org/wiki/Help:Property_naming Property naming] and in the best practices section it is advised that you use a verb phrase to describe properties). Also, properties can have various [https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes datatypes] - in this case, the property datatype is Boolean.'' The [https://www.semantic-mediawiki.org/wiki/Help:Result_formats |format=ul] line directs the results to be printed out as an unordered list. |
− | The value in this particular setup is that | + | The value in this particular setup is that when a new facility is added to the space, it will automatically show up in this list. Now, one might argue that facilities are not going to show up at frequent intervals, and this is true. However, we can extend this practice to create new lists, and [[Equipment]] is one of the major ones. The use of properties allows us to have properties that mark pages as equipment ([[Property:Is equipment|Is equipment::True]]), and to say that the equipment is located in a particular facility ([[Property:Is located in facility|Is Located in facility::Machine Shop]]), and to indicate that the equipment is used in a particular domain ([[Property:Is used in domain|Is used in domain::Metal]]). The use of properties rather than page structure gives us tremendous flexibility in expanding to future groupings. Imagine that we might want to see all equipment that is used on Wood that is located in the Machine Shop or the Wood Shop. This can be easily generated with a query. |
One important point for some of the more sophisticated uses on this Wiki (e.g. templates, properties, etc.) - you might not see their effect on other pages until you refresh those pages using the More->Refresh tab at the top of the wiki. This is because a lot of the elements are cached, and a simple refresh on the browser won't necessarily refresh the cache. | One important point for some of the more sophisticated uses on this Wiki (e.g. templates, properties, etc.) - you might not see their effect on other pages until you refresh those pages using the More->Refresh tab at the top of the wiki. This is because a lot of the elements are cached, and a simple refresh on the browser won't necessarily refresh the cache. | ||
Line 45: | Line 45: | ||
===Creating New Properties=== | ===Creating New Properties=== | ||
− | To create a new property, assign it on a page using standard Property Syntax. This can be done [https://www.semantic-mediawiki.org/wiki/Help:Properties_and_types inline], but most often in this wiki | + | To create a new property, assign it on a page using standard Property Syntax. This can be done [https://www.semantic-mediawiki.org/wiki/Help:Properties_and_types inline], but most often in this wiki you will see the [https://www.semantic-mediawiki.org/wiki/Help:Setting_values set] directive used. |
<nowiki> {{#set: | <nowiki> {{#set: | ||
Line 54: | Line 54: | ||
When you have saved this property, reference the [https://www.semantic-mediawiki.org/wiki/Help:Factbox Factbox] located at the bottom of the screen. If this is not visible, insert the line | When you have saved this property, reference the [https://www.semantic-mediawiki.org/wiki/Help:Factbox Factbox] located at the bottom of the screen. If this is not visible, insert the line | ||
<nowiki> __SHOWFACTBOX__ </nowiki> | <nowiki> __SHOWFACTBOX__ </nowiki> | ||
− | at the bottom of the wiki page. Remember to remove this line when you have completed it. This will show you the properties created on this page and their values. You can click on the links to the new properties to open their wiki pages. Conversely, you could simply navigate to Property:Property_1_Name in the Wiki if that is easier (and skip the whole factbox thing - but - I like to see the values). On the property page | + | at the bottom of the wiki page. Remember to remove this line when you have completed it. This will show you the properties created on this page and their values. You can click on the links to the new properties to open their wiki pages. Conversely, you could simply navigate to Property:Property_1_Name in the Wiki if that is easier (and skip the whole factbox thing - but - I like to see the values). On the property page you will want to declare the property [https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes dataype]. The default type is Page, but it is still useful to set this. You can see the datatypes specified or our properties in the table above. It is a good idea to look at the Wiki markup on these pages and copy it from a similar property. |
− | Also | + | Also, in the sidebar of the Wiki, there is a ''Browse properties'' link that shows the properties of the Page. This has some useful information as well. |
===Restricting Property Values=== | ===Restricting Property Values=== | ||
Line 67: | Line 67: | ||
Add permissible values as listed items starting either with "*" or "**" to the "MediaWiki:Smw_allows_list_..." page, e.g. "* Bar" or "** Foobar" to page "MediaWiki:Smw_allows_list_Foo".</nowiki> | Add permissible values as listed items starting either with "*" or "**" to the "MediaWiki:Smw_allows_list_..." page, e.g. "* Bar" or "** Foobar" to page "MediaWiki:Smw_allows_list_Foo".</nowiki> | ||
− | However, might want to go one step further and auto-generate this list from our own properties. For instance, all of our domains are marked with the [[Property:Is domain]] and our facilities are marked with the [[Property:Is facility]] | + | However, you might want to go one step further and auto-generate this list from our own properties. For instance, all of our domains are marked with the [[Property:Is domain]] and our facilities are marked with the [[Property:Is facility]], if you view the pages for [[MediaWiki:Smw_allows_list_Domains]] and [[MediaWiki:Smw_allows_list_Facilities]], you will see that they have the correct unordered lists. But if you view the source, you will see something like the following (from [[MediaWiki:Smw_allows_list_Domains]]): |
<nowiki>{{#ask: [[Is domain::True]] | <nowiki>{{#ask: [[Is domain::True]] | ||
|format=template | |format=template | ||
Line 74: | Line 74: | ||
}} </nowiki> | }} </nowiki> | ||
− | This autogenerates the correct ordered list for everything marked [[Property:Is domain]]. One might think that using the |format=ul would create the appropriate unordered list format (with the * in front), but it | + | This autogenerates the correct ordered list for everything marked [[Property:Is domain]]. One might think that using the |format=ul would create the appropriate unordered list format (with the * in front), but it does not. Therefore, this query removes the page link (link=none) and reduces the entry to simple text, and then it uses the template [[Template:Starlist_for_allow_value_list]] to render the text with a * in front of it (''See [https://www.mediawiki.org/wiki/Help:Templates help on templates] for an explanation of templates''). This works well. |
− | If | + | If for some reason you do enter a value that is not on the allowed list of values, the page will render a small warning icon like this: [[File:small_warning_icon.png|12px|Small Warning Icon]].. |
There are some other lurking gotchas that can show up. The default list size is 50. This can be set by $smwgQDefaultLimit in the CustomSettings.php file (on the server, not the wiki). I have asked to have this changed - but you would need to check to see what the actual value is. This can be overridden on a case by case basis by using the limit=100 (or limit=500) or whatever value you want - as one of the parameters in the ask wiki. So - wherever you ask for something like equipment, you certainly want more than 50. Likely the same for software. This showed up in the ask section for [[MediaWiki:Smw_allows_list_Equipment]]. This "ask" has been changed to have a limit of 500. | There are some other lurking gotchas that can show up. The default list size is 50. This can be set by $smwgQDefaultLimit in the CustomSettings.php file (on the server, not the wiki). I have asked to have this changed - but you would need to check to see what the actual value is. This can be overridden on a case by case basis by using the limit=100 (or limit=500) or whatever value you want - as one of the parameters in the ask wiki. So - wherever you ask for something like equipment, you certainly want more than 50. Likely the same for software. This showed up in the ask section for [[MediaWiki:Smw_allows_list_Equipment]]. This "ask" has been changed to have a limit of 500. |
Latest revision as of 15:16, 15 June 2023
This wiki is created on MediaWiki Version 1.35.7 (2912741).
The goal of this wiki is to provide information on the facilities, equipment, tools, supplies, and software available in the George Fox University Maker Hub. If you have never edited a Wiki before, you should reference the documentation on the MediaWiki site - specifically the page on Editing.
This page gives information on the structure of this Wiki and how to appropriately edit this Wiki. Also, try out the Sandbox for editing practice. There is also a special google drive for Maker Hub Crew.
This site makes use of the standard extension, Semantic MediaWiki. This extension allows us to set one or more properties on unique wiki pages. These properties can then be queried within other pages and the results can be dynamically displayed in a variety of result formats. The main benefit is that a lot of entries can be auto-generated to allow easy navigation of the site as the site develops and evolves. The editors can add new pages, attach properties to those pages, and then have those pages automatically show up on other pages. This saves the editors from having to maintain a variety of lists on multiple pages.
For example, on the Main Page, there is a section for Facilities. This section looks like this:
==[[Facilities]]== The Maker Hub is comprised of the following [[Facilities|facilities]]. These links describe each area and the resources within those areas. {{#ask: [[Is facility::True]] |format=ul }}
The ask directive is a Semantic MediaWiki inline query. This particular query searches the wiki pages for pages that have the property Is facility set to True. (There is an article on Property naming and in the best practices section it is advised that you use a verb phrase to describe properties). Also, properties can have various datatypes - in this case, the property datatype is Boolean. The |format=ul line directs the results to be printed out as an unordered list.
The value in this particular setup is that when a new facility is added to the space, it will automatically show up in this list. Now, one might argue that facilities are not going to show up at frequent intervals, and this is true. However, we can extend this practice to create new lists, and Equipment is one of the major ones. The use of properties allows us to have properties that mark pages as equipment (Is equipment::True), and to say that the equipment is located in a particular facility (Is Located in facility::Machine Shop), and to indicate that the equipment is used in a particular domain (Is used in domain::Metal). The use of properties rather than page structure gives us tremendous flexibility in expanding to future groupings. Imagine that we might want to see all equipment that is used on Wood that is located in the Machine Shop or the Wood Shop. This can be easily generated with a query.
One important point for some of the more sophisticated uses on this Wiki (e.g. templates, properties, etc.) - you might not see their effect on other pages until you refresh those pages using the More->Refresh tab at the top of the wiki. This is because a lot of the elements are cached, and a simple refresh on the browser won't necessarily refresh the cache.
Video Tutorials
The Basics
Refresh
If you just made an edit and it doesn't show up immediately, the cache needs to be cleared. You can either 1) wait some time and it will eventually fix itself or 2) go to the top right of the page where it says "Move" and then click "Refresh."
Properties
You can see all of the properties in use on the page Special:Properties. However, these are all of the properties in use in the entire Wiki. To identify the properties of interest to us, we will mark each of them with the Boolean property Property:Is property. Clicking on this link shows every property we have marked with this. However, we would also like to add the datatype property (Property:Has type) as well as a description for our own use (Property:Has description). We can query these properties and display a table here like this (view the source to see how this is done):
Description | Datatype"Has type" is a predefined property that describes the datatype of a property and is provided by Semantic MediaWiki. | Allowed Values"Allows value list" is a predefined property that can specify a reference to a list that holds permissible values to restrict value assignments for a property and is provided by Semantic MediaWiki. | |
---|---|---|---|
Has QR code | The QR Code image for the resource - link to Wiki page | Page | |
Has ace | The person in charge of the machine. | Record | |
Has certification | The URL for the certification resource | URL | |
Has description | This is just a text description of the resource | Text | |
Has email address | An email address. | ||
Has function | The general use of the resource | Text | |
Has icon | The Maker Hub icon for the resource | Page | |
Has icondesc | The image description for the icon | Text | |
Has iconwname | The Maker Hub icon (with name) for the resource | Page | |
Has image | An image of the resource | Page | |
Has imagedesc | The description of the image | Text | |
Has make | This brand of the resource (like a car, e.g. Toyota) | Text | |
Has model | The model of the resource. (like a car, e.g. Prius) | Text | |
Has name | The name of the resource. | Text | |
Has redirect | The text to redirect to. | Text | |
Has second ace | The second person in charge of the machine. | Record | |
Has tool | Details of a tool. | Record | |
Has tool page | The page of the tool | Text | |
Has url | The URL for the resource | URL | |
Has version | The version number of the resource. | Text | |
Is domain | Mark this page as a domain. Domains are areas in which equipment or resources are used, like wood, metal, plastic, electronics, etc. | Boolean | |
Is equipment | Equipment marks a page as a piece of equipment. Equipment is any resource that requires certified training | Boolean | |
Is equipment icon | Equipment icon | Boolean | |
Is facility | Facilities are rooms within the Maker Hub | Boolean | |
Is field | Fields are various majors such as Electrical Engineering, or Mechanical Engineering. This property is mainly useful for categorizing software | Boolean | |
Is laser cutter equipment | Mark this page as laser cutter equipment | Boolean | |
Is located in facility | Declare a facility in which one would find this resource | Page | Facilities |
Is network led server | This is the server address for the Network LED Lights | Boolean | |
Is property | Declare this property to be one of our "special" properties for this Wiki | Boolean | |
Is sheet metal equipment | This is a property to declare a piece of equipment as sheet metal equipment. This allows us to create a subpage under Metal for sheet metal specific equipment | Boolean | |
Is software | Identify this resource as software | Boolean | |
Is soldering iron equipment | Mark this page as soldering iron equipment | Boolean | |
Is supply | Mark this resource as a supply | Boolean | |
Is tool | Marks a tool. | Boolean | |
Is used in domain | Declare a domain in which this resource is used | Page | Domains |
Uses equipment | Declare equipment used by this resource | Page | Equipment |
Uses software | Declare software used by this resource | Page | Software |
Creating New Properties
To create a new property, assign it on a page using standard Property Syntax. This can be done inline, but most often in this wiki you will see the set directive used.
{{#set: | Property_1_Name=Value | Property_2_Name=Value }}
When you have saved this property, reference the Factbox located at the bottom of the screen. If this is not visible, insert the line
__SHOWFACTBOX__
at the bottom of the wiki page. Remember to remove this line when you have completed it. This will show you the properties created on this page and their values. You can click on the links to the new properties to open their wiki pages. Conversely, you could simply navigate to Property:Property_1_Name in the Wiki if that is easier (and skip the whole factbox thing - but - I like to see the values). On the property page you will want to declare the property dataype. The default type is Page, but it is still useful to set this. You can see the datatypes specified or our properties in the table above. It is a good idea to look at the Wiki markup on these pages and copy it from a similar property.
Also, in the sidebar of the Wiki, there is a Browse properties link that shows the properties of the Page. This has some useful information as well.
Restricting Property Values
When you create a new property that has a Page (or Text, or possibly other values) that can be assigned to a wide range of values, it might be nice to restrict those values to a particular subset so that typos don't render the property useless. This has been done on the Is used in domain and the Is located in facility properties. You will see a special property added to those property pages called Allows value list. The [help link provides all of the pertinent information, but of special importance is the following:
Two steps have to be taken to use this special property: Add [[Allows value list::...]] to a property page for defining a page reference, e.g. [[Allows value list::Foo]] will define page "MediaWiki:Smw_allows_list_Foo". Add permissible values as listed items starting either with "*" or "**" to the "MediaWiki:Smw_allows_list_..." page, e.g. "* Bar" or "** Foobar" to page "MediaWiki:Smw_allows_list_Foo".
However, you might want to go one step further and auto-generate this list from our own properties. For instance, all of our domains are marked with the Property:Is domain and our facilities are marked with the Property:Is facility, if you view the pages for MediaWiki:Smw_allows_list_Domains and MediaWiki:Smw_allows_list_Facilities, you will see that they have the correct unordered lists. But if you view the source, you will see something like the following (from MediaWiki:Smw_allows_list_Domains):
{{#ask: [[Is domain::True]] |format=template |template=Starlist for allow value list |link=none }}
This autogenerates the correct ordered list for everything marked Property:Is domain. One might think that using the |format=ul would create the appropriate unordered list format (with the * in front), but it does not. Therefore, this query removes the page link (link=none) and reduces the entry to simple text, and then it uses the template Template:Starlist_for_allow_value_list to render the text with a * in front of it (See help on templates for an explanation of templates). This works well.
If for some reason you do enter a value that is not on the allowed list of values, the page will render a small warning icon like this: ..
There are some other lurking gotchas that can show up. The default list size is 50. This can be set by $smwgQDefaultLimit in the CustomSettings.php file (on the server, not the wiki). I have asked to have this changed - but you would need to check to see what the actual value is. This can be overridden on a case by case basis by using the limit=100 (or limit=500) or whatever value you want - as one of the parameters in the ask wiki. So - wherever you ask for something like equipment, you certainly want more than 50. Likely the same for software. This showed up in the ask section for MediaWiki:Smw_allows_list_Equipment. This "ask" has been changed to have a limit of 500.
Philosophy on New Properties
Basically, there isn't much of one. The beauty of properties is that you can add them, and mix and match them to form unique queries. I suspect that there will be a query that shows every piece of equipment in the Maker Hub. There could be one that shows everything - equipment, tools, supplies, etc. There could be one that shows equipment in the machine shop. And then, one can create more focused properties. I have initially created two as examples - Is sheet metal equipment and Is soldering iron equipment. I suspect that we will mark the Sheet Metal Shear as both Is equipment and Is sheet metal equipment. This way, the Sheet Metal Shear will show up on lists that show equipment as well as lists that show the more focused sheet metal equipment. However, Soldering Irons will be marked as Is equipment, but the Weller_WES51 will only be marked as Is soldering iron equipment. This means that Soldering Irons will show up on a general equipment query, but the Weller_WES51 will not. This decision is somewhat arbitrary and is left to the Wiki editors. In this case, there is no reason to see every particular type of soldering iron on a general equipment list, but the sheet metal shear will show up.
Equipment
Adding new equipment is fairly simple. Start by copying another Equipment page and edit to suit. The structure of each equipment page is not fixed, and will likely evolve. However, the header should be fairly similar. Below is an example of the Weller WES51 soldering iron page.
{{#set: |Is soldering iron equipment=True |Has make=Weller |Has model=WES51 |Is located in facility=Tool Room |Is located in facility=The Hub |Is used in domain=Electronics |Has function=Soldering Iron |Has url=http://www.weller-toolsus.com/soldering/systems/weller-wes51-station-50-60w-120v-wes51.html |Has icon=File:soldering_icon.png |Has icondesc=Soldering Iron Icon |Has image=File:WellerWES51.jpg |Has imagedesc=Weller WES51 |Has description=Standard soldering iron in the Maker Hub }} [[{{#show: {{FULLPAGENAME}}|?Has icon|link=none}}|100px|left|top|{{#show: {{FULLPAGENAME}}|?Has icondesc}}]] [[{{#show: {{FULLPAGENAME}}|?Has image|link=none}}|thumb|upright=1.5|{{#show: {{FULLPAGENAME}}|?Has imagedesc}}]] The [http://www.weller-toolsus.com/soldering/systems/weller-wes51-station-50-60w-120v-wes51.html Weller WES51] is the standard [[Soldering Irons (General) | Soldering Iron]] used in the [[Main Page| Maker Hub]]. The Iron includes the WES series power unit, PES51 soldering pencil, PH50 stand, and sponge. A PW50 probe is available for checkout that allows the user to set (or unset) the soldering temperature. Each iron is mounted to a tray along with a soldering kit. <br/>__TOC__
The first section is used to set a large number of page properties. The first of these normally sets the page to be an "equipment" page using the [Property:Is equipment] property. However, as the Weller is a subset of Soldering Irons, it doesn't set this property, it instead sets the [Property:Is soldering iron equipment]. Others properties set images and icons and such. Notice the duplicate [Property:Is located in facility] entries to show how the equipment is located in more than one facility. This can also be done with domains. The #show sections are generic and display the icon and the image with the appropriate descriptions. These are the same on every equipment page. There is then some explanatory text followed by an optional table of contents with a line break before it. The table of contents will show up automatically if there are 3 or more headings, but this makes it show up explicitly at this point - and the line break is just for visual effect.
One property that is not on the Weller is the [Property:Has certification], as this is done on the [Soldering Irons] page. Most equipment should have this as it is a link to the certification URL (typically a Canvas course).
Equipment Queries
The current incantation of Machine Shop has a couple of queries. The first is straightforward. It looks like this:
{{#ask: [[Is equipment::True]] [[Is located in facility::Machine Shop]] |format=Category }}
This is looking for pages that are marked as equipment and located in the Machine Shop. The format lines says to present it in category format. The category format could be replaced with other options, such as ordered or unordered lists. See the Semantic Mediawiki Ask documentation for explanations.
The second one is a little more complicated. It looks like this:
{{#ask: [[Is equipment::True]] [[Is located in facility::Machine Shop]] |?Has icon=Icon |?Has image=Image |headers=show |format=template |template=EquipmentListTable |introtemplate=EquipmentListTableIntro |outrotemplate=EquipmentListTableOutro |link=none }}
In this case, the search is for the same pages, but the query is being asked to return the icon from the Has icon property, and also the image from the Has image property. The format is not one of the preformatted types, but a template, which is provided as the EquipmentListTable template. This template is a little tricky in that it embeds CSS tags to render the table. To make this work, a CSS head and tail are required, which are provided by the EquipmentListTableIntro and EquipmentListTableOutrotemplate. Finally, to make the CSS references connect with something, CSS entries have to be installed in the MediaWiki CSS structure. This can be done via the MediaWiki:Common.css page where we have created some special CSS entries for use by this table.