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

Templates not enabled for semantic in-text annotations due to namespace restrictions.

We just installed SMW Bundle 2.1 and the templates are not enabled, whereas the form pages are. I'm just the content person, not the one that did the install. Can anyone point me to the config parameter?

Dlacy (talk)21:38, 20 February 2015

$smwgNamespacesWithSemanticLinks is the setting that has to be changed by the system administrators.

[[kgh]] (talk)22:12, 22 February 2015

Semantic Forms and Parameters


I have installed Semantic Media Wiki (last version) on a local machine. To creat forms, attributes etc. I installed the extension Semantic Forms. Everything is working so far, only the options for the parameters to edit the values etc. don't show up.


Can anyone help?

Best, Matthias

Gosso (talk)17:56, 6 February 2015

I believe you will be better of asking at the Semantic Forms support page. Do not forget to mention your setup, e.g. version of MW, SF, PHP etc.

[[kgh]] (talk)18:24, 6 February 2015

SMW Page Lists

Good day:

I have been experimenting with with sub-objects and queries hoping to find a programmatic way to generate lists of related articles based on property values.

I see there are three extensions called Dynamic Page List that do this. I have the strong impression that none of them do so based on Semantic MediaWiki properties.

Can anyone suggest a path I might follow to create the lists I desire?

Thank you

AKSHA (talk)01:10, 9 November 2014

I would use SMW to do this instead of installing DPL.

[[kgh]] (talk)18:22, 6 February 2015

Semantic Internal Objects to Headings

Good day:

I would like to use queries to concatenate a string that includes property values so that these can function as article headings something like the following.

==={{#ask:[[Name::+]] [[NameFirst::Bruce]] [[NameLast::Wayne]] |? NameFirst }} {{#ask:[[Name::+]] [[NameFirst::Bruce]] [[NameLast::Wayne]] |? NameLast }}===

I have managed the following.

{{#set_internal:Name |[[NameFirst::]]= |[[NameLast::]]= }}

I have created the above object on a template page. I assume I have done this incorrectly, which may be my problem. I have put data into several articles to test my syntax.

  • Bruce Wayne
  • Bruce Banner
  • Peter Parker
  • Kevin Matchstick
  • Clark Kent

I then query the data successfully with the query below.

{{#ask:[[Name::+]] |? NameFirst |? NameLast }}

My problem so far is that I cannot get a query to produce plain text like: Bruce

How can I achieve this?

Thank you AKSHA

AKSHA (talk)00:37, 7 November 2014

Try {{#show: Bruce Wayne | NameFirst}}.

Alexander Mashintalk02:55, 7 November 2014

Thanks for that very good advice. The following provided the desired output: "Peter"

{{#show:[[Name::+]] [[NameFirst::Peter]] |?NameFirst }}

The following provided the output: "Bruce Bruce".

{{#show:[[Name::+]] [[NameFirst::Bruce]] |?NameFirst }}

This confused me until I realized that my data include: Bruce Wayne Bruce Banner

Thank you, thank you.

Have you any sense why both results come with the following error message?


  • Some part ".." of the query was not understood.
  • The symbol "[[" was used in a place where it is not useful.
  • The part "]]" of the query was not understood. Result might not be as expected.
AKSHA (talk)04:19, 7 November 2014

{{#show:}} shows a property of only one page. It's {{#show:Bruce Wayne | ?NameFirst}}, not {{#show:[[NameFirst::Bruce Wayne]] [[Name::+]] | ?NameFirst}}. I'm surprised it worked at all. If you need more complex query conditions than page name, use {{#ask:[[NameFirst::Bruce Wayne]] [[Name::+]] | ?NameFirst#- | format = list | mainlabel=- | limit=1 | searchlabel = - | headers = hide}}

Alexander Mashintalk08:01, 7 November 2014

I put in the following ask and get no output:

{{#ask:[[NameFirst::Bruce Wayne]] [[Name::+]] | ?NameFirst#- | format = list | mainlabel=- | limit=1 | searchlabel = - | headers = hide}}

I think this is because no property value corresponds to “Bruce Wayne” so I change [[NameFirst::Bruce Wayne]] to [[NameFirst::Bruce]]:

{{#ask:[[NameFirst::Bruce]] [[Name::+]] | ?NameFirst#- | format = list | mainlabel=- | limit=1 | searchlabel = - | headers = hide}}

This returns: Bruce-. I want to get rid of that “-” so I experimentally remove a “-” from the query and view the page without it. This makes for an unwanted output so I edit the query and repair what I broke. Then I try deleting another “-”. This testing proves that if I remove the “-” from “searchlabel”, I get a pure property value: Bruce

{{#ask:[[NameFirst::Bruce]] [[Name::+]] | ?NameFirst#- | format = list | mainlabel=- | limit=1 | searchlabel = | headers = hide}}

Lessons learned[edit]

In an #ask the first parameters are the object you are querying and the property value you are searching for. They come before the first pipe “|”. Otherwise, place order is not a factor so the following are equivalent:

  • {{#ask:[[NameFirst::Bruce]] [[Name::+]] | }}
  • {{#ask:[[Name::+]] [[NameFirst::Bruce]] | }}

Many formatting instructions can apply to a single query as long as no two contradict. Each must be separated by a pipe “|”.

This solution provides a fine grained example of how to provide multiple formatting instructions to a query. It also provides a working example so that an inexperienced user can make individual changes and see the result. This helps a new user get over a number of very basic mistakes. By new user I mean myself.

Thank you for walking me through this solution Alexander Mashin.

Equipped with this example, I feel confident of making a better class of mistakes.

AKSHA (talk)16:44, 7 November 2014

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 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 formatMarkus Krötzsch
Broadtable format 0.4 - 1.6.1Markus 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
Extension:Semantic WatchlistJeroen De Dauw
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
First page
First page
Previous page
Previous page
Last page
Last page