Changes

Jump to navigation Jump to search
no edit summary
Line 38: Line 38:  
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, 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 code on these pages and copy it from a similar property.  
+
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 - 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 49: Line 51:  
  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]. 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 ordered lists. But if you view the source, you will see something like the following:
+
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]. 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 55: Line 57:  
  |link=none
 
  |link=none
 
  }} </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 apparently 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.
 +
 +
===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 - [Property:Is sheet metal equipment] and [Property:Is soldering irons equipment].

Navigation menu