Extension talk:Semantic MediaWiki/LQT Archive 1

The best way for getting support for Semantic MediaWiki is  is to post to its user mailing list. Comments made below are not very well monitored by the developers. There are various options for making yourself heard:


 * If you have a usage question, please post them to the SMW support mailing lists (archives).
 * If you found a bug or want to propose a new feature, please file it at MediaZilla. Bugs and requests are regularly considered by core developers and have a great impact on the future development of SMW.
 * If you want to contribute to the development, please contact the development community at the SMW developers' mailing list (archives).

When asking for help or describing bugs, do not forget to provide necessary details about your configuration, version details for all relevant components, information about other extensions that are used, and, if possible, a URL where the problem can be seen.

The below talk page is most useful for comments regarding the wiki page, but of course you may do as you like (it's a wiki, after all). --Markus Krötzsch 16:47, 19 January 2009 (UTC)

Creating a SemanticForm and using tags
Hi guys hope you can help. If I can get this working ok, this will be a MAJOR thing for us :>)

Example: Lets say I have an extension called NewTaskTag, which lets you insert a  into a wiki page, then you manually insert parameters as follows..

 Task = This task completed at.. Time = 6pm Priority = Severe Updated by =   Task = Time = Priority = Updated by = 

The extension then renders the html into a table like format.

Because this is a manual job, I wanted to make it easier to do this.

So, Ive installed Semantic Mediawiki along with SemanticForms.

These are great, but I wanted to know if you could use a form to do the above instead of using the normal edit option with Mediawiki.

The problem I see is how will the form know how to interpret and pass the entered bits/eg. the fields to the extension, and how would you say, in a form, place a filed to say to use ?

To further clarify what Im trying to say is the following.

If I want to use the  in a wiki page, I just go to a new page, click on Edit, and enter the following:

 Task = Time = Priority = Updated by =   Task = Time = Priority = Updated by = 

I then complete each line, eg.Task = This new task, Time = 6pm, etc etc.

What Id like to do is the following:

Create a new form that has this format:

Task: [___ Text Box for Task entry___] Time: [___ Text Box for Time entry___] Priority: [___ Text Box for Priority entry___] Updated By: [___ Text Box for Updated By entry___]

All the user would have to do is then input in the text boxes the required data, then the  would do the rest. The questions I have though are:

1)How would the form know that each text box is actually in the format: Task = --Roc michael 13:29, 28 April 2009 (UTC)

#ask sort
I am having an issue within the sorting function.

So, my desired end result is to have the table format I have within the template be sortable.

Here is the problem I encounter. When the table is first created the sorting is correct. When the sorting icon within the "Date" column is clicked to changing the sorting from descending to ascending the dates become out of order and can never achieve any type of logical order again (until the table is refreshed).

Now, to fix this I have used the following code:

This works, but I want the "mainlabel" result to display a linked image/icon or "View More Info..."

Thank you in advance for all responses and comments.

-Dgennaro 13:31, 16 July 2009 (UTC)

making a property without linking
Is there a way to make a property and not have an automatic link be generated from it? I read the SMW documentation on "Properties" and it eludes to this being possible but doesn't say how.--Iloveemeryville 23:35, 16 August 2009 (UTC)


 * Sure thing - add the property has type:String or has type:Number to the property page. (Alex Brown)


 * Help:Type String mentions that "Values cannot be longer than 255 characters (if you use non-Latin characters, this number might be smaller). For longer strings, use datatype Text instead."

Dynamic Pagelist <= vs. => Semantic Mediawiki
I have started a Comparison of Dynamic Pagelist x Semantic Mediawiki. Please help to give valuable information for a good choice. --Jannis 19:19, 22 December 2009 (UTC)

Sémantique
Bonjour,

À mon avis, il est abusif de parler de wiki sémantique. La sémantique, ce n'est pas juste classer des mots par classes, sous-classes, propriétés, attributs ; ça c'est de la logique. La sémantique, c'est la signification, ce qui va des rapports pas forcement logiques entre les mots aux significations en contexte. Je ne vois rien de cela dans cette extension qui est tout au plus une manière plus sophistiquée de catégoriser des pages. 92.158.202.166 09:26, 29 December 2009 (UTC)

Missing Factboxes?
I have just installed SMW 1.5 in MW 1.14 (PHP and MySQL versions both 5.x).

I see the Special Pages, and I see the Types and Properties listed, but I see no Factboxes anywhere. I added a TestSMW page with the appropriate content, but no factboxes. Tried IE and FF (just in case) and disabled all other extensions, still no factboxes.

I'm concerned that I could only find one other guys with this issue...in the meanwhile, will verify I can get it going on a new wiki, again, just in case. Any ideas? --John Thomson 20:08, 21 March 2010 (UTC)


 * Found it, sort of. Looks like I have a problem with my custom skin that is preventing the Factboxes from appearing.  Digging now! --John Thomson 20:24, 21 March 2010 (UTC)


 * We're having the same problem here and it seems to be related to the skin configuration since the factboxes appear on some skins (like Modern) but not on other skins (like Monobook). Did you find anything on your side? Factboxes stopped working after upgrading MW from 1.13 to 1.15. --Mlirette 22:34, 19 July 2010 (UTC)

Recurring Events on SMW 1.5.0
Hi, if someone would like to use this parser function one should install the latest version of SMW available from trunk. This is due to intensive and helpful improvements since the latest stable release of SMW 1.5.0 Cheers --kgh 14:51, 23 April 2010 (UTC)

#show not working well with
Has anyone else encountered issues with #show not working well with ? Tisane 05:36, 10 May 2010 (UTC)

Sqlite
Interesting, but still doesn't work with sqlite. 90.31.177.152

SMW 1.5.1.1 breaks SCQ in MW 1.13.4
SMW 1.5.1.1 does not fully opperate correctly with MW 1.13.4. The only thing that I have found breaks is Semantic Compound Queries. It works great with MW 1.14

--Dgennaro

Show pages without a property
Hi, I know how to show all the pages of the wiki that, for example, have Location::London. I also know how to show all the pages that have a location info, but it's not London: Location::!London. Finally, I know how to show all the pages that have a location info: Location::+. However, I don't know how to show the list of the pages that don't have the Location property, so that I can generate that list in order to fullfill the missing information. Thanks! --Wikypedista 00:15, 9 July 2010 (UTC)

Adding templates?
Hi, I'd just like to know if it's possible to use the extension to add a new template each time you go to form edit? Rather than edit a template? For example, if I edit a forum and what to add this template each time I edit with form and want to add a new one each tiume, could FormEdit do that for that form only (as in, not for any other form)?--Technobliterator 19:14, 20 July 2010 (UTC)

Czech language
Hi, is it available also in the Czech language?--Juan de Vojníkov 14:19, 25 July 2010 (UTC)


 * Ano. Yaron Koren 04:15, 26 July 2010 (UTC)

Nice, was prepared for "ne".--Juan de Vojníkov 06:25, 26 July 2010 (UTC)

Putting default form in a template?
Is there any way to put a default form edit in a template? Like, does page has default form::foo work? Oh and thanks for your other answers.--Technobliterator 18:50, 28 July 2010 (UTC)
 * Sorry wrong talk page--Technobliterator 18:50, 28 July 2010 (UTC)

Edit with Form button?
So we'd like to add an image to the Edit with Form button, can you tell me what the button is called in the .css? Or how to make an image for it?--Technobliterator 12:45, 4 September 2010 (UTC)
 * Try installing "FireBug" for Firefox to detect and alter CSS Classes on the fly. Dunno if it helps but for me the "Edit with Form" Button is a list point with id="ca-form_edit". Using the Vector Skin myself.

Mediawiki is buggy all the sudden
the property pages are giving me Property:Subcategory of and Property:Modification Date

Database appears not to be updating
When I have the following wiki text:
 * Set Attr3: Attr3::value3
 * Attr3:

I would expect to see:
 * ''Set Attr3: value3
 * Attr3: value3''

But the second 'value3' above does not appear. The database is not updating as fast as it should. Over the course of 15 minutes, I did the following 10 times: but even still the call to: still didn't return anything. Also it seemed that old attributes were left from earlier versions that should have been removed from the data-base. Aberdeen01 05:07, 16 November 2010 (UTC)
 * Click 'Edit'
 * Made a very minor change to the text
 * Clicked 'Save'
 * Experiencing the same issue. I get updates only after i edit a page twice after changing a property and then using.

Best way to check property existance?
I'm currently messing around with the ParserFunctions extension to check existance of a property. However, the update rate is rather poor. This results in a wrong output on my templates that only can be corrected by editing a page twice.

Example: A template showing grafics depending on a Property "Type of Information"

Can this be optimized?

SOLUTION: #show in combination with Semantic Properties (and other parser commands)
As multiple people (including me) have the problem described above, here is my working quick and dirty solution:


 * 1) Edit LocalSettings.php
 * 2) Add the line: $wgEnableParserCache = false;

Note: $wgCachePages = true; can be left as is to increase Wiki performance.

This results in an instant update of #shown properties in the wikitext which allows insta-switching of template output depending on a given parser-condition (i.e. #switch)

Cons: May negatively influence wiki performance in parser-heavy situations. Probably has any other severe effects that i don't know about.

A way to query starting from a certain page within a category?
Hi,

I want to create an alphabetical navigation (back, forward) from ~18000 images within a certain category. Now: how can I ask for the member before and after the current page? I tried several things, but I don't want to read out all entries from the database, just the members before and behind. As far as I know it's not possible, is it? With the API I can achieve this by fetching two results sorted in ascending and descending order when the current page is named for instance File:File10.jpg: /o/api.php?action=query&list=categorymembers&cmtitle=Category:MyLargeCategory&cmdir=asc&cmcontinue=FILE10.JPG| /o/api.php?action=query&list=categorymembers&cmtitle=Category:MyLargeCategory&cmdir=desc&cmcontinue=FILE10.JPG| The first will give me File:File10.jpg, File:File11.jpg, File:File12.jpg etc. and the second will give me File:File10.jpg, File:File09.jpg, File:File08.jpg, File:File07.jpg etc. So I can get follower and forerunner. Can this be done with #ask? Something like. If not, could this be implemented in the future to build a browsing through categories? --Andreas 23:30, 14 January 2011 (UTC)
 * Well I can answer this myself: just use an additional property with the > and < operator:

But remember these alphabetic ranges will work only for a string property. --Andreas 23:45, 14 January 2011 (UTC)

Piped links?
I have a couple of string-type properties whose values contain one or several URLs. I would like to be able to have them displayed as piped links in inline queries. By default, square brackets are not allowed in properties (and setting $smwgLinksInValues to true would probably pose a risk to the system), so I was wondering if inline queries could be tweaked in such a way that URLs are shown as piped links or alternatively as numbered links. For instance, is there a way one can wrap two square brackets around the requested property values? Or to define placeholder symbols in the property value and then to have the placeholders replaced with square brackets in the inline query? Regards, Cavila 09:24, 18 January 2011 (UTC)


 * Check out the "template" format. Yaron Koren 13:19, 18 January 2011 (UTC)
 * Thanks, that's what I suspected and what I've been focusing on so far, but the SMW documentation is a little sparse for a newbie like me. The idea described here is to render results as plain text and then to relink them in the format template (eg. [ ] for a numbered link, I suppose?), but the symbol # (as in ) does nothing to remove the external link. Having multiple values per property per page (i.e. per row) may also present something of a challenge. An example:


 * {| class="wikitable"

! inline query ! format template "Template:X"


 * Recipe = property of type "Text"
 * URL = property of type "String"

The recipe is: "". It is described on the following websites: [ ].


 * 1 = recipe; 2 = URLs
 * }
 * ... is the wrong way to go. Cavila 23:47, 18 January 2011 (UTC)


 * Okay - as noted above, the mailing list is probably the best place for this sort of question. Yaron Koren 01:21, 19 January 2011 (UTC)
 * Well, it's the lack of anonymity that kept me from directing my questions to the mailing list, but I've found another workaround anyway: Extension:Labeled Section Transclusion. I don't know if it can handle large sets of data without straining the server too much, but for more modest purposes it seems to work very well. Cavila 10:18, 20 January 2011 (UTC)

Duplicated tableheader sort-arrows and Js-error
When creating normal inline queries (table output) on any wiki page the clickable header icons look normal. But whenever i put the query on my mainpage i have two sort-arrows show up in the header instead of one per property. Also i get theses JS errors shown in the IE8 status bar when i click one of the arrows: Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; FDM) Timestamp: Thu, 3 Feb 2011 08:01:19 UTC

Message: 'undefined' is null or not an object Line: 213 Char: 2 Code: 0 URI: http://localhost/wiki/extensions/SemanticMediaWiki/skins/SMW_sorttable.js

Message: 'undefined' is null or not an object Line: 132 Char: 2 Code: 0 URI: http://localhost/wiki/extensions/SemanticMediaWiki/skins/SMW_sorttable.js

I'm using: SMW Version 1.5.5 on MW 1.16 (Mike)

Making the inline query list pages that do not have a property set?
I currently have some wiki articles set up where I use a template to mark certain pages as "Unapproved". The template comes with a "Approved::No" property that also marks that page as unapproved.

Ideally, I would like to have a query that searches for all the pages in a category that does not have the "Approved" property. Is this currently possible? --Gossamer 00:36, 8 February 2011 (UTC)


 * So you're trying to show not pages with a property but instead the ones missing it? Sounds rather impractical to me since you could get a lot of unwanted "sideload" from this query in terms of different namespaces or "non-content" pages that you don't want to display at all. My suggestion would be giving your pages a "non approved" property by default (i.e. upon their creation, within their template, default values, etc.). Assigning them to a special (hidden) category (i.e. "Draft") also helped me a lot with the later queries since i can narrow these down with ease. (Mike)


 * I have a similar issue, if Wildcards are written as "+" and allow any value for a given condition. For example, born in::+ returns all pages that have any value for the property «born in». What is the wildcard for when there is no value? In the example below I am trying to find the pages where the review date is still blank - what should be where the (?) is in Date for review::?

Thanks, Rich

{{#ask: Date for review::? format = broadtable
 * ?Name of policy owner
 * ?Creation date
 * sort=Creation date
 * order=DESC |
 * limit=10
 * mainlabel= etc etc

variable inside brackets in an ask
I have a table which I am trying to populate with a nested ask.

{ !Thumbnail !Member


 * }

Template:PeopleTable is defined as

|  ||  | |-

In the : parameter evaluates to 'empty' but   on its own transcludes as expected.

Any ideas greatly appreciated.

sementic mediawiki doesnt supported oracle?
Dear all

Here same i have installed mediawiki1.17 with oracle database.it working fine but whenever i add extension like sementic mediawiki,external data, give some error. how can i remove the error. and search option also not working.

if mediawiki cant work with oracle then why oracle as a database there in installation. please give some suggestion..

error: databaseOracle:doQuery" database returned error "942:ORA-00942 table or view does not exist...

Property as part of link?
I currently have a field set up that allows a user to fill in their own name and mark themselves as the author of an article.

author::

Ideally, I would like this to automatically link to that member's user page on the wiki.

I tried the following, but that didn't seem to work. user:[[author::]]

Is this possible? Posted by User talk:Gossamer on 30 May 2011


 * I don't think so. You're trying to embed a semantic property within a regular internal link. Regardless of the data type your property belongs to (page, string, type, etc.), that's not supposed to work, but there's a workaround:  would assign to a value to the property 'author' without displaying anything to the page, and User: would give you a link to the user page. Hope that helps. Cavila 14:20, 24 June 2011 (UTC)

Italics in property type 'Text'?
A normal query for properties with the type 'text' fortunately preserves italics. However, when the limit is set to zero so that a link is provided rather than the actual results, the new query does not render any italics, instead showing the double apostrophes that are used in the wiki markup for italics. Is this a known bug or an ordinary database issue? Cavila 16:00, 21 June 2011 (UTC)

A new bug?
Normally, when a query is limited to a predefined maximum number of results (e.g. ), one can click a link and continue browsing a table which contains all results. I know this feature is somewhat limited (see my comment abouts italics not being rendered, for instance; also,  can't be suppresed; etc.), but since MW 1.17 and SMW 1.6, there's a more serious defect: the "next 20" button sends me to a Special:Ask page, rather than allowing me to continue. The page is mostly empty except for the "limit" field, which is pre-filled with a long string containing parts of the query. So the inevitable question is: is this a new bug? Cavila MW 1.17, MySQL 5.1.57, Php 5.2.17 15:00, 14 August 2011 (UTC)
 * For the record, SMW 1.6.1 has just been released. Although there appears to be a new, possibly related bug (escaping issues?), the one I reported here has been taken care of! Many thanks, Cavila MW 1.17, MySQL 5.1.57, Php 5.2.17 18:55, 22 August 2011 (UTC)

extermely complex
I give up. In my 6 years wiking have never seen an extension that is so complex. Everytime I enable this coding in my localsettings.php, my wiki goes blank. Okip 23:04, 3 September 2011 (UTC)
 * Certainly, it is an extension with advanced features and not always easy to have a clear starting point. Documentation is available but not always sufficient for someone who is starting to understand SMW, but anyone involved in improving SMW is trying to help, meaning that if you have a specific problem you can post it here (with as much detail as possible) and people are willing to lend a hand but generalizations are not helpful in solving any issues.


 * Our first advise would be to install a clean 1.17 MW system, install SMW 1.6 only (no other Semantic extensions are installed), add parameters as described under LocalSettings Extension:Semantic MediaWiki, and at last run Special:SMWAdmin to ensure tables are initialized. With those steps the system is prepared and ready to go. Having a clean system allows you to familiarize yourself with the functionality of properties and values and how to apply them in a wiki environment. The migration of content can be done at any time and is advisable only after you identified taxonomies and ontologies you want to use in connection with SMW. --MWJames 03:20, 4 September 2011 (UTC)

Roman numerals
Just a thought for users who like me, occasionally need to use Roman (rather than Arabic) numerals, for instance for page numbers. Unfortunately, Roman numerals are not understood by Type:Number or Type:Quantity, but there may be a workaround, however imperfect it may be. Extension:RomanNumbers - not to be confused with Extension:RomanNumerals - can be used to convert between Roman and Arabic numerals, which means that it can control the display of numerals. I haven't tested this, but I imagine that something like the following might work:


 * where Foo represents an Arabic numeral.

When the property value is queried, you should be able to use the #roman tag again, for instance in a special formatting template. One disadvantage with the extension is that allows only for capitalised Roman numerals, but it should be fairly easy to write a custom extension for lowercase numerals (just a copy the php code and replace whatever needs replacing).

Of course, when using templates with semantic forms, things become a little more complicated, but it may be a good starting point. Any further thoughts would be welcome. Cavila MW 1.17, MySQL 5.1.57, Php 5.2.17 10:33, 16 September 2011 (UTC)
 * It just occurs to me that in the example for page numbers, something like p. xi should obviously not be equated with p. 11. So if you want to query a list of articles in a book and sort it by page number (where a separate property would be required for the first page only - number ranges are not understood in SMW), prefaces and introductions whose pages are numbered in Roman numerals present something of a problem. Since Type:Number has become stricter in SMW 1.17, non-numeric values are no longer accepted, so I can't think of any solution at the moment. Cavila MW 1.17, MySQL 5.1.57, Php 5.2.17 10:49, 16 September 2011 (UTC)

FlaggedRevs + Semantic MediaWiki issue
We are trying to build a QMS (Quality Management System) using MediaWiki. With FlaggedRevs we build the workflow of document states (In process, Prepared, Revised and Approved). With Semantic MediaWiki's special Search Data page we have an automatic updated index (this is our "All Documents" page).

When we change a page's state, the page disappears from "All Documents". When the page is edited, even if not modified, the page appears again. This is a problem because the people that revise (and approve) the documents should change the state and then edit the document (without change it) to make it available in "All Documents".

With a trace in the database, we determine that the problem is in the "semantic metadata" in the mw_smw_* tables.

Specifically, the problem is the following code during the review (or approval):

680 Query DELETE /* SMW::deleteSemanticData Sgc03 */ FROM `mw_smw_rels2` WHERE s_id = '53' 680 Query DELETE /* SMW::deleteSemanticData Sgc03 */ FROM `mw_smw_atts2` WHERE s_id = '53' 680 Query DELETE /* SMW::deleteSemanticData Sgc03 */ FROM `mw_smw_text2` WHERE s_id = '53' 680 Query DELETE /* SMW::deleteSemanticData Sgc03 */ FROM `mw_smw_spec2` WHERE s_id = '53' 680 Query DELETE /* SMW::deleteSemanticData Sgc03 */ FROM `mw_smw_subs2` WHERE s_id = '53' 680 Query DELETE /* SMW::deleteSemanticData Sgc03 */ FROM `mw_smw_subp2` WHERE s_id = '53' 680 Query DELETE /* SMW::deleteSemanticData Sgc03 */ FROM `mw_smw_inst2` WHERE s_id = '53' 680 Query DELETE /* SMW::deleteSemanticData Sgc03 */ FROM `mw_smw_redi2` WHERE s_title = 'GestiÃ³n_de_la_documentaciÃ³n' AND s_namespace = '0' 680 Query SELECT /* SMW::deleteSemanticData Sgc03 */ smw_id FROM `mw_smw_ids` WHERE smw_title = AND smw_namespace = '53' AND smw_iw = ':smw' 680 Query UPDATE /* SMW::deleteSemanticData Sgc03 */ `mw_smw_ids` SET smw_namespace = '0' WHERE smw_title = AND smw_namespace = '53' AND smw_iw = ':smw'

This code is in ./extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php

We try to comment this code in the case of a review (or approval), the semantic metadata is not deleted, and the page dont disappear from "All Documents" (OK). But then, when the page is legitimately re-edited, the semantic metadata is inserted again, and this result in a hang in subsequent edits.

We are looking for a way in which the state changes do not eliminate the document for "All Documents" that also intelligently handle subsequent edits

Any advice is wellcome

Regards, Alfonso

Semantic Mediawiki and Bluespice fully featured
Hello,

do anyone know, if Semantic Mediawiki Extension and Bluespice fully featured are compatible?

Thanks for answering

RUN_MAINTENANCE_IF_MAIN issue with 1.16.x
I'm still using 1.16.5 and tried the latest stable version (and the latest svn version) and hit the problem of require_once( RUN_MAINTENANCE_IF_MAIN ) being unavailable. Some online research showed this being the fix in ~/extensions/SemanticMediaWiki/maintenance/SMW_setup.php: At the bottom of the file, replace require_once( RUN_MAINTENANCE_IF_MAIN ); with if( defined('RUN_MAINTENANCE_IF_MAIN') ) { require_once( RUN_MAINTENANCE_IF_MAIN ); } else { require_once( DO_MAINTENANCE ); # Make this work on versions before 1.17 } --Salquint 04:28, 22 December 2011 (UTC)


 * Trunk has a SMW_setup1.16.php file, which should work on 1.16. If it doesn't please let me know. --Jeroen De Dauw 19:00, 22 December 2011 (UTC)

Query with "limit=0" does not render markup for bold or italics
Any news on Extension talk: I was hoping I could recreate this issue on Referata, but Referata appears to be down at the moment. Cavila MW 1.17, MySQL 5.5.16, Php 5.3.8 13:36, 4 January 2012 (UTC)
 * Referata is up and running again - see now http://scratchpad.referata.com/wiki/Main_Page#Italics_and_bold_are_not_rendered for a test case. Cavila MW 1.17, MySQL 5.5.16, Php 5.3.8 09:06, 5 January 2012 (UTC)
 * This bug has just been filed at MediaZilla. Cavila MW 1.17, MySQL 5.5.16, Php 5.3.8 09:25, 5 January 2012 (UTC)