SMW Queries

From XPUB & Lens-Based wiki

DO BEFORE

Write metadata of the documents you uploaded to the itchwiki, see how to in [[Help:Metadata]]

You can see what documents you uploaded in the [[Special:NewFiles]] page where you can filter by your usename


Have https://git.xpub.nl/XPUB/special-issue-11-wiki2html cloned

The dependencies described in the README installed.

Check if:

  • pandoc is installed with `which pandoc` if so it will return the location of its binary, if not, it will return nothing
  • Python libs Jinja and mwclient libraries with: `pip3 freeze | grep -iE 'jinja|mwclient'` pip3 freeze gives you a list of the installed python libraries; grep search for either jinja or mwclient


Fill in you user details in to login.txt as describe in the REAMD

Run `python3 download_imgs.py` to get all the images stored in the itch wiki downloaded


IN PAIRS WRITE A QUERY YOU LIKE TO MAKE:

  1. in plain English
  2. in the Ask interface
  3. in the query2html.py script


QUERYING MATERIAL THROUGH WIKI Ask REQUEST

  • [[Special:Ask]] interface
  • [[Help:Ask]] How to create ask queries
    • mediawiki API call - ugly, long and messy! Needs to URL encode reserve character. That is when it makes sense to use something like the mwclient library for python which can take care of those things for us


QUERYING MATERIAL THROUGH PYTHON SCRIPT

python3 query2html.py --conditions '[[Date::>=1970/01/01]][[Date::<=1979/12/31]]'
python3 query2html.py --conditions '[[Creator::~*task force*]]'


Note: to avoid confusion or problems is better to leave the `--printouts` `--sort` `--order` arguments as the default. Otherwise document parts will start to get grouped not according to their Title, hence creating documents made from different original parts.

USING GIT BRANCHES

To avoid disrupting the work that one might be doing rather than work on the master branch of special-issue-11-wiki2html you can use branches

Read more on git branches at https://www.atlassian.com/git/tutorials/using-branches


create a new branch with your name of the feature you want to implement:

git branch mynamebranch

start working withing your branch

git checkout mynamebranch

make pushes to remote, under your branch

git push origin mynamebranch

go back to master branch

git checkout master