Semantic MediaWiki: Difference between revisions

From CoMakingSpace Wiki

(→‎Cheat Sheet: proper way of hidden annotation (thanks Martin!))
(→‎Cheat Sheet: unions of results (OR))
 
(7 intermediate revisions by the same user not shown)
Line 3: Line 3:
How we use it so far:
How we use it so far:
* [https://github.com/comakingspace/do-something/issues/130 giving equipment pages properties like "Tutor::" and "Location::"] so they can easily be listed accordingly
* [https://github.com/comakingspace/do-something/issues/130 giving equipment pages properties like "Tutor::" and "Location::"] so they can easily be listed accordingly
* integrating properties for images into InfoBoxes as a potential way to generate {{NavGal}}s
* integrating properties for images into InfoBoxes as a potential way to auto-generate {{NavGal}}s
** first experiment: [[Metal Workshop/Gallery]] (grabbing HasImage and HasCaption from [[MachineInfoBox]]es and [[ToolInfoBox]]es)
* making [[projects]] listable by their InfoBox dates with [[Property:ProjectDate]]
* experimental: adding interesting property tables for tool types such as [[Saws#Saw_Selection_(experimental)|cutting depths for saws]]
* ''what else can you think of?''
* ''what else can you think of?''


== Cheat Sheet ==
== Cheat Sheet ==
This is not supposed to replace the [https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki SMW documentation], but some things are nice to remember/share once you've finally found them:
This is not supposed to replace the [https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki SMW documentation], but some things are nice to remember/share once you've finally found them:
* [[Special:Ask]] - "sandbox" page for SMW queries ([https://www.semantic-mediawiki.org/wiki/Help:Special:Ask help])
** lets you practice [https://www.semantic-mediawiki.org/wiki/Help:Selecting_pages selecting pages] with auto-complete of parameters
* assigning properties
* assigning properties
** in-text annotation: <code><nowiki>[[Property::value]]</nowiki></code> (only "value", or its <code>|alt text</code>, is displayed)
** in-text annotation: <code><nowiki>[[Property::value]]</nowiki></code> (only "value", or its <code>|alt text</code>, is displayed)
** hidden annotation: use the [https://www.semantic-mediawiki.org/wiki/Help:Setting_values set function]
** hidden annotation: use the [https://www.semantic-mediawiki.org/wiki/Help:Setting_values set function]
*** alternatively, you could enter <code>| </code> (the space is important!) to the end of a property (e.g. <code><nowiki>[[Has demo::test| ]]</nowiki></code>) but that should not be necessary anymore
*** alternatively, you could enter <code>| </code> (the space is important!) to the end of a property (e.g. <code><nowiki>[[Has demo::test| ]]</nowiki></code>) which ''might'' be necessary in certain template elements
* [https://www.semantic-mediawiki.org/wiki/Help:Result_formats list of possible result formats]
* [https://www.semantic-mediawiki.org/wiki/Help:Result_formats list of possible '''result formats'''] (e.g. table or gallery)
* [https://www.semantic-mediawiki.org/wiki/Help:Property_page/Filter how to '''filter''' for values on property pages]
* [https://www.semantic-mediawiki.org/wiki/Help:Unions_of_results unions of results] - how to use "OR" instead of the (assumed) "AND" between two queries
** useful to make our [[MachineInfoBox]] find Tutors for Introductions to the "type" OR the "machine name", for example
** can also be used to embed machines of different types into the same page (if we want to do that)




[[Category:Software]]
[[Category:Software]]
[[Category:Wiki]]
[[Category:Wiki]]

Latest revision as of 02:06, 4 September 2022

We started using Semantic MediaWiki (SMW) for some "smart" functions of this wiki around June 2019. Feel free to join the effort!

How we use it so far:

Cheat Sheet

This is not supposed to replace the SMW documentation, but some things are nice to remember/share once you've finally found them:

  • Special:Ask - "sandbox" page for SMW queries (help)
  • assigning properties
    • in-text annotation: [[Property::value]] (only "value", or its |alt text, is displayed)
    • hidden annotation: use the set function
      • alternatively, you could enter | (the space is important!) to the end of a property (e.g. [[Has demo::test| ]]) which might be necessary in certain template elements
  • list of possible result formats (e.g. table or gallery)
  • how to filter for values on property pages
  • unions of results - how to use "OR" instead of the (assumed) "AND" between two queries
    • useful to make our MachineInfoBox find Tutors for Introductions to the "type" OR the "machine name", for example
    • can also be used to embed machines of different types into the same page (if we want to do that)