Community Central
Community Central
Forums: Admin Central Index Technical Help Getting a report of all SMW properties linked to a page
Central's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 4230 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.


Semantic MediaWiki question this time out. We use SMW at w:c:tardis to help us control the mind-numbing number of crew members we catalogue. Because Doctor Who has been running for 50 years, there's plenty of movement in the crew — camera operators become cinematographers, floor managers become directors, etc. But it's almost impossible for anyone to know every position that every crew member has ever held. So what I'm wondering is how to write an SMW statement that will print out a list of all SMW properties linked to a page — without having to specify all the applicable property names. In other words, I'm looking for a statement with the functionality of "WhatPropertiesLinksHere". Any guesses how to achieve this? czechout    fly tardis 14:56: Tue 18 Sep 2012

What you want is a query for one value over all properties in the wiki. And then display the properties instead of the value…
I reckon, the most you can get is Special:WhatLinksHere with namespace set to Property. Sounds like a DPL thing.--PedroM (talk) 23:13, September 18, 2012 (UTC)
Is that what I want? I'm not sure that it is. I ultimately want the values, too. What I'm really trying to do is create a simple, un-parametered template that people can just plop down on a page and it will then list all the jobs that a person has ever had. Currently what I have is the simple one-job template called tardis:template:pcred. This allows me to specify the job and I'll get a list. For instance, if I type {{pcred|director}}, it'll show me every episode on which the PAGENAME was credited as a director. And that's fine and all, but what I need is something where I can just type {{pcred}}, and it'll give me every job they ever had and every episode on which they had a particular credit.
I know it can't be a DPL thing, because DPL doesn't create a relational database so much as it manipulates categories. This is about answering the fairly sophisticated question, "Given the list of properties on this wiki, what are the ones in which PAGENAME is a value, and which other pages share the value of PAGENAME in that property?" czechout    fly tardis 03:03: Wed 19 Sep 2012
To clarify: In your first post you said "without having to specify the applicable property names", but in the second one you say "given the list of properties on this wiki". Do you have a list of all jobs on doctor who? If there were say, ten, could you not just have a template something like (I dunno the specifics of the code)
==Credits==
{{#if:{{pcred|director}}|
===As director===
{{pcred|director}}|
}}
{{#if:{{pcred|writer}}|
===As writer===
{{pcred|writer}}|
}}
{{#if:{{pcred|producer}}|
===As producer===
{{pcred|producer}}|
}}
etc...
Because presumably if they haven't worked as a certain job, pcred will just return an empty string?--Category:Acer4666 10:22, September 19, 2012 (UTC)
I ultimately want the values, too. - No you don't. On your wiki, people are only stored as SMW property values. So you already know the value, but want every property (name) that somewhere on the wiki is set to this one value. You probably mean to say you want the pages where a property is set to it as well.--PedroM (talk) 13:51, September 19, 2012 (UTC)
Maybe smw:Help:Selecting pages#Subqueries for properties can help you in your task.--PedroM (talk) 14:14, September 19, 2012 (UTC)