Jump to: navigation, search
Community portal of Semantic MediaWiki

Welcome to the community portal. This is the place for general inquiries, your ideas or comments concerning this wiki. Here you may get in touch with one of the admins of this wiki, who also use this portal as a noticeboard.

If you are looking for support with problem about the software itself, please have a look at the info page on getting support.

We are always looking for ways to improve documentation and communication with the community therefore it would help us if you could take 5 minutes of your time and fill out the survey form. Thank you.

First page
First page
Previous page
Previous page
Last page
Last page

ORCID user template

I have created Template:User ORCID, for those of you who have registered for an ORCID identifier. You can see an example on my user page. Please feel free to use it on your user page, or to port it to your own wiki. Pigsonthewing (talk) 01:39, 20 September 2014 (CEST)

Pigsonthewing (talk)00:39, 20 September 2014

I am still undecided if this is acceptable on this wiki. Nothing against providing such information on the user page, but I guess on some wikis a plain link instead of an extra template does the same goodness. Let's see how you future involvement looks like on this wiki. Cheers

[[kgh]] (talk)11:51, 20 September 2014

Conditional formatting according to properties

Hello, (this question was first raised in the wrong place here):

Is there a simple way of adding conditional formatting to a template that gets filled with a form and annotated properties? Let's say, there is a property:has Priority, and priority A should color the section red, B orange, C yellow… and so on. I've searched and tried a lot, but only found info about conditional formatting for tables.

Goal is to let the user choose an option within a form (+ template) and according to the answer display a certain formatting.

I guess, it's not going to work with the #if parser function, instead I've tried to use #switch like this:

<div style="background-color:#{{#switch:{{{Priority}}}
|#A = faa8a8
|B = facba8
|C = faf1a8
|#default = e1e4e2}};">

It's not reacting at all, if within <span> tags, but gives out the value of #default, when within <div> tags. (I fear I might have totally misunderstood the concept here?)

MediaWiki uses something like this in the Extension template, but it's hard to make out the relevant parts...

I would be happy about any hints pointing me in the right direction.

Zabien (talk)13:45, 18 September 2014

Demos not working

Hi, I was searching for some result formats and I think some of them are broken or misconfigured, see:

Jaider Msg20:52, 2 January 2014

Thanks for reporting. I filed an issue about the fatal errors here

Jeroen De Dauw (talk)00:39, 3 January 2014

Fatal errors have been fixed.

Jeroen De Dauw (talk)00:56, 3 January 2014

The Slideshow format is not working again, see the "Result:" section, after "Example".

Jaider msg23:18, 10 August 2014

It is a known issue [0] but someone has to pick-up the task.


MWJames (talk)23:27, 10 August 2014

Schema _> form for uploading or referencing video plus fields for annotation

Hi All, I am a total noob- although I bought Yaron's book and have been feverishly trying to get the site up. I have the current SMW bundle running and am trying to create a form for uploading a video, then making a few notes, mostly text, a couple boolean, etc. I'd like to be able to edit the fields later (and also the form, that's why I thought schema would be the way to go...) I can't seem to get past the video part though. Is it possible to upload via a form? Would I be better off just uploading the videos separately, then embedding them?

This is for a school research project on gesture analysis and my professor is expecting a presentation on Weds. So, I'm stressing a bit :) Any advise appreciated. I even have a minuscule research budget if someone wants to make $60


Ikesmith (talk)18:22, 8 August 2014

Hi - I hope the book is useful! And yes, Page Schemas is the way to go. Support for displaying videos is pretty primitive, but yes, if you have a way to embed uploaded video files (via the Widgets extension, ideally), then you can upload them via the form - it's just a matter of editing the template to display the video file in the right way, which you would have to do by hand.

Yaron Koren (talk)18:42, 8 August 2014

"sort" option in query does not include results that have no value in sorted field

Edited by another user.
Last edit: 21:23, 4 March 2014


The following query brings up no results (because Begin Date is blank):

{{#ask:[[Category:Market research]]

But this query brings up all results:

{{#ask:[[Category:Market research]]

I don't think that it logically follows that a "sort" option should exclude results where sorted field is blank.

Patelmm79 (talk)21:00, 4 March 2014

Well, if you do not query for a property you cannot sort by it since your printout statement cannot be fulfilled. Somehow you have to pick up the date from the pages/subobjects with the query. See sorting results. So your query should be

{{#ask:[[Category:Market research]]
[[kgh]] (talk)21:29, 4 March 2014

This is about sort statements that filter out the rows in which the sorted field is null, I think. An old and already reported problem of SMW.

Alexander Mashintalk02:42, 5 March 2014

A simple workaround to this is to define, in the template, some default values for the properties of interest if they are not already set. ie:

{{#if: {{{ArgIwant|}}}||[[PropIneed::SomeDefaultValue]]}} 

It's more elegant to do it where it's actually printing, but this has overcome the whole 'sort' issue any time I've needed it. Though, it assumes all the articles call some templates to which you could do this.

Lbillett (talk)03:56, 6 July 2014

"Crosstab" to summarize links between pages in categories?

When choosing SMW as knowledgebase, I was expecting, that I could summarize links between pages in tables to find inconsistencies. However, I seem to not be able to find a way to do this. Maybe I am missing something?

Here is what I would like to do: 1) Query for pages in two separate categories 2) Find all links (perhaps filter them for attribute) between the pages of these two categories 3) Display these links in a table (Crosstab), where pages of one category is on one axis and pages of the other category are on the other axis. Cells display the links / attributes linking these pages

Is there an extension, to do something like this?

Best Regards,


Ruediklein (talk)22:50, 19 June 2014

{{#ask:[[Category:Semantic MediaWiki documentation]] [[Docinfo author::<q>[[Category:Developer]]</q>]]|?Docinfo author}} will produce:

 Docinfo author
Accessing drilldown pageMWJames
Adding subobjectsJeroen De Dauw
Adding subobjects 1.7.0 - 1.7.1Jeroen De Dauw
Administrator manualMarkus Krötzsch
Architecture guideMarkus Krötzsch
Argument declaration in templatesDenny Vrandecic
Ask APIJeroen De Dauw
Average formatYaron Koren
BibTeX formatYaron Koren
Broadtable format 0.4 - 1.6.1Markus Krötzsch
Broadtable formatMarkus Krötzsch
Browsen und SuchenMarkus Krötzsch
Browsing interfacesMarkus Krötzsch
Calendar formatYaron Koren
Calendar format 1.4.0 - 1.5.6Yaron Koren
Category formatYaron Koren
Type CodeMarkus Krötzsch
Concept cachingMarkus Krötzsch
ConceptsMarkus Krötzsch
ConfigurationMarkus Krötzsch
Configuration 1.6.0 - 1.6.2Markus Krötzsch
Count formatMarkus Krötzsch
Custom unitsDenny Vrandecic
Markus Krötzsch
Custom units 1.5Denny Vrandecic
D3 chart formatMWJames
DSV formatJeroen De Dauw
Data exchangeMWJames
Data visualizationMWJames
Datatables formatMWJames
Debug formatMarkus Krötzsch
Directionality supportMWJames
Displaying informationMarkus Krötzsch
Displaying information 1.5.1 - 1.6.2Markus Krötzsch
Displaying information 1.7.0 - 1.7.1Markus Krötzsch
Download 1.6.1 - 1.7.0Markus Krötzsch
Download 1.7.1 - 1.8.0Markus Krötzsch
Dygraphs formatMWJames
Einführung in Semantic MediaWikiMarkus Krötzsch
Embedded formatMarkus Krötzsch
Enhancing query formsMWJames
Eventcalendar formatMWJames
Eventline formatYaron Koren
ExtensionsMarkus Krötzsch
Extensions (fr)Markus Krötzsch
Further resultsMWJames
Feed formatMWJames
Fehler meldenMarkus Krötzsch
Fixed propertiesNischayn22
... further results

This shows all Docinfo author links from Category:Semantic MediaWiki documentation to Category:Developer.

Displaying it as a crosstab will require templated output, most probably, using Lua (particularly, mw.loadData).

Alexander Mashintalk02:58, 20 June 2014

Querying for extra columns without filtering


Is it possible within a #ask to query for extra columns of data to display, without applying a filter to them? For example, I'd like to do something like the following query from SPARQL:

SELECT ?year ?name WHERE {

 ?run ranIn ?year .
 ?run runOf ?module .
 ?module name ?name . 


I can do all of this except getting the name in #ask syntax. Is it possible to do this? Also, how often are inline #asks updated?


Hyphz (talk)19:31, 10 June 2014

How to Query Maps without coordinant's

A thread, portal/How to Query Maps without coordinant's, was moved from here to Category talk:Semantic Maps examples. This move was made by Kghbln (Talk | contribs) on 8 May 2014 at 08:21.

Guidance on creating an employee form?


I'm working on creating a single form that produces an infobox for applicant, freelancer and employee pages.

What I would like to do[edit]

These three types of pages share 90% of the same fields -- that's why I opted for a single class instead of 3 different classes. The issue is that the remainder 10% are fields that are exclusive to one or more of the aforementioned types of pages. For example: "Interview Date" should only be displayed in the infobox when the type of page is an applicant. Another example: "Join Date" should only display on employee type of pages (it would be silly to display "Join Date" on an applicant type of page -- as they're in the selection process).

What I have tried[edit]

So far I have modified the form to use "show on select". There is a field property called "Type" which allows the user to select between applicant, freelancer and employee. Depending on the selection, certain fields are shown and others are hidden (the 10% I talked about before). The majority of fields are shared by all three types.

The problem is that while these fields hide and show themselves correctly when editing a page with the form, they ALL display regardless on the template, e.g. "Join Date" and "Interview Date" shown up on all three types of pages.

What I need[edit]

I've been trying to figure out the ideal way to have the template (which controls the infobox display) to have the same hide and show functionality as the "show on select" option that the form provides.

These are the options I have considered:

  • Add an #ask query to the template which uses FULLPAGENAME and ?Has type to retrieve whether the page is of an applicant, freelancer or employee type. From there use IF statements on each of the fields that should be hidden/displayed according to the value of ?Has type. E.g., if the ?Has value = Applicant then display "Interview Date", else don't display it.
  • Create a template for each type of page to display only the appropriate fields, and then call the template by, again, using an #ask query and IF statements on the person page.

Both options seem messy and I doubt they'd update properly (due to asking for info that is on the same page where the value is set in order to display/hide fields ...). I also have the feeling I'm missing something obvious and it's doing my head in.

My questions[edit]

  • Has anyone tried to create a similar type of form in the past?
  • What's the best way of going about this?

Any guidance, tips or pointers in the right direction would be greatly appreciated.

If you need more information or clarification please let me know.

Thank you.

Optimae (talk)00:18, 18 January 2014

You may be missing something - in the template, you don't need to use a query to get the value of a field, if you already have that field. In other words, you could have something like "{{#ifeq:{{{Type|}}}|Employee|....}}".

Yaron Koren (talk)16:58, 19 January 2014

ParserFunctions and Templates and SMW???

I have some templates that use ParserFunctions (specifically #if, if that matters). How do I use SMW properties with those templates? For example, I have
| termend =

| termstart =

Where I have a property for term start (Term start) and one for term end (Term end). How do I tie these template items to those properties? (It's got to be possible, right?)

K llandon (talk)20:42, 22 April 2014

Okay, apparently it doesn't like my code, even inside code tags. See for example at - we're talking about the part with lots of {{{ for terms (I've pulled this template over from Wikipedia).

K llandon (talk)20:50, 22 April 2014

SRF / Jqplotchart - max parameter ?

A thread, portal/SRF / Jqplotchart - max parameter ?, was moved from here to Help talk:Jqplotchart format. This move was made by Kghbln (Talk | contribs) on 15 April 2014 at 17:11.

Not returning properties and/or categories in custom namespaces

A thread, portal/Not returning properties and/or categories in custom namespaces, was moved from here to Help talk:$smwgNamespacesWithSemanticLinks. This move was made by Kghbln (Talk | contribs) on 15 April 2014 at 17:10.

How to delete pages that are not connected to a category... [SMW]


Could someone please explain to me how to delete pages in WIKI? The url is There are some old pages that are not connected to a category that need to be deleted.



Simone (talk)12:10, 15 January 2014

You will need access to the wiki and the "delete" permission which is usually connected to the "administrator" group. After that it is just a matter of clicking the right button in the action menu at the top of a page.

[[kgh]] (talk)13:40, 15 January 2014

Has anybody experience with the SemanticGraph extension and SMW versions > 1.7?

Hello all,

I'm new here. Perhaps this has been asked before, but I didn't find a possibility to search the forum for keywords. And I'm not sure if this is the right place for this question, should I use the mailing list instead? But anyway, here it is:

I want to present the relations in my knowledge base as navigable graphic. I have found the extension SemanticGraph [1] which looks quite nice. Unfortunately there is only a version available which works with SMW 1.5. I am working with SMW 1.7.1 and I couldn't get this to work.

Has anybody experience with this extension in combination with newer versions of SMW, particular 1.7.1 and can tell me what to do?

Thanks, Martin

Martinscm (talk)17:43, 10 January 2014

You can always use template format combined with GraphViz.

Alex Mashintalk09:10, 11 January 2014

css styling for <code> tags.

Hello. Templates can not be used between <source lang = "blabla"> tags but they can be used between <code> tags. Would it be possible to put the below css in MediaWiki:Common.css? This greatly improves readability of the text between <code> tags? Regards.

 * Redesigned <code>.
 * Should improve readability by not having the samples blend into the white background,
 * but by having a visible (though subtle) border around the code sample.
code {
  border: 1px solid #ddd;
  padding: 1px 4px;
  border-radius: 2px;
Jongfeli (talk)17:28, 8 January 2014

Heiya Jongfeli, I added this to Common.css. Didn't MediaWiki use this for a couple of months before it was dropped for some reason. Looks pretty familiar to me. Cheers

[[kgh]] (talk)20:39, 8 January 2014

Sorry, yes you are right, but I can't remember if I got it from MediaWiki or Wikipedia. This means I did not "write" the above css :). Thanks for putting it in common.css . Regards

Jongfeli (talk)21:16, 8 January 2014

Well, you never claimed that you were the author. :)

[[kgh]] (talk)21:24, 8 January 2014

Querying for non-zero values does not seem to work


The following query searches for all competitor in Mexico with a yield that is greater than zero. However, result does list competitors with zero yield. {{#ask:[[CompetitorlName::<q>[[Country::Mexico]]</q>]][[Yield::>0]] |?Date |?Yield |format=table }}

However, this query eliminates those competitors with zero yield {{#ask:[[CompetitorName::<q>[[Country::Mexico]]</q>]][[Yield::>0.000001]] |?Date |?Yield |format=table }}

Am I doing the first query incorrectly somehow?

Patelmm79 (talk)22:21, 20 December 2013

Use {{#ask:[[CompetitorlName::<q>[[Country::Mexico]]</q>]][[Yield::≥0]] |?Date |?Yield |format=table }}. Alternatively, set $smwStrictComparators to false.

Alex Mashintalk08:25, 21 December 2013

Querying for non-empty values


I'm trying to query those pages to count where a particular property is not empty. I've used as follows:

{{#ask:[[Competitor::! ]] |?Competitor |format=count }}

A number does result indicating how many pages have "Competitor" not null, but an error results as well: "Empty strings are not accepted".

Let me ask, is this the right way to query for non-empty properties? If this is the only possible way to do, is there a way to suppress the error?

Patelmm79 (talk)23:14, 3 December 2013

Have you tried {{#ask:[[Competitor::+]]|format=count}}?

Alex Mashintalk03:43, 4 December 2013

Thanks, that works great! And how about those situations where the field IS empty?

I tried [[Competitor::-]], but did not work.

Patelmm79 (talk)20:47, 12 December 2013

This is not covered by SMW. You can only query for existing property values. Probably you may do a {{#if: {{{Competitor}}} | | {{#set:Competitor provided=No}} }} with the property "Competitor provided" is of data type "boolean" and then query for pages with the "No" boolean.

[[kgh]] (talk)21:42, 12 December 2013

Thanks for that!

Patelmm79 (talk)21:15, 20 December 2013

Form Driven Knowledge Base


I am looking for an open source solution that would allow me to create an internal knowledge base for our customer service team.

What I want to do is be able to populate the knowledge base using forms. I want to capture and maintain information in a standardized way. For instance, our customer service team wants to document certain characteristics and FAQs on the customers we service so that all representatives can reference it without having to ask the same questions over and over again. In the ideal case, the customer service reps would go to the knowledge base, search for the customer they wanted the information on, and then receive a knowledge base article on that customer with a variety of different types of information - a table of key customer contacts and their contact information, notes on the client, any relevant documents, FAQs with answers, etc. Furthermore, when a customer service rep creates a knowledge base article on a customer, I'd like for them to input these values through a form (with text fields, drop down boxes, data pickers, etc.).

I came close to accomplishing this with MediaWiki and the Semantic Forms add-on, however, I'm having trouble creating constructs for arrays of information. For instance, I want our reps to be able to add multiple contacts for a customer. I created a form per the example provided in the documentation, however, adding the contacts via contact names doesn't seem to allow for multiple contacts with the same name stored independently per customer. I hope that makes sense.

Can anyone help point me in the right direction to accomplish this?

Thanks in advance.

Mabraham77 (talk)17:57, 9 December 2013

You can't store different contacts (or more generally, entities) with the same name. If you have two different contacts named "John Smith" (I assume that's the kind of thing you're asking about), you'll have to use some kind of disambiguation scheme - like including the middle name, or company name, or something. If you're creating contact pages via a form, you could do it by using the "one-step process" and including "unique ID" in the page name formula.

Yaron Koren (talk)19:58, 9 December 2013

[Closed] Stumped by some weird problem.

Edited by author.
Last edit: 00:04, 27 August 2013


I'm kinda stumped by some problem at a mediawiki-site.

I'm not sure what's up here, what might be the root of the problem, or how to describe/report it.


Site background: Game relate, and game-user driven content and code(templates).

  • Recently update (by site owner) from MediaWiki v1.18(if I'm correct) to MediaWiki v1.21.1
  • Also using Semantic MediaWiki V1.8.0.5. (RoB-site relies heavy on this one.)
  • Additional site wiki setup info:

Main template used on most, and related problem pages.

General rundown:
There is this page . On that page the "Object(s) Required" infobox field list the objects/pages that are needed for this "Running_Rabbit_Sausage". These needed objects/pages are set by the "objectsreq" setting. Those needed objects/pages in turn pickup this information again, and display it in there "Required By" field.

Related setting on that page: "|objectsreq = [[requires::Fox Meat]] x2, [[requires::Intestines]], [[requires::Rabbit Meat]]"

As is one of the required items of Running_Rabbit_Sausage, it displays Running_Rabbit_Sausage as one of its required items ... and here is also the problem I'm looking at. Its displaying two Running_Rabbit_Sausage source related pages, and we at the RoB wiki site are unable to remove the second one, or figuring out whats up here.

Note that the currently second listed page "Running Rabbit Sausage(backup)" is related to trying to fix the problem by moving the source page, and than deleting it. (which did not work)

Anyone might have some additional ideas what up here?


Also asked at [1]

MvGulik (talk)07:55, 26 August 2013

Please. Even some general ideas on what might be triggering something like this are welcome.

One idea was that it might be that there where two active pages with slightly different file-names. File-names that are seen as identical names by the wiki system. Although I think this is highly unlikely. The real problem with this idea is that I don't know how to test, or verify, that. If even possible.

Note: I only have wiki-admin rights. So I have no access to the core wiki system stuff. (Never have setup a wiki-system myself, so would not even know what to do at that level.)

MvGulik (talk)17:17, 29 August 2013

It looks like you've run into some issue with "phantom properties". I would try recreating that "Running Rabbit Sausage(backup)" page, this time without any properties - maybe that will get rid of the phantom property. If that works, you can delete it again.

Yaron Koren (talk)23:56, 29 August 2013

At first, it looked as this was a manifestation of the old MW and SMW bug: both SMW and MW logs use the title under which the article was accessed to edit it rather than the proper article title to record changes into logs and semantic properties into SQL storage. The "proper" title and the title the article was accessed by may differ if they are considered the same by the database collation.

But in your case, it seems that you had somehow managed to create two articles called Running Rabbit Sausage (nbsp, perhaps?), one of which was later renamed into Running Rabbit Sausage (backup). In this case, {{#ask::}} worked correctly. Just remove Running Rabbit Sausage (backup).

Alex Mashintalk15:57, 30 August 2013

I still have to give the replies a closer look and some additional thoughts (+ taking a look at the SMW user mailing list.)

But on the subject of removing the "Running Rabbit Sausage (backup)" page. That page was removed/deleted. And when it was deleted, it had its original content already cleared/replaced with a local {{delete-tag}}.

I just restored that page today (for history restoration reasons). But before doing so I checked if that unwanted second/double linkup was still there, and it was (in this case a link to the, at that moment deleted and cleared, "Running Rabbit Sausage (backup)" page.

Or: Just deleting that page did not work (yet).

I'm getting some additional ideas here. Time to work them out a bit more. ...

MvGulik (talk)17:11, 30 August 2013

Perhaps, you could try to rebuild SMW data for the page Running Rabbit Sausage (backup) (by id).

Alex Mashintalk17:33, 30 August 2013

Shorty after the recent MediaWiki version update of the RoB-wiki site, both the "Database installation and upgrade" and "Data repair and upgrade" where run. (Its unknown if at that point this problem was already there. Although I think it probably was already there, just not spotted yet.)

Those problem pages where also saved without making any changes. Which generally fixes most problems. But that unfortunate did nothing in this case. (Although I'm planning on doing that on all related pages again. Just in case I mist one, and to see if something changes. ... I might get lucky. ;) )

MvGulik (talk)20:01, 30 August 2013

After reading up on MediaWiki ghost pages. I don't see any way a ghost page can be removed/modified by any normal wiki-actions. So I called-in the RoB-wiki owner/bureaucrat to look for, and deleted, the actual ghost file.

Some additional data on the ghost page. (for those interested)

The related page was original create on a other wiki site, and imported to the RoB-wiki. (On the original site there where no signs of the existing of a similar ghost page.)
Considering the ghost page was generating duplicate template output. It was not empty. Which makes sens if the ghost page was created when it was imported.
I tried to check this by modifying the (old)templates it might be using/calling. But after 6 hours that did not resulted in the expected change.
Either the wiki needed more time to auto update, the change would never show this way for ghost pages, or the ghost page was using/calling the Infobox_metaobj template (which I considered implausible).

I think that about reps it up. (unless no ghost page can be found by the RoB-wiki owner.)

Thanks so far for the additional help and information.

MvGulik (talk)12:51, 31 August 2013

Semantic properties cannot be queried unless page is re-saved

I'm running MediaWiki with the Semantic MediaWiki and LinkedWiki extensions. Semantic MediaWiki is configured to store semantic data in 4store and I can query 4store with SPARQL and show the results on the wiki using LinkedWiki extension.

I also have a form that I use to create technology roadmaps and each technology roadmap contains sub-objects that store semantic properties for a particular technology such as support status, start and end dates, and version.

When I save the page, the SPARQL query that queries those semantic properties doesn't return anything because it doesn't see the semantic properties I just saved for the technology roadmap page I created. One way I can make it work it to click on edit and then click on save. I don't have to make any changes, I just re-save the page and it works. Another way to make it work it to run the SMW_refreshData.php script to refresh the page that I just created.

I read about this issue and I tried using extensions that disable cache on a per page basis (MagicNoCache) and I also tried using hooks to run the refresh data script after the page is created (super slow and it didn't work).

Has anyone ever run into a similar problem?

Do you have any ideas on how I can solve this?

Thank you.

Carlosc (talk)15:37, 22 November 2013
First page
First page
Previous page
Previous page
Last page
Last page