Semantic MediaWiki Community Portal
Welcome to the community portal.
This is the place for general inquiries, your ideas or comments concerning this very wiki. Here you may get in touch with one of the administrators of this wiki, who also use this portal as a noticeboard.
If you are looking for support with a problem about the software itself, please have a look at the info page on getting support.
Help?
I am interested in installing semantic wiki on Argumentrix, I'm just not sure if it's appropriate. We have an argument for each opinion people hold, and we attempt to make an exhaustive list of why people do and do not believe each statement. We're just settling down on a fully templated page (for examples see the homepage).
Is this appropriate for the semantic mediawiki? If so, can someone help me get it installed and set up? It looks a little beyond my capabilities, and I recently broke my wrist so I am a bit more handicapable than usual.
While I'm here, I'm looking for a simple bot to automate some maintenance stuff (fixing links, etc) on the wiki - I can pay a little, see my userpage for some details, respond here or my reddit forhire post or on Argumentrix wherever. Conclavion 06:42, 6 April 2012 (CEST) 23:08, 13 August 2012 (UTC)
- Heiya Conclavion, you should post to the mailing list for users with your issue. This portal is meant to hold general inquiries, ideas or comments concerning this wiki itself. Cheers --[[kgh]] 13:48, 6 April 2012 (CEST) 23:08, 13 August 2012 (UTC)
XML parsing error
Regarding the API (pls it's awesome, support it forever!!), I can't get the output format XML, only XMLFM, check here. Is it a bug or something? Thanks for this AMAZING extension, without it many things I'm planning wouldn't be possible. --Valento (talk) 20:18, 6 August 2012 (CEST) 23:09, 13 August 2012 (UTC)
- Heiya Valtento, thank you for liking this software. Your issue is definitively something to post to the mailing list for users. Cheers --[[kgh]] (talk) 00:42, 7 August 2012 (CEST) 23:10, 13 August 2012 (UTC)
- Ok, I've sent an email! --Valento (talk) 09:27, 9 August 2012 (CEST) 23:11, 13 August 2012 (UTC)
- Oh.. one more thing. Is it possible to somehow use 'action=ask' (through wiki's API) as a way of querying wiki information to external applications? I'm planning to do this, and it seems very likely I'll get it done! --Valento (talk) 09:29, 9 August 2012 (CEST) 23:11, 13 August 2012 (UTC)
help with adding properties to the form
When I try to assert a property into the form with type Text Wiki delete text before this property. Similar problem I had with asserting links into the form, and the line $smwgLinksInValues = true; in LocalSetting fixed it. Is there a command that would solve my problem? Michal (talk) 23:28, 29 August 2012 (UTC)
- I think you are lucky that it works with the links. It is a problem with PHP what prevents adding links into the value of type text. I myself never do it because there is always a problem with it at some stage.
- Assigning a property within the value of a property is not possible. Try to use just a free text without any datatype instead of a property of type text. Then you will be able to insert links and properties. Another way would be to use a property of type record. Still you would not be able to annotate inline. However, I do not know if this would serve your purpose.
- I suggest to post to the mailing list with such questions in the future. It gets more attention there and the answers a shared with a big bunch of people, too. :)
- Cheers [[kgh]] (talk) 23:50, 29 August 2012 (UTC)
MapEditor
Is it possible to publish the MapEditor functionality?
Which versions needed for this? :Maps examples/Google Maps shapes (points, circles, lines, rectangles and polygons) Lholivera (talk) 17:07, 9 October 2012 (UTC)
- This functionality was just added with the latest 2.0 release of 2012-10-05. Cheers [[kgh]] (talk) 21:09, 9 October 2012 (UTC)
Semantic Bundle
Could someone point me to the best place to ask for help w.r.t Semantic Bundle, and how to change LocalSettings.php ? I have tried
require_once( "$IP/extensions/semantic-bundle/SemanticBundleSettings.php" );
require_once( "$IP/extensions/semantic-bundle/SemanticBundle.php" );
as documentation says, but it doesnt work. Using the dir SemanticBundle doesnt work either. Are there different instructions for what to put in LocalSettings.php if you have downloaded from Git? I'm using Mediawiki 1.21 Open Research (talk) 18:17, 9 October 2012 (UTC)
- The best place to ask this is the Semantic Bunldle's talk page on mw.org. Cheers [[kgh]] (talk) 20:53, 9 October 2012 (UTC)
- Thank you! Open Research (talk) 23:22, 9 October 2012 (CEST)
Problem with export of latitude/longitude coordinates via CSV
Hello,
When exporting coordinates into CSV file, coordinates are strangely modified.
For example, 13° 48' 3" N, 89° 10' 42" W are exported as 13° 48' 3" N, 89° 10' 42" W.
Ideally, I'd like to export the coordinates as decimal format, as this is how they are put into the system. But definitely, the "Â" bit does not belong.
Running version 2.0 of Maps, and 1.8 beta of semantic mediawiki. Patelmm79 (talk) 17:59, 5 November 2012 (UTC)
- Heiya, this looks like a bug which should be reported at bugzilla. Cheers [[kgh]] (talk) 00:31, 6 November 2012 (UTC)
- Actually this is not a bug. See CSV output James Hong Kong (talk) 00:41, 6 November 2012 (UTC)
SMWSQLStore2 / 3 after upgrade to SMW 1.8
Hello,
After upgrading to SMW 1.8 (with Mediawiki 1.19.1), I have an issue with SMWSQLStore setup.
I ran both the database upgrade and then refresh ("Start Updating Data" from SMWAdmin page). I believe this should be sufficient to migrate from SMWSQLStore2 to SMWSQLStore3--"Start updating Data" took about 2 days, so I thought it was performing the migration.
However, once I remove the "$smwgDefaultStore = 'SMWSQLStore2';" from my localsettings.php, when I try to save any page, I get the following error:
Somebody tried to use spaces in a cache title! (Assigned to)
Backtrace:
#0 /.../extensions/SemanticMediaWiki/includes/storage/SQLStore/SMW_Sql3SmwIds.php(302): SMWSql3SmwIds->setCache('Assigned to', 102, '', '', 0, '')
#1 /.../extensions/SemanticMediaWiki/includes/storage/SQLStore/SMW_Sql3SmwIds.php(225): SMWSql3SmwIds->getDatabaseIdAndSort('Assigned to', 102, '', '', '', true, false)
#2 /.../extensions/SemanticMediaWiki/includes/storage/SQLStore/SMW_Sql3SmwIds.php(327): SMWSql3SmwIds->getSMWPageIDandSort('Assigned to', 102, '', '', '', true, false)
#3 /.../extensions/SemanticMediaWiki/includes/storage/SQLStore/SMW_SQLStore3_Readers.php(166): SMWSql3SmwIds->getSMWPageID('Assigned to', 102, '', '', true)
#4 /.../extensions/SemanticMediaWiki/includes/storage/SQLStore/SMW_SQLStore3.php(298): SMWSQLStore3Readers->getPropertyValues(Object(SMWDIWikiPage), Object(SMWDIProperty), NULL)
#5 /.../extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php(203): SMWSQLStore3->getPropertyValues(Object(SMWDIWikiPage), Object(SMWDIProperty))
#6 /.../extensions/SemanticMediaWiki/includes/storage/SMW_PrintRequest.php(155): SMWDIProperty->findPropertyTypeID()
#7 /.../extensions/SemanticMaps/includes/SM_GeoCoordsHooks.php(46): SMWPrintRequest->getTypeID()
#8 [internal function]: SMGeoCoordsHooks::addGeoCoordsDefaultFormat(false, Array, Array)
#9 /.../includes/Hooks.php(216): call_user_func_array('SMGeoCoordsHook...', Array)
#10 /.../includes/GlobalFunctions.php(3847): Hooks::run('SMWResultFormat', Array)
#11 /.../extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php(101): wfRunHooks('SMWResultFormat', Array)
#12 /.../extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php(48): SMWParamFormat->getDefaultFormat()
#13 /.../extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php(140): SMWParamFormat->getValidFormatName('auto')
#14 /.../extensions/Validator/includes/definitions/ParamDefinition.php(719): SMWParamFormat->formatValue('auto', Object(Param), Array, Array)
#15 /.../extensions/Validator/includes/Param.php(213): ParamDefinition->format(Object(Param), Array, Array)
#16 /.../extensions/Validator/includes/Validator.php(341): Param->format(Array, Array, Object(ValidatorOptions))
#17 /.../extensions/Validator/includes/Validator.php(281): Validator->doParamProcessing()
#18 /.../extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php(59): Validator->validateParameters()
#19 /.../extensions/SemanticTasks/SemanticTasks.classes.php(356): SMWQueryProcessor::getProcessedParams(Array, Array)
#20 /.../extensions/SemanticTasks/SemanticTasks.classes.php(135): SemanticTasksMailer::getQueryResults('[[Main Page]][[...', Array, false)
#21 /.../extensions/SemanticTasks/SemanticTasks.classes.php(31): SemanticTasksMailer::getAssignees('Assigned to', 'Main Page', Object(User))
#22 [internal function]: SemanticTasksMailer::findOldValues(Object(WikiPage), Object(User), ''''PLEASE NOTE ...', '', 0, NULL, NULL, 98, Object(Status))
#23 /.../includes/Hooks.php(216): call_user_func_array('SemanticTasksMa...', Array)
#24 /.../includes/GlobalFunctions.php(3847): Hooks::run('ArticleSave', Array)
#25 /.../includes/WikiPage.php(1263): wfRunHooks('ArticleSave', Array)
#26 [internal function]: WikiPage->doEdit(''''PLEASE NOTE ...', '', 98)
#27 /.../includes/Article.php(1783): call_user_func_array(Array, Array)
#28 /.../includes/EditPage.php(1435): Article->__call('doEdit', Array)
#29 /.../includes/EditPage.php(1435): Article->doEdit(''''PLEASE NOTE ...', '', 98)
#30 /.../includes/EditPage.php(960): EditPage->internalAttemptSave(Array, false)
#31 /.../includes/EditPage.php(357): EditPage->attemptSave()
#32 /.../includes/actions/EditAction.php(51): EditPage->edit()
#33 /.../includes/actions/EditAction.php(71): EditAction->show()
#34 /.../includes/Wiki.php(484): SubmitAction->show()
#35 /.../includes/Wiki.php(278): MediaWiki->performAction(Object(Article))
#36 /.../includes/Wiki.php(593): MediaWiki->performRequest()
#37 /.../includes/Wiki.php(503): MediaWiki->main()
#38 /.../index.php(58): MediaWiki->run()
#39 {main}Patelmm79 (talk) 20:46, 10 December 2012 (UTC)
- Hmm, such reports always look very aweful. They scare to me, too. I come to believe that the upgrading instuctions are incorrect, meaning that you trigger a SQLStore2 data refresh as long as SQLStore2 is set in LocalSettings.php. Thus I believe that you did a SQLStore2 data refresh and not a SQLStore3 data refresh. Please try to trigger a data refresh via SMWAdmin as long as SQLStore2 in not in LocalSettings.php. After the process stated you can switch back to SQLStore2 in LocalSettings.php and after the process finished remove the line again. If you are still getting this error notice, which I do not hope, a bug will have to be filed. Cheers [[kgh]] (talk) 00:23, 11 December 2012 (UTC)
- Somebody suspects ST as the cause of it and posted the same error log. I do not know if you use this exension. I this case were is no other way than stick to Store2 and wait until a fix was provided. Cheers [[kgh]] (talk) 19:23, 11 December 2012 (UTC)
- This looks like a simple SMW 1.8 bug. Had a quick look at the code but am not on my work box so can't easily fix. Please file a bug in bugzilla with the stacktrace and make sure me and markus are on cc. Jeroen De Dauw (talk) 20:57, 12 December 2012 (UTC)
If-then functionality with regard to Semantic Forms & Templates
I'm in the very, very, very early stages of putting together a wiki for my friends and I to create custom content for a roleplaying game we play, called Pathfinder. I'm trying to use semantic forms and templates to simplify the addition of new content to this site, and I've hit a brick wall. Here are the relevant pages:
The template I'm working on: [1] The form I'm working on: [2] An example of a page that uses this template: [3]
I've got the form where I want it for the most part, but I want to be able to include, disinclude, or reformat some aspects of the template based on answers people provide in the form when creating pages. For instance, descriptors are optional. When one or more descriptors are chosen for the spell in question, those descriptors should be enclosed in brackets with commas in between each descriptor. The commas are easy based on the arraymap function, but making optional brackets seems it would require some sort of if-then functionality (ie. IF at least one descriptor is chosen THEN surround the descriptors with brackets).
There are also certain fields (like saving throw and spell resistance) that I want to be hidden if the range of the spell is personal. And further, there are a number of boolean properties (harmless, object, dimissable, shapeable) which should be displayed in one particular way if the answer is "yes" (for instance, if dismissable is "yes" it should be displayed as "(D)") or not at all if the answer is "no." This all seems really, really easy to do with if-then functions, but I'm a novice when it comes to wiki syntax and especially to semantic mediawiki syntax, and I wondered how possible this all is.
Please help! And thanks in advance! Benn Roe (talk) 20:37, 11 December 2012 (UTC)
- Heiya Benn Roe, this talk page is the better place to ask this. Cheers [[kgh]] (talk) 01:54, 12 December 2012 (UTC)
My maps disappear with SMW 1.8 + SMWSQLStore3
Hello,
I have a number of semantic maps on the wiki, but when I enable SMWSQLStore3, they all disappear.
I had run a "Start Updating Data" when I upgraded to SMW1.8, so I don't know what the problem could be. Patelmm79 (talk) 16:30, 12 December 2012 (UTC)
- This does sound like a data refresh issue yes. Make sure you triggered the rebuild process and that it's done (you can run runJobs.php) Jeroen De Dauw (talk) 20:52, 12 December 2012 (UTC)
- Thanks Jeroen--I have run the update, some things I noticed:
- 1) My prior data refresh when Store2 was enabled, did not refresh the content for Store3. Only when STore3 was enabled, did the refresh work for Store3. 2) Running the update did not do a complete job--I still come across maps that show only half the content that they should Patelmm79 (talk) 16:40, 18 December 2012 (UTC)
Formatting a URL, Page or email property in template?
Hi, If I use a propert say [[mail_property::jj@home.com]] and "mail_property" is of type email then what is shown on the page is the link me@home.com with a letterbox next to it.
If I change now to [[mail_property::jj@home.com Joe Johnson]] Then I will see the link "Joe Johnson" with a letter box next to it.
Now In a template I have [[mail_property::{{{the email}}}]] and say "the email" is set to jj@home.com. Now If I do the following [[mail_property::{{{the email}}} Joe Johnson]] I will see a link "jj@home.com Joe Johnson".
The same is true for Page and URL.
The question how do we get so that "Joe Johnson" is showed in a Template just like in regular case. Choghok (talk) 19:16, 19 December 2012 (UTC)
- What about
[[mail_property::{{{the email}}}|Joe Johnson]]? [[kgh]] (talk) 01:25, 20 December 2012 (UTC)
help needed - with paid compensation
Hello, I am looking for help with a little semantic media wiki project, since I am a newbie in this area. Someone, who can answer my questions via email, if I am stuck with problems or the SMW manual - with paid compensation.
Thank you very much in advance. Aaula (talk) 21:00, 22 January 2013 (UTC)
- You can ask qustions here on the wiki, on the Semantic MediaWiki chatroom or on the Semantic MediaWiki mailing lists. There is also commericla support (listed on some page somewhere...) including http://www.wikiworks.com/ Jeroen De Dauw (talk) 22:10, 22 January 2013 (UTC)
Query on specific value of Geographical coordinate type property returns nothing
I'm running Semantic MediaWiki 1.8 on MediaWiki 1.20.2. On my wiki I have pages with the property "Has coordinates" of the type "Geographical coordinate". The values are saved through the use of a template, like this: [[Has coordinates::{{#coordinates:{{{koordinater}}}|format=dms}}]], using the Maps extension #coordinates parser to give a bit more flexibility when inputing coordinates, while keeping a uniform format on the page. With the Wiki being set up with Norwegian language, #coordinates produces a set of coordinates looking like "62° 41' 46" N, 10° 50' 4" Ø" on the page, which is accepted by the Geographical coordinate type.
When I try to map these pages with Semantic Maps with a query like {{#ask: [[Has coordinates::+]] | ?Has coordinates | format=map}} (or with regular Maps, for that matter) it works perfect. Queries like {{#ask: [[Has coordinates::+]] | ?Has coordinates | ?Name}} also work perfectly. But if I replace the + with the actual value of one of the pages' "Has coordinates" property, like {{#ask: [[Has coordinates::62° 41' 46" N, 10° 50' 4" Ø]] | ?Has coordinates | ?Name}}, the query returns with nothing, even if I copy and paste the value from the query above, and even if I copy and paste the coordinates in the format they were input to the template in the first place.
I'm new to MediaWiki and, of course, all its extensions, so any help would be greatly appreciated. :)
EDIT: I just noticed that if I try to make the above mentioned query without the name-part, as in {{#ask: [[Has coordinates::62° 41' 46" N, 10° 50' 4" Ø]] | ?Has coordinates}} the wiki throws the following error on preview and save: "Fatal exception of type MWException" Kvolden (talk) 15:00, 9 February 2013 (UTC)
[[Has coordinates::{{#coordinates:{{{koordinater}}}|format=dms}}]
Ahh, don't do that... The property annottaions already accepts all the formats, no need to reformat first. And if you do want to reformat, then I suggest keeping display and setting of the property seperate (ie setting it using set). Also keep in mind you can set the default display format of coordinates in annotations, so perhaps you don't need any wikitext for it at all.
the query returns with nothing
Hmm, it should...
"Fatal exception of type MWException"
Need more info, for instance a stack trace. Jeroen De Dauw (talk) 19:01, 9 February 2013 (UTC)
Ahh, don't do that... The property annottaions already accepts all the formats, no need to reformat first.
Just changed it to take the coordinates without reformatting, and they were displayed the same, so I guess I just assumed it wouldn't without even testing first. :) Didn't affect the query problem though.
Need more info, for instance a stack trace.
Here is the complete stack trace:
There is no result format for 'map'.
Backtrace:
#0 /customers/a/0/d/somecustomer/httpd.www/extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php(143): SMWQueryProcessor::getResultPrinter('map')
#1 /customers/a/0/d/somecustomer/httpd.www/extensions/Validator/includes/definitions/ParamDefinition.php(719): SMWParamFormat->formatValue('auto', Object(Param), Array, Array)
#2 /customers/a/0/d/somecustomer/httpd.www/extensions/Validator/includes/Param.php(213): ParamDefinition->format(Object(Param), Array, Array)
#3 /customers/a/0/d/somecustomer/httpd.www/extensions/Validator/includes/Validator.php(341): Param->format(Array, Array, Object(ValidatorOptions))
#4 /customers/a/0/d/somecustomer/httpd.www/extensions/Validator/includes/Validator.php(281): Validator->doParamProcessing()
#5 /customers/a/0/d/somecustomer/httpd.www/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php(59): Validator->validateParameters()
#6 /customers/a/0/d/somecustomer/httpd.www/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php(424): SMWQueryProcessor::getProcessedParams(Array, Array)
#7 /customers/a/0/d/somecustomer/httpd.www/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Ask.php(38): SMWQueryProcessor::getQueryAndParamsFromFunctionParams(Array, 2, 1, false)
#8 [internal function]: SMWAsk::render(Object(Parser), '[[Has coordinat...', '?Has coordinate...')
#9 /customers/a/0/d/somecustomer/httpd.www/includes/parser/Parser.php(3250): call_user_func_array(Array, Array)
#10 /customers/a/0/d/somecustomer/httpd.www/includes/parser/Preprocessor_DOM.php(1083): Parser->braceSubstitution(Array, Object(PPFrame_DOM))
#11 /customers/a/0/d/somecustomer/httpd.www/includes/parser/Parser.php(3038): PPFrame_DOM->expand(Object(PPNode_DOM), 0)
#12 /customers/a/0/d/somecustomer/httpd.www/includes/parser/Parser.php(1136): Parser->replaceVariables('{{Koieboks?|nav...')
#13 /customers/a/0/d/somecustomer/httpd.www/includes/parser/Parser.php(370): Parser->internalParse('{{Koieboks?|nav...')
#14 /customers/a/0/d/somecustomer/httpd.www/includes/EditPage.php(2664): Parser->parse('{{Koieboks?|nav...', Object(Title), Object(ParserOptions))
#15 /customers/a/0/d/somecustomer/httpd.www/includes/EditPage.php(1738): EditPage->getPreviewText()
#16 /customers/a/0/d/somecustomer/httpd.www/includes/EditPage.php(401): EditPage->showEditForm()
#17 /customers/a/0/d/somecustomer/httpd.www/includes/actions/EditAction.php(51): EditPage->edit()
#18 /customers/a/0/d/somecustomer/httpd.www/includes/actions/EditAction.php(71): EditAction->show()
#19 /customers/a/0/d/somecustomer/httpd.www/includes/Wiki.php(427): SubmitAction->show()
#20 /customers/a/0/d/somecustomer/httpd.www/includes/Wiki.php(304): MediaWiki->performAction(Object(Article))
#21 /customers/a/0/d/somecustomer/httpd.www/includes/Wiki.php(536): MediaWiki->performRequest()
#22 /customers/a/0/d/somecustomer/httpd.www/includes/Wiki.php(446): MediaWiki->main()
#23 /customers/a/0/d/somecustomer/httpd.www/index.php(59): MediaWiki->run()
#24 {main}- Through the debugging feature, I've found the following:
- I have a page where the coordinates were entered as "62.63664, 11.00655" and saved to the "Has coordinate" property. This makes the coordinates show on the page as "62° 38' 12" N, 11° 0' 24" Ø", and if I edit the page and show a preview, I can hover over the coordinates which appear in the list of properties on the bottom of the screen, and a small box says "Latitude: 62.63664 Longitude 11.00655" (in Norwegian). This is in perfect accordance with the values saved in the database table "wsmw_di_coords", containing the exact same values in the fields "o_lat" and "o_lon", as well as "o_serialized" containing the value "62.63664, 11.00655".
- However! When I add the query
{{#ask: [[Has coordinates::62° 38' 12" N, 11° 0' 24" Ø]] | ?Has coordinates | ?Name }}in a page, the debugging feature shows that the database call is:SELECT /* SMW::getQueryResult 194.19.124.36 */ DISTINCT t2.smw_id AS id,t2.smw_title AS t,t2.smw_namespace AS ns,t2.smw_iw AS iw,t2.smw_subobject AS so,t2.smw_sortkey AS sortkey FROM `wsmw_object_ids` AS t2 INNER JOIN `wsmw_di_coords` AS t0 ON t2.smw_id=t0.s_id WHERE ((t0.o_serialized = '62.636666666667' && t0.o_lat = '11.006666666667') AND t0.p_id='65') ORDER BY t2.smw_sortkey ASC LIMIT 51. - As you can see, there are seemingly two things that are off here. First of all, it seems to look up the latitude in the field "o_serialized" and the longitude in the "o_lat" field. Second, the values themselves are off, probably because of some precision problem when converting to and from float format and DMS.
- The second part I'm hopeful I can work around somehow (I'm trying to display a list of pages with it's coordinates set within a defined distance from the current page, explained in the documentation, so as long as I can exclude the current page from showing in the list, it's fine). But the first is a real problem, because even when I change the query to
[[Has coordinates:62.63664, 11.00655]]it looks up the right coordinates, but in the wrong fields in the table, and gets an empty result. - How all of this relates to the crash occuring when dropping the "|?Name" part, I don't know yet. Kvolden (talk) 09:32, 11 February 2013 (UTC)
First of all, it seems to look up the latitude in the field "o_serialized" and the longitude in the "o_lat" field.
Interesting. I tried repdoucing this but ran into another issue... Anyway, I created Task T46933 to keep track of the issue.
the values themselves are off, probably because of some precision problem when converting to and from float format and DMS.
Not a lot SMW can do about this. More the respnsibility of the Maps and Semantic Maps extensions. SMW 1.9 will be using Maps 3.0.x, which has a rewritten coordinate parser, in which some bugs are fixed compared to the one in Maps 2.0.x. Perhaps that will fix your problem.
If you just want to select on one exact value and always enter it in the exact same format (inc same spaces and stuff), you could ofc just store it using an extra string property. To ensure the format is the same you could use the #coordinates function in the way I recommended against. A rather big hack, but might work fine for you.
How all of this relates to the crash occuring when dropping the "|?Name" part, I don't know yet.
Both these issues do not relate to the one for which you provided a stack trace. Jeroen De Dauw (talk) 07:23, 13 February 2013 (UTC)
Not a lot SMW can do about this.
No, I figured. Not a big issue, though. I just need a slightly different approach to what I want to do, and it isn't really much of a problem.
Both these issues do not relate to the one for which you provided a stack trace.
Are you sure about that? That's strange. Too strange almost, as the stack trace is from the error occurring when I omit "|?Name" from the query. I get the error message "Fatal exception of type MWException" when stack tracing is turned off, and the stack trace posted above when stack tracing is turned on. When I leave "|?Name" in the query, I get no error message, but it looks up the coordinates in the wrong fields. Kvolden (talk) 08:09, 14 February 2013 (UTC)
- The bug the stack trace is pointing out might be affecting the other two (yeah, we thus have 3), though it certainly is distinct from those two. Jeroen De Dauw (talk) 12:22, 16 February 2013 (UTC)
- What version of SMW and SM are you using? I've seen thius error before and think I fixed it already. Jeroen De Dauw (talk) 06:53, 13 February 2013 (UTC)
- SMW version 1.8, SM version 2.0.1.2.
- I just realized something. When I try to run the query without "|?Name" it for some reason defaults to format=map. But there seems to be no defined format called "map", hence the error message on top of the backtrace: "There is no result format for 'map'." When I omit "|?Name" but include "format=broadtable" no error is returned, but it still looks up the coordinates in the wrong fields.
- So there seems to be two bugs here:
- 1. A query for specific values of the coordinates property looks up the latitude and longitude in the wrong fields (o_serialized and o_lat, respectively, instead of the correct o_lat and o_lon).
- 2. When doing a query for specific coordinate values (EDIT: or just any page with coordinates set (i.e. [[Has coordinates::+]])) and only showing the coordinate values in the result, it defaults to the result format "map" which isn't defined. (EDIT: And a "Fatal exception..." error is produced.) Kvolden (talk) 08:57, 14 February 2013 (UTC)
I just realized something. When I try to run the query without "|?Name" it for some reason defaults to format=map
If you just have coordinates in the result set, it will default to map yes. Name is not a coordinate, thus it defaults to table or whatever. Just set the format explicitly (though not map).
The other issue, which is not fixed yet on the latest dev version, has Task T46933. Jeroen De Dauw (talk) 12:26, 16 February 2013 (UTC)
If you just have coordinates in the result set, it will default to map yes.
Yes, I understand. That is not the issue. What I meant by the horribly phrased second point, was the following. When SMW, because of bug 44933, looks up the values in the wrong fields, it will naturally return a null result, as no entry matches the search strings. Here are a few examples of queries and their expected results, versus their actual results:
{{#ask: [[Has coordinates::62° 38' 12" N, 11° 0' 24" Ø]] | ?Has coordinates | format=broadtable }}
Expected result: An empty or "nonexistent broadtable". Actual result: A nonexistent broadtable.
{{#ask: [[Has coordinates::62° 38' 12" N, 11° 0' 24" Ø]] | ?Has coordinates | format=count }}
Expected result: The number zero. Actual result: The number zero.
{{#ask: [[Has coordinates::62° 38' 12" N, 11° 0' 24" Ø]] | ?Has coordinates | format=csv }}
Expected result: A link to a csv file empty of results: Actual result: A link to a csv file empty of results.
{{#ask: [[Has coordinates::62° 38' 12" N, 11° 0' 24" Ø]] | ?Has coordinates | format=map }}
Expected result: An empty or "nonexistent map". Actual result: A nonexistent map.
{{#ask: [[Has coordinates::62° 38' 12" N, 11° 0' 24" Ø]] | ?Has coordinates }}
Expected result: An empty or "nonexistent map", because it defaults to the map format. Actual result: A fatal exception error with the following as the top of the stacktrace:
There is no result format for 'map'.
Backtrace:
#0 /customers/a/0/d/somecustomer/httpd.www/extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php(143): SMWQueryProcessor::getResultPrinter('map')
This seems to be a problem separate from bug 44933. Kvolden (talk) 09:01, 18 February 2013 (UTC)
Help extending api with a specific json format
Hi, I am trying to develop an extension. I need to extend semantic mediawiki api with a specific json format. With this code:
$prueba["BB"]["CC"]="DD"; $this->getResult()->addValue("AA",null,$prueba);
I get this result: {"AA":[{"BB":{"CC":"DD"}}]} but I want to get this other: {"AA":[{"BB":[{"CC":"DD"}]]} Is it possible?
Thanks in advance. Jorge (talk) 18:23, 10 March 2013 (UTC)
- Sorry, I'd like to get the json result: {"AA":[{"BB":[{"CC":"DD"}]}]}. Jorge (talk) 18:37, 10 March 2013 (UTC)
Setting Properties in Templates
Is it possible to set properties in templates in any useful manner? I've done it, and they show up in the "factbox" at the bottom of the page, but they do not show up when I browse properties. I also cannot seem to access them via #ask queries. James Montalvo (talk) 20:57, 22 March 2013 (UTC)
- Do you mean that you set properties of the templates not the pages that include them? If so, try setting $smwgNamespacesWithSemanticLinks [NS_TEMPLATE] = true; Alexander Mashintalk 07:16, 23 March 2013 (UTC)
Yes, I want to be able to set the synopsis and template group for each template, so it's easier to keep track of all the templates we use. The number of templates is getting a little out of hand so I think this will help. Will setting [NS_TEMPLATE] = true; affect the normal usage of setting properties using templates? Basically, as long as any properties intended to be transcluded are wrapped in INCLUDEONLY tags they're not going to be set to the template, right? See example below.
<noinclude> [[Where set::On template only]] </noinclude> <includeonly> [[Where set::On pages including template only]] </includeonly> [[Where set::On template and on pages including template]]
James Montalvo (talk) 14:14, 23 March 2013 (UTC)
- Yes, I suppose, as long as you wrap the properties meant for the page that include templates in
<includeonly>they will be set for those pages only, the same way as categories. Your example seems to be correct. I think you should try it now. Alexander Mashintalk 14:28, 23 March 2013 (UTC)
- Yes, I suppose, as long as you wrap the properties meant for the page that include templates in
Sidebar Toolbox issue
I noticed that on this website the Toolbox menu in the sidebar is empty after Log in. You see it being built but then it disappears and it only shows Toolbox. When logged out the Toolbox menu is ok. I know for sure this was working a while back. Is there a problem with the side or am I missing something here? Using Firefox 19.0.2 Beste regards. Jongfeli (talk) 10:50, 25 March 2013 (UTC)
- Cannot reproduce this. Try clearing the cache. Alexander Mashintalk 07:41, 30 March 2013 (UTC)
- I found the problem. It seems that something is not working like it should in the Vector skin. On a computer and tablet, on which I never visited this site, using Opera & Firefox the toolbox menu also disappears after the page is loaded. When I change to the Vectorata skin the toolbox menu stays visible. I can't remember if I changed to the Vector skin manually in the past or that the default skin changed. Using the Vectorata skin now. Regards. Jongfeli (talk) 05:34, 2 April 2013 (UTC)
RE: Ontoprise Bankruptcy - Did anyone preserver their extension documentation?
I have been looking for the Ontoprise documentation for the collaboration extension. Does anyone have a copy of this information? DouglasMcDowell (talk) 05:14, 29 March 2013 (UTC)
- I cannot tell. I think asking via the mailing list will trigger more responses, at least it increases the chances. [[kgh]] (talk) 16:09, 1 April 2013 (UTC)
Postgres support - bugfixing
I've just set up mediawiki and smw - using the git bleeding edge versions. I'm using postgres as the database backend. I encountered multiple problems while attempting to run the SMW_setup.php script ... but eventually, I found some obvious bugs and eventually I managed to get it running. How do I submit patches? Tobixen (talk) 21:39, 11 April 2013 (UTC)
- The best way to do this is to file the patch at MediaWiki's bugtracking system GitHub. Thank you for working on this! Cheers [[kgh]] (talk) 10:44, 20 April 2013 (UTC)
Wrapping a compound query around a loop.
I'm trying to combine a compound query (from the compound query extension) with a loop (from the ParserFunctions Loop extension) without much luck.
This occurs in a template:
{{#compound_query: {{#forargs: | key | value | <nowiki/> [[Category:Genre]] [[{{#var: value}}]];?has_introduction| }} format=table }}
Basically, I want this to generate a compound query, including each of the items passed in from the template. The template is called with the following:
{{Influenced|Trap|Post Dubstep}}
Once the loops have been expanded, it should look something like this:
{{#compound_query: [[Category:Genre]] [[Trap]];?has_introduction| [[Category:Genre]] [[Post Dubstep]];?has_introduction| format=table }}
Which works perfectly, just not within the loop function.
I'm using the loop elsewhere without problems.
Anything obvious I'm missing?? Rodeoclash (talk) 11:46, 18 April 2013 (UTC)
- I should mention that I've tried the usual suspects of escaping a loop. The compound queries work fine too, unless I combine it with a loop. Rodeoclash (talk) 12:11, 18 April 2013 (UTC)
- It do not think that this is possible. However I may be wrong. The better place to seek help in this case appears to be the Semantic Compound Queries extension help page or the Semantic MediaWiki mailing lists. Cheers [[kgh]] (talk) 10:48, 20 April 2013 (UTC)
Default value for property?
Hello, is there any way to set a default value for a property? Patelmm79 (talk) 14:41, 25 April 2013 (UTC)
- In a semantic template:
[[Property::{{{parametre|default}}}]]. Alexander Mashintalk 17:15, 25 April 2013 (UTC)- Oh, that's beautiful, thank you! Is that documented somewhere where people can easily find it? Very useful! Patelmm79 (talk) 17:57, 25 April 2013 (UTC)
- Semantic templates,
- meta:Template. Alexander Mashintalk 04:46, 26 April 2013 (UTC)
- Oh, that's beautiful, thank you! Is that documented somewhere where people can easily find it? Very useful! Patelmm79 (talk) 17:57, 25 April 2013 (UTC)
SMW 1.8.0 Subobject incompatiblity with RDF store
I posted this on the 1.8.0 forum but maybe it will get more traffic here:
Just wondering if the development group is aware of a subobject bug when using RDF as the SMW store. This issue has been reported elsewhere (http://wikimedia.7.x6.nabble.com/RDF-export-of-subobjects-SIO-in-SMW-1-8-broken-td5001638.html). We setup our SMW installation with SQLStore3 with heavy usage of subobjects. All queries work fine with this setup. To gain improved speed, we migrated the SMW data to 4store and although queries of routine properties and categories work, subobject queries are broken as if they do not exist in the system. Any help with this would be appreciated or if it is already being addressed in version 1.9.0, then please let me know.
Thanks, Lloonngg (talk) 19:28, 1 May 2013 (UTC)
- From reading through the thread you linked I can see that a bug 48708 was opened on bugzilla to adress this issue. Bugzilla is probably the best choice when you are sure that a bug is there. [[kgh]] (talk) 18:44, 6 June 2013 (UTC)
Bounties: selecting pages not in category, and option for turning off category inferencing
Does anyone have the skills to add "not in category" clauses for selecting pages in ask queries, and/or the ability to turn off category inferencing in particular ask queries?
Selecting pages not in a category seems to be something that's been requested many times before.
I'd be happy to offer $100 bounties for each these features (up to $200 total) if they're available in the next month. (And of course it'd be a great service to the SMW community.)
Thanks! Adam Adamsmith (talk) 23:55, 16 May 2013 (UTC)
- Hi,
- I am interested in this but I am not able to distinguish both of the tasks. Can you give an example query for this? Nischay Nahata (talk) 13:30, 17 May 2013 (UTC)
- Sure! These are two separate things...
- 1) Not in category clauses: I want to be able to do something like [[!Category::Actor]] to select pages that aren't in category Actor. This should work with other parts of a clause, like [[Category::Hollywood]][[!Category::Actor]] would return pages in category Hollywood but not Actor.
- I'm not sure what the best way to implement this is. I'd hope this would get accepted to the SMW codebase so I'd very much welcome feedback on what the best way to accomplish this filtering is. Maybe it's adding a NOT clause, so you could do [[Category::Hollywood]] NOT [[Category::Actor]] but the NOT clause would also add a lot of power to do other things, which would be nice for everyone in general.
- 2) Optionally turning off category inferencing: I'm referring to inferencing as described here. I think there should be a flag so you could do {{#ask: [[Category::Person]] | inferencing=false }} to get a list of pages only in category Person (and not pages in [[Category::Man]] or [[Category::Woman]] unless those pages are also explicitly in [[Category::Person]]). This use case doesn't make a lot of sense for Person/Man/Woman but could for other use cases. Obviously `inferencing` would be default =true since that's the existing/default bahavior.
- Thanks! : )
- Adam Adamsmith (talk) 20:37, 17 May 2013 (UTC)
- The first request is complex, complex as in it needs changes in a lot of places in the core query execution. The second one is relatively simple. I will write to Markus and let you know Nischay Nahata (talk) 15:16, 19 May 2013 (UTC)
Recursively defining properties on SMW
I'm using SMW to create a course made out of several pages and would like to add something along the lines of a progress counter. Each wiki page has a property indicating which course it belongs to and a property indicating the preceding page.
With this idea, I thought it might actually be possible to recursively define the page number of each particular page belonging to a particular course. This is probably the fastest way to define page numbers without having to manually write in the page number for each page. The latter would definitely bring about a lot of work if I were to insert a page in say, between the first and second page.
However, the question is then, how do I implement this with SMW?
I was guessing I could define a page number variable which will then be SET in the template itself.
{{#if: {{{PreviousPage|}}} | {{ #set: PageNumber={{#expr ( {{#ask: <call page number of preceding page?> }} + 1) | {{#set: PageNumber=1}} }}
Would the set function actually work in this case (assuming this recursive method even works)? Or is there a more elegant method to accomplish the said task? Mercurial (talk) 14:17, 20 May 2013 (UTC)
- Have you tried asking via the mailing list? The chances are higher over there that you will get a response. [[kgh]] (talk) 18:19, 6 June 2013 (UTC)
{{#if: {{{PreviousPage|}}} | {{ #set: PageNumber={{#expr: {{#show: {{{PreviousPage}}} | ?PageNumber }} + 1 }} | {{#set: PageNumber=1}} }}. This should work, I think, although not immediately. You may need to touch all pages in correct order starting from the first to set page numbers.- There may be a healthier way of ordering pages. Do not set
{{{PreviousPage}}}in your template. Instead, set some number denoting page position, not necessarily incrementing by one:{{#set:Ordering = {{{Order|1}}} }}. Thence you can get the page number:{{#expr: {{#ask:[[Ordering::<{{{Order|1}}}]] [[Course::{{{Course}}}]] | format = count}} + 1}}and previous page:{{#ask: [[Ordering::{{#ask:[[Ordering::<{{{Order|1}}}]] [[Course::{{{Course}}}]] | ?Ordering | mainlabel = - | format = max}}]] | ? }}. Alexander Mashintalk 02:44, 7 June 2013 (UTC)
Create Class background scheduling
After submitting a class creation using Special:CreateClass, it seems that the creation of the properties, category, template, etc., only proceed when there is some activity such as a page access. Is there a way to configure this so that the background processing can run asynchronously? Mobilistix (talk) 03:57, 6 June 2013 (UTC)
- You can execute MediaWiki's runJobs.php directly if you want to speed up the creation of the pages. Afaik there is no way to avoid that Semantic Forms passes such creation jobs through the job queue. [[kgh]] (talk) 18:13, 6 June 2013 (UTC)
Internal Date type
The form fields for properties of type date have MM/DD/YYYY but not HH:MM:SS.
Is there any way to configure the underlying Date type (e.g., perhaps via $smwgPDefaultType) or add a DateTime type so that a complete timestamp could be stored or held has a property value? Mobilistix (talk) 04:01, 6 June 2013 (UTC)
- I guess you are interested in the input type "datetime". The complete documentation of Semantic Forms including a talk page for related issues is at MediaWiki.org. [[kgh]] (talk) 18:16, 6 June 2013 (UTC)
Changelog?
Hello everyone,
why is there apparently nowhere in this wiki a changelog? I am trying to figure out what exactly has been done for 1.8.0.5, are there only cosmetic changes, is there a security update - and there seems to be pretty much no way to see this without digging into the source. Mediawiki does it pretty good (see the news section on mediawiki.org), and I would love to see the same here.
Thanks a lot :) Fh (talk) 08:56, 9 June 2013 (UTC)
git diff 1.8.0.4 1.8.0.5,git log 1.8.0.4 1.8.0.5orgit diff 1.8.0.4 1.8.0.5 --statshould allow to generate the information you need without having someone trying to follow the change process manually. See also [1].- [1] http://learn.github.com/p/diff.html James Hong Kong (talk) 09:37, 9 June 2013 (UTC)
- >>MediaWiki does it pretty good ... I would love to see the same here.
- SMW is a volunteer project, people participate on their own free time. Having this website available as a "wiki" means that everyone is encouraged to share and participate in order to improve its content. James Hong Kong (talk) 09:46, 9 June 2013 (UTC)
- Changelog James Hong Kong (talk) 09:58, 9 June 2013 (UTC)
- See RELEASE-NOTES-1.8.0.5 in your SMW 1.8.0.5 install. Jeroen De Dauw (talk) 17:40, 15 July 2013 (UTC)
The type of this property is invalid
Hi, SMW works awesome for me so far. But I got a little trouble. I wanted to assign some coordinates to a location. Thus I gave the property "Has coordinates" the type "Geographic Coordinates". But when I use this property and type onto a page i.e. 32° 42' 54.00" S, 77° 1' 55.24" W there is a little exlamation mark symbol. When I hover over the symbol it says: "Error - The type of this property is invalid". What am I doing wrong here?
Thanks for your help! Arndt (talk) 12:23, 26 June 2013 (UTC)
- Did you install the Extension "Maps" and Extension "Maps" extension? [[kgh]] (talk) 22:11, 26 June 2013 (UTC)
- Hey, I have installed the Bundle, so I thought Maps and Semantic Maps are coming along with it. After I installed the Maps and Semantic Maps by themselves everything is fine now. I presume I did something wrong during the installation by ignoring dependencies...
- Your help is appreciated. Arndt (talk) 13:09, 2 July 2013 (UTC)
Automatically filling form fields based on users's input
Hi,
I'm creating a knowledge base using SMW and have a question about the best way to implement a feature the users are requesting.
The users are doing literature reviews of PubMed papers and would like to automatically populate several fields of a SMW form I created for them to enter their findings. The idea is that whenever they enter a PubMed ID into the form's PMID field, the form then queries the PubMed Entrez database for the paper's abstract, author's list, etc and pre-fills the appropriate fields in the form. They can then edit any of the fields and save it into SMW.
We have a hack that is sorta working now where they enter their findings into a separate webpage form that we created and once it's filled out we insert it into SMW using Snoopy. Is there some way that would be more elegant?
Thanks in advance Jrhall60 (talk) 16:48, 12 July 2013 (UTC)
How to design a Semantic Wiki to best understand the concept of Time
My example would be something like the Land Area of Serbia over time. It gets confusing when you add in the concept of Successor States etc but I'm trying to test my understanding of the Semantic Concept through various challenging scenarios.
What would be the ideal way to design the ontology so that I can do a query on different dates for the total Land Area say in 1990, 2005, 2010, 2013.
The last time I used Semantic Wiki was a few years ago but I ended up making the Wiki too confusing and unable to adapt to changes in time without losing previous information. Ie in 2008 Kosovo declared independence so pre 2008 the query should respond with the land area of Serbia+Kosovo but post 2008 it should respond with just the land area of Serbia.
To make it even more complicated, how do you then take in the concept of sovereignity recognition? For example the above scenario is valid for a person from the UK (me) as the UK has full diplomatic recognition of Kosovo, but Spain for example does not. So if I ran the query above but from the viewpoint of Spain then post 2008 it would respond with the land area of Serbia+Kosovo.
Best Regards,
Adam Byb3 (talk) 21:55, 24 July 2013 (UTC)
- I have pondered on similar subject in the course of designing Summary II. Storing historical data can be done with subobjects. They can be organised to store pages' properties together with context: time when valid, viewpoint etc.
- Another theoretically possible but impractical solution is completely rewriting Semantic MediaWiki to allow, in addition to existing statements of the page.property = value form, something like page.property ≈ value, page.property (was equal in 1913) value, page.property (some people say equals) value, etc. Alexander Mashintalk 04:43, 25 July 2013 (UTC)
- What you're talking about at the end is, essentially, three-dimensional data: land area for country, for year, for viewpoint. SMW can only handle up to two-dimensional data per page, using the #subobject function. (Or you could use the Semantic Internal Objects extension, which does the same thing but with different syntax.) You could still store three-dimensional data, but you would need to use different pages for it: instead of just a page called "Kosovo", you would need pages like "Kosovo/2008" or "Kosovo/for Spain", or even "Kosovo/2008/for Spain". However, for your case you would presumably want the system to find the nearest year and that sort of thing, not just an exact year match; and I don't think there's any way to do that. So if you really wanted to get this working, you would have to create a page or subobject for every year and maybe even every viewpoint, even though it would involved a tremendous amount of redundancy. Yaron Koren (talk) 12:43, 25 July 2013 (UTC)
- What you're talking about at the end is, essentially, three-dimensional data: land area for country, for year, for viewpoint.
- Not really. I mean that the metaproperties for context (time and viewpoint) should be included in the same subobject as the properties. This allows any number of dimensions.
- you would presumably want the system to find the nearest year
- I can record intervals:
'''Kosovo''' ... {{#subobject:__since = 2008|__until = 2015|__who thinks so = Spain|legal status = Independent state}}. Alexander Mashintalk 13:48, 25 July 2013 (UTC) - Ah, yes, that's true. It would be somewhat awkward, but doable. Yaron Koren (talk) 17:05, 25 July 2013 (UTC)
Automatic refresh of #ask and #expr Informations / tables
Hi, i hope you understand me Problem.
Data way
Points create
I create Eventpoints
over
- subobject:
|Has object type=Event team
|Has event=semantic-mediawiki.org:Community portal
|Has team=
.....
|Has eventpt=Expression error: Unexpected > operator.
....
Result: http://kubbwiki.de/index.php/EM_2013#tab=Teams_und_Rangfolge
Rankingpoints (year) The Eventpoints of all tournaments i added to Year Ranking Points
<ul><li>Property "Has object type" (as page type) with input value "Team_rang...." contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.</li> <!--br--><li>Property "Has p2013" (as page type) with input value "0...." contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.</li></ul>
Result: http://kubbwiki.de/index.php/KubbKolonne
Champions Table
All Infos i like for this Tables
Keine Daten
http://kubbwiki.de/index.php/Kategorie:Kubbwiki_Champions
Problem
How can I update my information automatically, once a day or when someone calls one of the three sides?
Now Only if I edit all 3 sides per hand, above the data is updated
Thanks you for Help or Ideas!
cu Bastor Bastor (talk) 16:59, 25 July 2013 (UTC)
[Closed] Stumped by some weird problem.
Hi.
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: http://ringofbrodgar.com/
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: http://ringofbrodgar.com/wiki/Special:Version
Main template used on most, and related problem pages.
General rundown:
There is this page http://ringofbrodgar.com/wiki/Running_Rabbit_Sausage . 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 http://ringofbrodgar.com/wiki/Fox_Meat 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)
- Page where we talked about this problem: http://ringofbrodgar.com/wiki/Talk:Fox_Meat
Anyone might have some additional ideas what up here?
MvGulik.
Also asked at www.mediawiki.org: [4] MvGulik (talk) 06:55, 26 August 2013 (UTC)
- 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) 16:17, 29 August 2013 (UTC)
- See Help:Getting_support. ☠Mark Hershberger☢(talk)☣ 18:43, 29 August 2013 (UTC)
- 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) 22:56, 29 August 2013 (UTC)
- 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). Alexander Mashintalk 14:57, 30 August 2013 (UTC) - 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) 16:11, 30 August 2013 (UTC)
- Perhaps, you could try to rebuild SMW data for the page Running Rabbit Sausage (backup) (by id). Alexander Mashintalk 16:33, 30 August 2013 (UTC)
- 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) 19:01, 30 August 2013 (UTC)
- Perhaps, you could try to rebuild SMW data for the page Running Rabbit Sausage (backup) (by id). Alexander Mashintalk 16:33, 30 August 2013 (UTC)
- 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) 11:51, 31 August 2013 (UTC)
Please help: No page properties in custom namespace
Hi!
I'm running Semantic Mediawiki version 1.8 (in a version 1.20.2 Mediawiki). Extensions installed: Semantic Drilldown (1.2.5), Semantic Forms (2.5.1), Semantic Forms Input (0.7), Semantic Internal Objects (0.7.1).
My goal is generating a training overview in a custom namespace 'Training' by querying pages with category 'Training' (which are all in this namespace). However, the pages which are within the namespace don't show up as results, whereas pages with the same content but outside the namespace (i.e. without a namespace, in (Main)) do show up. Looking at the properties of both pages show that properties for the page in the Training-namespace are not applied.
The overview lives in the same namespace under index.php?title=Training:Start with the following query:
{{#ask: [[Category:Training]] |?day }}
I have two pages in the Training category, one inside and one outside the namespace. Only the one outside the namespace is shown as a result to the query above. Content for both is the same:
[[Day::Weekday]] [[Category:Training]]
When I open the 'Browse properties' on both pages I get the following: http://screencast.com/t/WMUxc0vK
Is it an SMW configuration setting? I tried several options from http://semantic-mediawiki.org/wiki/Help:Configuration like:
- $wgNamespacesToBeSearchedDefault
- $smwgNamespaceIndex
- $smwgNamespacesWithSemanticLinks
- $smwgQDefaultNamespaces
but none seem to work. Does anyone have a clue what could be the problem?
Thanks much!
I also asked this question at stackoverflow Ontzettend (talk) 18:46, 30 August 2013 (UTC)
- Well, in the meantime you got an answer over there. However, asking via the mailing list is a much faster way to get an answer, even faster than posting here. I am a bit surprised that this does not work for you since this thread really covers everything that may go wrong here. [[kgh]] (talk) 16:04, 11 September 2013 (UTC)
enableSemantics("localhost"); breaks my code. cant setup semanticwiki. please help
Hello everyone:
I'm stuck and can't advance at all. When i execute the fourth line, my code breaks
require_once( "$IP/extensions/Validator/Validator.php" );
require_once( "$IP/extensions/DataValues/DataValues.php" );
include_once( "$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php" ); <---------- no metter what string i put as argument, the program executes??!!??
enableSemantics("localhost"); <------------ breaks my code no metter what string I put there (that i can think of)
Please help me set up my semantic wiki. Thanks you for your time and kind concern. Jenia (talk) 16:11, 8 September 2013 (UTC)
- actually its the third line that breaks my code: include_once( "$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php" );
- if i change it to require_once, the server immediately gives me 500 error. Jenia (talk) 20:00, 8 September 2013 (UTC)
- What version of the software are you using? 1.9 alpha? If so, you can omit the "enableSemantics" part. And you can omit the first two lines as well, as those libraries will be loaded automatically. You now have the loading in the wrong order, which should not cause any issues, though might - so removing it altogether is definitely good. Jeroen De Dauw (talk) 22:16, 18 September 2013 (UTC)
Template and link=none
I have a small problem with
<ul><li>"Has p{{{KWJahr}}}" contains a listed "{" character as part of the property label and has therefore been classified as invalid.</li> <!--br--><li>The part ">>1" of the query was not understood.Results might not be as expected.</li> <!--br--><li>The part "]]" of the query was not understood.Results might not be as expected.</li> <!--br--><li>The part "....." of the query was not understood.Results might not be as expected.</li></ul>
my output is ( http://kubbwiki.de/index.php/Kategorie:Kubbwiki_Champions )
Teamname Nation Points
1. Gipfelstürmer#_rang Flagpicture 60 Points 2. RZKKC#_rang Flagpicture 51 Points 3. Oepfelbaum#_rang Flagpicture 50 Points ....
Question: How i can cut #_rang ? I need only the Frontname like Gipfelstürmer , RZKKC.
I can't change |link=none Option , because I create the flagname, portalname with the data.
Although I change this command, then correct the first Teamname as Link without #_rang, but I can not create correct flagname etc.
Does anyone have a tip for me?
Thanks Bastor Bastor (talk) 17:39, 27 September 2013 (UTC)
How to create advanced queries with a series of AND/OR's?
How would one create a query like this: get a list of persons where the hair color is brown or black and eye color is blue or green?
The reason im asking this is because im unsure of how precedence is handled in these queries. For example if i wrote:
#ask: [[Category:Person]] [[Hair color::brown]] OR [[Hair color::black]] [[Eye color::blue]] OR [[Eye color::green]]
Would the above query actually be correct? would smw group the logic as: ((hair = brown or black) and (eyes = blue or green)) or would the logic be grouped as: (hair = brown or (hair=black and eyes=blue) or eyes = green)? Netbrain (talk) 06:46, 14 October 2013 (UTC)
- On IRC you said you found the answer; for completeness an answer here as well:
- Firstly, you can combine OR for property values: [[<property>::<value1>||<value2>||.....]]
- Secondly, you cannot use brackets to group unions/disjoints, so grouping selection criteria works standard left-to-right, with AND stronger than OR.
- Therefore, your question could be answered
[[Category:Person]][[Hair color::brown||black]] OR [[Category:Person]][[Eye color::blue||green]]
You can read this as
( [[Category:Person]][[Hair color::brown||black]] ) OR ( [[Category:Person]][[Eye color::blue||green]] )
Since you can't actually use the brackets, you need to repeat the common part for every disjoint selection, as shown with the Category selector. Jan "Saruman!" S. (talk) 11:28, 14 October 2013 (UTC)
You can also use sub queries
<q>[[Category:Person]] [[Hair color::brown]]</q> OR <q>[[Hair color::black]] [[Eye color::blue]]</q> OR [[Eye color::green]]
Not sure which forms are the most efficient. Probably not this one. Jeroen De Dauw (talk) 00:10, 16 October 2013 (UTC)
- Thanks, Jeroen, for showing us another method, although I'm not sure I quite understand. The only use case of
...
I was previously aware of is the one outlined in this section: [5]. If you're suggesting that...
can also be used in the same way as the rounded brackets above, then it would be powerful piece of syntax that is worth documenting. Cavila (talk) 13:35, 16 October 2013 (UTC)
- Thanks, Jeroen, for showing us another method, although I'm not sure I quite understand. The only use case of
Documentation for properties - how do you do that ?
Hello, Hi, how would you efficiently create a document that describes a larger list of properties like this:
property name - type (including enumerations) - optional description
The rationale for this question is that I started worrying that we are too messy, e.g. I would like to make sure that similar properties are not duplicated, insure some kind of naming convention, find the right property names for writing query forms, .... in other words I'd like move from a disorganized folksonomy towards a somewhat controlled vocabulary.
I am just asking for some sort of efficient workflow. Since I use semantic forms I can extract lists with emacs (or another good editor) from the templates, but then I'd still have to add values manually.... unless I overlooked some trick to automatize :)
Btw. this would be nice little extension: user provides either a list of template names or a list of property names or a list of pages. The extension then would generate the "manual". Could be a form or some parser extension or whatever, e.g. some light-weight DPL ?
Good example: Guildwars2 wiki (subpages describe properties)
PS: My Example: list of properties - Most are used in a SF "application" Daniel K. Schneider (talk) 17:05, 17 October 2013 (UTC)
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) 14:37, 22 November 2013 (UTC)
Querying for non-empty values
Hello,
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) 22:14, 3 December 2013 (UTC)
- Have you tried
{{#ask:[[Competitor::+]]|format=count}}? Alexander Mashintalk 02:43, 4 December 2013 (UTC)- Thanks, that works great! And how about those situations where the field IS empty?
- I tried [[Competitor::-]], but did not work. Patelmm79 (talk) 19:47, 12 December 2013 (UTC)
- 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) 20:42, 12 December 2013 (UTC)
- This is not covered by SMW. You can only query for existing property values. Probably you may do a
Form Driven Knowledge Base
Hello,
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) 16:57, 9 December 2013 (UTC)
- 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) 18:58, 9 December 2013 (UTC)
Querying for non-zero values does not seem to work
Hello--
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) 21:21, 20 December 2013 (UTC)
- Use
{{#ask:[[CompetitorlName::<q>[[Country::Mexico]]</q>]][[Yield::≥0]] |?Date |?Yield |format=table }}. Alternatively, set $smwStrictComparators to false. Alexander Mashintalk 07:25, 21 December 2013 (UTC)
Demos not working
Hi, I was searching for some result formats and I think some of them are broken or misconfigured, see:
- Demo:Tagcloud/Basic tagcloud with links (colons appearing)
- Help:Slideshow format (demo not working)
- Demo:Listwidget using parameter template (fatal error)
- Demo:Listwidget using sortkey for display (fatal error) Jaider Msg 19:52, 2 January 2014 (UTC)
- Thanks for reporting. I filed an issue about the fatal errors here https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/67 Jeroen De Dauw (talk) 23:39, 2 January 2014 (UTC)
- Fatal errors have been fixed. Jeroen De Dauw (talk) 23:56, 2 January 2014 (UTC)
- The Slideshow format is not working again, see the "Result:" section, after "Example". Jaider msg 22:18, 10 August 2014 (UTC)
- It is a known issue [0] but someone has to pick-up the task.
- [0] https://github.com/SemanticMediaWiki/SemanticResultFormats/issues/56 James Hong Kong (talk) 22:27, 10 August 2014 (UTC)
css styling for 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;
}
- 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) 19:39, 8 January 2014 (UTC)
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 [6] 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) 16:43, 10 January 2014 (UTC)
- You can always use template format combined with GraphViz. Alexander Mashintalk 08:10, 11 January 2014 (UTC)
How to delete pages that are not connected to a category... [SMW]
Hello,
Could someone please explain to me how to delete pages in WIKI? The url is www.faq.vensters.nl. There are some old pages that are not connected to a category that need to be deleted.
Thanks,
Guidance on creating an employee form?
Hello,
I'm working on creating a single form that produces an infobox for applicant, freelancer and employee pages.
What I would like to do
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
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
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
- 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.
- 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) 15:58, 19 January 2014 (UTC)
"sort" option in query does not include results that have no value in sorted field
Hello,
The following query brings up no results (because Begin Date is blank):
{{#ask:[[Category:Market research]]
|?ResearchStatus
|?ResearchType
|?Description
|sort=BeginDate
}}
But this query brings up all results:
{{#ask:[[Category:Market research]]
|?ResearchStatus
|?ResearchType
|?Description
}}
I don't think that it logically follows that a "sort" option should exclude results where sorted field is blank. Patelmm79 (talk) 20:00, 4 March 2014 (UTC)
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]]
|?ResearchStatus
|?ResearchType
|?Description
|?BeginDate
|sort=BeginDate
}}
- 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 Mashintalk 01:42, 5 March 2014 (UTC)
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) 02:56, 6 July 2014 (UTC)
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) 19:42, 22 April 2014 (UTC)
- Okay, apparently it doesn't like my code, even inside code tags. See for example at http://en.wikipedia.org/wiki/Template:Infobox_Officeholder - we're talking about the part with lots of {{{ for terms (I've pulled this template over from Wikipedia). K llandon (talk) 19:50, 22 April 2014 (UTC)
Querying for extra columns without filtering
Hi,
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?
"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,
Ruedi Ruediklein (talk) 21:50, 19 June 2014 (UTC)
{{#ask:[[Category:Semantic MediaWiki documentation]] [[Docinfo author::<q>[[Category:Developer]]</q>]]|?Docinfo author}} will produce:
- 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 Mashintalk 01:58, 20 June 2014 (UTC)
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
- 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) 17:42, 8 August 2014 (UTC)
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}};">
…
</div>
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. Sabine Melnicki (talk) 12:45, 18 September 2014 (UTC)
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)
- 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) 10:51, 20 September 2014 (UTC)
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?
- Try
{{#show: Bruce Wayne | NameFirst}}. Alexander Mashintalk 01:55, 7 November 2014 (UTC)
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?
Error
{{#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 Mashintalk 07:01, 7 November 2014 (UTC)
- 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 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) 15:44, 7 November 2014 (UTC)
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?
Semantic Forms and Parameters
Hi,
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.
Screenshot:
http://imgur.com/czpDJSj
Can anyone help?
- 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) 17:24, 6 February 2015 (UTC)
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) 20:38, 20 February 2015 (UTC)
- $smwgNamespacesWithSemanticLinks is the setting that has to be changed by the system administrators. [[kgh]] (talk) 21:12, 22 February 2015 (UTC)
Semantic Issue After upgrade
Mediawiki upgraded from 1.12 to Mediawiki 1.21
SMW 1.8.0
Hi ,
for ex i created one autopopulated page by using the below syntaxt
like this i have multiple queries on multiple pages, after upgrade of mediawiki 1.12 to mediawiki 1.21 one extra column is coming for ex
Name of the Document
<a href="Test1" title="Test1">Test1</a>
<a href="Test1" title="Test1">Test1</a>
the first adding all ask query page it is showing all the second column value
how to fix it?
Rajeshrjsh (talk) 12:38, 17 March 2015 (UTC)
- Do not do crossposting please! Things will not get faster doing so, in contrary. See the thread on the mailing list [[kgh]] (talk) 18:21, 17 March 2015 (UTC)
Some questions about SMW
Hello all,
at the moment i am becoming crazy looking for information about different aspects of the SMW, and would be cool if someone could help me with them.
1) How can i import ontologies into my SMW? I want to import DublinCore one and another one which i have in ".owl" format, is there any way?
With import i mean having the possibility to use the vocabulary itself on my forms, i would like to have categories and properties automatically created from these ones.
I know there is a way of making a property which is "equal" to external ontologies vocabulary this way:
https://semantic-mediawiki.org/wiki/Help:Import_vocabulary#Making_vocabularies_available_for_import
But this is not what i am looking for. I just want to click "properties"for example and have vocabulary there.
2) Hide deleted properties, categories.......
Whenever i go to my properties place, i find thousands of them with the yellow "warning" sign, which makes you know they have been deleted. I simply want to hide them so they do not botter me when i want to
see the actual vocabulary.
Well, this is all for the moment.
- > With import i mean having the possibility to use the vocabulary itself on my forms, i would like to have categories and properties automatically created from these ones.
- Forms and imported vocabularies don't share any commonalities or functionality. SMW is used under the premise of explicit type declarations. Of course you can create ad-hoc properties but those are defaulted to the page type and should be adjusted to a type it is ought to represent.
- As for imported property references (e.g. foaf, dc), the following discussions should give you a quick overview of what is supported and how [0, 1].
- > I just want to click "properties"for example and have vocabulary there.
- I'm not sure I understand the comment.
- > Whenever i go to my properties place, i find thousands of them with the yellow "warning" sign, which makes you know they have been deleted.
- Again, I'm not sure I understand the comment/question. Do you mean by "properties place" the Special:Properties page? In case you mean Special:Properties, see $smwgPropertyZeroCountDisplay.
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/891
- [1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/464#issuecomment-70341109 James Hong Kong (talk) 16:21, 18 March 2015 (UTC)
I will put an example of what i mean with import:
FOAF has:
Classes:
Agent | Document | Group | Image | LabelProperty | OnlineAccount | OnlineChatAccount | OnlineEcommerceAccount | OnlineGamingAccount | Organization | Person | PersonalProfileDocument | Project |
Properties:
account | accountName | accountServiceHomepage | age | aimChatID | based_near | birthday | currentProject | depiction | depicts | dnaChecksum | familyName | family_name | firstName | focus | fundedBy | geekcode | gender | givenName | givenname | holdsAccount | homepage | icqChatID | img | interest | isPrimaryTopicOf | jabberID | knows | lastName | logo | made | maker | mbox | mbox_sha1sum | member | membershipClass | msnChatID | myersBriggs | name | nick | openid | page | pastProject | phone | plan | primaryTopic | publications | schoolHomepage | sha1 | skypeID | status | surname | theme | thumbnail | tipjar | title | topic | topic_interest | weblog | workInfoHomepage | workplaceHomepage | yahooChatID |
According to : http://xmlns.com/foaf/spec/
I need a way to import classes and properties into my web, so that i go into "Special:properties" and see the foaf classes as if they were introduced by hand in the web. Same with properties, when i go to "Special:properties".
Is it a bit clearer now?
I tried to follow the import marked on :
https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/464#issuecomment-70341109
But this did not do the thing for me.
Issue 2:
Even if this was not what i was looking for:
Help:$smwgPropertyZeroCountDisplay.
Thanks! It will help me. I just wanted to hide properties which had been deleted, not those with 0 uses :).
Hope you can help me with imports now. Thanks for your time! Maiser (talk) 12:57, 19 March 2015 (UTC)
- Issue 1: As the documentation says, after creating the page for the vocabulary import (
MediaWiki:Smw import foaf, for example), you have to include (manually or via template/transclusion) [[imported from::foaf:knows]] statement in a property page or in a category page (if it is a class).
- Issue 2: I don't have an answer for this. I have the same problem for years. Jaider msg 21:11, 19 March 2015 (UTC)
- Issue 1: I already mentioned i did that, but that was not what i was looking for! I am looking for a way to automatically import all vocabulary into the web, without the need to create things one by one each time. Maiser (talk) 22:55, 19 March 2015 (UTC)
- > for a way to automatically import all vocabulary
- A semi-automatic approach is being described above by [1].
- > without the need to create things one by one each time.
- As I mentioned earlier "SMW is used under the premise of explicit type declarations." which means you need at least to declare a connection between a property (Property:A) and its external representation (imported from::foaf:name) otherwise how should the system (SMW) know the attributive connection between an internal and external term.
- To import something without making an explicit declaration is not how SMW ought to work. One can write a tool that would help with those assignments but since each wiki uses individual named properties to assign values, it can not be assumed that Property:Foaf:name on wiki-A means (in terms of its entity description) the same thing as Property:Foaf:name on wiki-B (even though the common sense would dictate such conjecture) because those assumption are not declarative.
- SMW does not reserve the foaf/dc (or any other) namespace for exclusive use by an external vocabulary making it therefore not feasible to assume that Property:Foaf:name represents an external foaf:name entity (this is where we use imported from to assign the meaning of an external vocabulary to a property of one's own choosing).
- > things one by one each time.
- You only create a declaration once per property. James Hong Kong (talk) 23:31, 19 March 2015 (UTC)
OK thanks, so i can understand with this that there is no way of an automatic vocabulary import.
The way i was thinking, was (for example) that if i have
FOAF
Classes
Agent | Document | Group | Image | LabelProperty | OnlineAccount | OnlineChatAccount | OnlineEcommerceAccount | OnlineGamingAccount | Organization | Person | PersonalProfileDocument | Project |
Properties
account | accountName | accountServiceHomepage | age | aimChatID | based_near | birthday | currentProject | depiction | depicts | dnaChecksum | familyName | family_name | firstName | focus | fundedBy | geekcode | gender | givenName | givenname | holdsAccount | homepage | icqChatID | img | interest | isPrimaryTopicOf | jabberID | knows | lastName | logo | made | maker | mbox | mbox_sha1sum | member | membershipClass | msnChatID | myersBriggs | name | nick | openid | page | pastProject | phone | plan | primaryTopic | publications | schoolHomepage | sha1 | skypeID | status | surname | theme | thumbnail | tipjar | title | topic | topic_interest | weblog | workInfoHomepage | workplaceHomepage | yahooChatID |
With this description:
Class: foaf:Agent
Agent - An agent (eg. person, group, software or physical artifact).
Status: stable
Properties include: gender yahooChatID account birthday icqChatID aimChatID jabberID made mbox interest tipjar skypeID topic_interest age mbox_sha1sum status msnChatID openid holdsAccount weblog
Used with: maker member
Has Subclass Group Person Organization
The Agent class is the class of agents; things that do stuff. A well known sub-class is Person, representing people. Other kinds of agents include Organization and Group.
The Agent class is useful in a few places in FOAF where Person would have been overly specific. For example, the IM chat ID properties such as jabberID are typically associated with people, but sometimes belong to software bots.
Making me have a Category called "Agent" with that description, those properties and linked with other subclases. Even if it is not available atm, i do not think it would be impossible to make an automatic vocabulary creator, which started by introducing properties, and followed with classes.(At least with well known ontologies).
I was looking for this because at the moment i have to introduce apart from the dublin core vocabulary (not so extensive) another ontology in ".owl" which has like 100 categories (or classes) and some hundreds of properties also....so doing it manually EACH time (i need to do it more than once) is kind of hard. Maiser (talk) 13:43, 20 March 2015 (UTC)
- > I was looking for this because at the moment i have to introduce apart from the dublin core vocabulary (not so extensive) another ontology in ".owl" which has like 100 categories (or classes) and some hundreds of properties also....so doing it manually EACH time (i need to do it more than once) is kind of hard.
- Your scenario can not be codified in rules that would be applicable and working for each potential user that would need such import feature.
- SMW provides the infrastructure to actual make such models available depending on a users scenario without restriction on how to model.
- In your case (as it seems you need to do it for more than on wiki) I would urge you to write a small tool where you specify your rules and then run the import once per wiki.
- We do similar things with our integration tests [0, 1] where rules are codified (in terms of 'imported from' to property relation) and automatically created each time the test is run. This may or may not helpful to you in writing a tool that would suit your needs.
- As I also mentioned earlier, strict typing of imported vocab. is only supported starting with [2].
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/Integration/Rdf/rdf-003-import-foaf.json
- [1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/ByJsonTestCaseProvider.php#L101
- [2] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/891 James Hong Kong (talk) 14:35, 20 March 2015 (UTC)
Ok thanks. Is there any way then to create more than one property of category at the same time from scratch?
For example in Special:createproperty
"Knows TextProperty "Has type" is a declarative property and can only be used on a property or category page.
Autor PageProperty "Has type" is a declarative property and can only be used on a property or category page.
"
In createForm
"
{{Plant 1
|Knows=
|Autor=
}}
{{Plant 2
|Knows=
|Autor=
}}
"
So that i do not have to enter it all hand by hand each time. Perhaps this peace of code you put helps:
{
"description": "Rdf output for imported foaf annotated vocabulary (requires import before property declaration)",
"properties": [],
"subjects": [
{
"name": "Smw import foaf",
"namespace": "NS_MEDIAWIKI",
"contents": "http://xmlns.com/foaf/0.1/%7CFriend Of A Friend\n name|Type:Text\n homepage|Type:URL\n mbox|Type:Email\n mbox_sha1sum|Type:Text\n depiction|Type:URL\n phone|Type:Text\n Person|Category\n Organization|Category\n knows|Type:Page\n member|Type:Page\n"
},
{
"name": "Foaf:homepage",
"namespace": "SMW_NS_PROPERTY",
"contents": "foaf:homepageProperty "Imported from" is a declarative property and can only be used on a property or category page."
},
{
"name": "Foaf:mbox",
"namespace": "SMW_NS_PROPERTY",
"contents": "TextProperty "Has type" is a declarative property and can only be used on a property or category page. foaf:mboxProperty "Imported from" is a declarative property and can only be used on a property or category page."
},
{
"name": "Foaf:name",
"namespace": "SMW_NS_PROPERTY",
"contents": "TextProperty "Has type" is a declarative property and can only be used on a property or category page. foaf:nameProperty "Imported from" is a declarative property and can only be used on a property or category page."
},
{
"name": "Foaf:knows",
"namespace": "SMW_NS_PROPERTY",
"contents": "PageProperty "Has type" is a declarative property and can only be used on a property or category page. foaf:knowsProperty "Imported from" is a declarative property and can only be used on a property or category page."
},
],
}
But i would like to do something similar for forms and templates. Maiser (talk) 13:32, 23 March 2015 (UTC)
(This could solve my problem, more or less).
Is there any way to indicate some category is subcategory of other one without entering in the page of him?
Something like
Category1
Category2
Category2
Having this i could create my Category hierarchy manually all in the same page, which is not an import, but would make me able to advance quite much. Maiser (talk) 15:29, 23 March 2015 (UTC)
Purge deleted properties
Hello all.
After i create a property with "Special:property" and delete it, whenever i go to "Special:createTemplate" i can still choose it as an element of the template (even if it should no longer exist).
I understand that property itself does not longer exist (does not have nothing on it), and that when you use it, you are kind of creating it.
Anyway, i would like that after deleting it, it´s name also dissapeared, as if it had never existed before, so does not show up when you want to create a template.
How could i do this?
- My Versions: MediaWiki: 1.25.1 | PHP: 5.6.8 | MySQL: 5.6.24 Semantic MediaWiki: 2.2.1
- If you have articles that use the deleted property; you will continue to see the deleted property among existing properties. Cleaning up articles to remove references to the deleted property can help.
- I have also seen improvement by using maintenance scripts.
- Deleting Unused Content
- deleteOldRevisions.php
- This deletes old revisions from the database.
- php deleteOldRevisions.php --delete
- http://www.mediawiki.org/wiki/Manual:DeleteOldRevisions.php
- deleteArchivedRevisions.php
- This deletes deleted pages from the database.
- php deleteArchivedRevisions.php --delete
- http://www.mediawiki.org/wiki/Manual:DeleteArchivedRevisions.php
- Hurrying Jobs
- The folowing speeds up pending jobs.
- runJobs.php
- http://www.mediawiki.org/wiki/Extension:Replace_Text#Known_issues
- It is demanding and can freeze the server, so I don't do it.
- The following is less demanding and does not freeze the server.
- php runJobs.php --maxjobs 1000
- I run this from an XAMPP cmd window of the Maintenance directory. It runs pretty fast. It does not remove phantom properties by itself.
- You may may have already done enough to remove the phantom property and just be waiting for the job that eliminates references to it. In that case this will help. AKSHA (talk) 00:47, 29 July 2015 (UTC)
- Please see Help:Entity deletion. James Hong Kong (talk) 15:31, 30 July 2015 (UTC)
Declaring subcategory without entering the category page
Hello,
at the moment i have to bring a pretty big class hierarchy from a .owl document to my SMW. I have been searching for quite a long time on how to do this, but i have seen that there is no way of a direct "import.
In order to do this, my idea is creating a document which makes something like this:
//Category declaration
Category: catego2
.
.
.
.
Category: catego950
This is easy, and will allow me to create all categories, problem is that they need to be organized in a hierarchy.
For this i would need something like
catego1 subCategoryOf: catego2
You know, without having to enter the category (in this example catego1) each time, as there is a pretty long way to go.
Any clue on how to do this? Did not found nothing on how to do that. Maiser (talk) 16:31, 23 March 2015 (UTC)
SMW database error
Hi,
We are using the older 1.8.0.5 version of SMW with MediaWiki 1.20.2, PHP 5.4.9, MySQL 5.5.28. Everything has been working great so far and we are well over 106,000 pages in our system after over 2 years or use in production. Recently we encountered the following database error when running jobs. It seems to occur only a specific type of page invoking a specific template.
A database query syntax error has occurred.
The last attempted database query was:
"INSERT IGNORE INTO `t6` SELECT t7.smw_id FROM `smw_object_ids` AS t7 WHERE t7.smw_sortkey LIKE 'CID%'"
from within function "SMW::executeQueries".
Database returned error "1114: The table 't6' is full (localhost)"
Is this related to some default MySQL setting for SMW? We currently have just over 16GB RAM used for MySQL caching and buffers. We have plenty of hard disk space. I'm wondering if there is some simple MySQL setting we need to change to increase teh table size. Any help here would appreciated.
Thanks,
- > We are using the older 1.8.0.5 version of SMW with MediaWiki 1.20.2, PHP 5.4.9, MySQL 5.5.28.
- Honestly it will be difficult for use to make any suggestions since you are using a no longer maintained code base (SMW 1.8*). It will be toilsome for us to make an appropriate response but we are tracking the issue at [0].
- > It seems to occur only a specific type of page invoking a specific template.
- Is it possible for you to post the details of your analysis to [0]?
- Also, could you try running an isolated stack trace to see whether the queries are caught in a resource loop and link the report to [0]. Limit your pages when running the job because "$wgDebugDumpSql = true" is expensive as it returns each single SQL query executed.
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/918 James Hong Kong (talk) 15:23, 24 March 2015 (UTC)
- See the post to error 1114 at [0]. James Hong Kong (talk) 15:38, 24 March 2015 (UTC)
Hey,
imagine i want to define a something like this:
Category1
Category2
Category3
Catogory 2 is subcategory of Category1, and 3 is subcategory of 2.
So in a tree, it would be like Category1->Category2->Category3
Problema is that in Special:Category i will see
Category1(3)
Category2(2)
Category3(1)
Showing me all categories with the number of subcategories+1.
How could i maintain a tree view, making only (at this point) Category1 the only visible from the Special:category menu? Maiser (talk) 14:56, 25 March 2015 (UTC)
- > How could i maintain a tree view, making only (at this point) Category1 the only visible from the Special:category menu?
- Generally, SMW (core) does not alter (or interferes with) the display of standard MediaWiki objects (such as categories). I'm not aware of any extension that would fit your requirement but maybe [0] can give you a starting point.
- [0] https://www.mediawiki.org/w/index.php?search=category+tree&title=Special%3ASearch&go=Go James Hong Kong (talk) 17:58, 25 March 2015 (UTC)
Translating categories
Hello,
i hope there is a simple way of doing this! I have just imported some vocabulary from DublinCore ontology and of course, it is all in english. This vocabulary is located in "categories" and "properties". I want that instead of displaying it in english, whenever a user changes the language of the wiki, these vocabulary shows up in that language.
Perhaps there is some label of type [[lang:(language)->show.....]] r something like this.
Could someone help me with this? Maiser (talk) 12:48, 2 April 2015 (UTC)
- Sounds impossible. Alexander Mashintalk 02:03, 3 April 2015 (UTC)
- Just contact me via one of my social links and I'll give you support for this issue. Wolfgang Fahl (talk) 23:57, 10 May 2015 (UTC)
Semantic Forms
Hello there,
i was looking forward a way to do this:
I create a form using "semantic forms" extensions,and category which uses this form both for example called "department". Whenever i create a department using this form, it does not add it in the "department" category and i would like to know how can we do this.
Is there any way to add some text to the "free text" side of the form? Perhaps i could add the "" in there so that all created departments are automatically included in there. Maiser (talk) 05:52, 6 April 2015 (UTC)
- Ok, i have been checking about it, and SEEMS the way i was trying it, was correct. Anyway, it does not show up instantly (will wait a couple of hours and see).
- Actually the way is:
- A template can be used to add pages to a category, usually by placing the category link inside tags on the template (e.g. ). When the template is transcluded into the page, the category link becomes active, and the page is added to the category page. This is useful for categories that have high turnover or many pages included, like cleanup categories.
- From
- http://en.wikipedia.org/wiki/Help:Category
- Perhaps someone knows another way to perform an "instant" categorization? This is kind of the indirect way, and seems it needs a lot of time to "oficially" enter the category. Maiser (talk) 06:18, 6 April 2015 (UTC)
- http://www.mediawiki.org/wiki/Manual:HotCat Alexander Mashintalk 06:20, 6 April 2015 (UTC)
- Lol! I was mistaking template with forms. Seems it works when you edit the template, and i was working with forms. Maiser (talk) 06:30, 6 April 2015 (UTC)
Mixing properties with categories
Hey,
i will put an example to make this question as brief as possible:
I create a category called "Book".
I create a property called "Book"
I create a template called "Lectures" which has one property called "Bookings" which uses "Book" property.
I create a form using this template, and maintain this property with the same name.
I go to "Lectures" form, and create an article with it, which includes a Book (as it was it´s property).
So, this property will appear in "properties:Book", but not in "categories:book".
How can i make that when someone fills a form with a property name which is also a category(apart from property", it appears also as category?
I am asking this because i am making an structure were i want to link 2 categories.
For example if i have a category "teacher" and "school", and i want to know where the teacher teaches, i can only make a form using "properties", so that if i make a property named "school" in "teacher" form, this will not appear in "category:school", but in "property:school", so they are not really connected between them.
To sum up: I would need something that says "if they have the same name, "property:x"="category:x".
Or something which makes a property able to point to an specific category. Maiser (talk) 08:15, 6 April 2015 (UTC)
- Please have a look at Help:Classification and Help:Adding subobjects (it should give you some insights about the category vs property issue).
- > "property:x"="category:x"
- property:x is about the thing x, while category:x is about a class x.
- In your "world" ("world" in a sense of the wiki that hosts your content and ultimately your facts model) you can make it appear to be represent the same entity of knowledge but for SMW (in core) a category and a property are distinguished hence not mixed with each other.
- > How can i make that when someone fills a form with a property name which is also a category(apart from property", it appears also as category?
- This should be possible to achieve in your template with some if/else statements. Please remember, input is done by the form but the actually annotation is added by the template (after the input processing has finished). James Hong Kong (talk) 09:24, 6 April 2015 (UTC)
- Ok, i read those and have been trying to achieve it through subobjects, but something it going wrong. If it is not much demanding, could you please tell me an example?
- For example having a category "Teacher" with has as a property in its template called "Subjects", which refers to the subjects he/she teaches, and having a Category called "Subject" which i want to be automatically filled when someone fills the Teacher form. Maiser (talk) 23:43, 6 April 2015 (UTC)
- > Ok, i read those and have been trying to achieve it through subobjects,
- The links were only listed to illuminate the issue about category vs. property and how SMW interprets both entity description types.
- > could you please tell me an example?
- If you look at the bottom of Template:Event calendar item you can see how a switch function is used to add additional annotations to a subject that depends on the input of the Form:Event calendar item. It should be possible for you to make similar adjustments to achieve your "hidden" property = category assignment (data input post-processing).
- In case you want to make some form field to be pre-selected/pre-filled based on some input dependency from another field, you better ask for assistance on SF talk page (this has less to do with SMW in relation on how data are represented or stored). James Hong Kong (talk) 00:20, 7 April 2015 (UTC)
- So there is not actually a direct way of representing "graph" type data, but just individuals with properties, right? Well, we can have something like "graphs" with "subclassOf", but not having pointers from a category to other.
- So if i do have 3 categories, department (which includes subjects), teacher (which teaches subjects) and subjects, if i added subjects to department and teacher, i would still not see nothing in "subjects" category.
- I understand that properties and categories should be differenced, but i am pretty much surprised there is no way of making a form or template which instead of properties, can use categories as information source.
- Something that gives me hope, it that semantic forms has 2 options for it´s properties which are "category" and "categories", so perhaps someone has been trying to solve this issue.
- Unluckily the only thing which this does to your form is writting a box with "name" which you can not even fill, so perhaps it was forgotten.
- What is that SF talk?
- P.D: I would be more direct with this question. "How can we use categories, instead of properties in forms or templates?". Maiser (talk) 15:58, 7 April 2015 (UTC)
- > So there is not actually a direct way of representing "graph" type data, but just individuals with properties, right? Well, we can have something like "graphs" with "subclassOf", but not having pointers from a category to other.
- We need to clarify the use of the term "graph" in relation to SMW, OWL and machine-readable descriptions such as RDF.
- When you create an article (a subject, the source of a collection of facts about that subject) together with a property-value or class (a category) annotation you express a graph that says "my subject contains an attribute (the property) with an value of ..." or "the subject belongs to a class of ... (a category)". So when editing/creating/annotating an article you declare a "graph" that can be encoded into an equivalent representation such as RDF (for more see RDF export.
- > So if i do have 3 categories, department (which includes subjects), teacher (which teaches subjects) and subjects, if i added subjects to department and teacher, i would still not see nothing in "subjects" category.
- I'm not clear about what you mean by "still not see nothing". If you query for the relation you should be able to see those which belong to either category. A declaration such as "subclassOf" is automatically resolved (see also category hierarchy, $smwgUseCategoryHierarchy). Relationships will not appear automatically on an article (this is where you have to employ queries to make them visible, see also Inverse properties and Inferencing).
- > I understand that properties and categories should be differenced, but i am pretty much surprised there is no way of making a form or template which instead of properties, can use categories as information source.
- This is not what I have said. You are free to use both categories or properties as first class citizen. I merely emphasized that input and post-processing need to be detached from each other and that a category and a property are to represent a different statement about an object (also in regards as to how it is encoded in RDF).
- > Unluckily the only thing which this does to your form is writing a box with "name" which you can not even fill, so perhaps it was forgotten.
- This was an example and was to demonstrate the difference between form and template usage/editing processing.
- > Something that gives me hope, it that semantic forms has 2 options for it´s properties which are "category" and "categories", so perhaps someone has been trying to solve this issue.
- I don't use SF therefore I can't make any comments on that.
- > What is that SF talk?
- See, SF. James Hong Kong (talk) 17:00, 7 April 2015 (UTC)
Any way to create a bunch of pages without having to make clicks for each insertion?
Hello,
Is there any way to do this? For example if i want to introduce 10 different pages (each one with it´s own name). Perhaps a directory in where you can introduce pages information directly, or an extension which makes available to introduce more than one page in a click (dividing one perhaps, which an speficic syntax). Maiser (talk) 14:37, 17 April 2015 (UTC)
- Ok, seems like "Data transfer" extensions is pretty easy to manage. Just modify XML type data manually and make and import will create all pages we have defined.
- http://www.mediawiki.org/wiki/Extension:Data_Transfer Maiser (talk) 18:49, 17 April 2015 (UTC)
- The smartMediaWiki approach helps creating pages dynamically. See my talks at SMW Con Spring 2015 Wolfgang Fahl (talk) 23:56, 10 May 2015 (UTC)
How do I build a query that counts pages by category or subcategory?
Consider this simple situation:
I have a category called Parent Category with two sub categories called First Child and Second Child.
I have a Page A and a Page B that have the category First Child.
I have a Page C has the category Second Child.
What I want to do is count the number of pages in each category.
I can get a count of pages under the Parent Category:
{ { #ask: [ [Category: Parent Category] ] | format = count} }
I can produce a table of pages by category:
{ { #ask: [ [Category: Parent Category] ] | format = table} }
But, how do I do both so that I have a table that looks like this:
Category
Count
first child
2
second child
1
I've tried a few things without success. Here is one example:
{ { #ask: [ [Category: Parent Category] ] | ?Category | ?count | format = table } }
Any advice you have would be appreciated. Dulani (talk) 18:55, 22 April 2015 (UTC)
- Make sure semantics is enabled for category pages,
- define Template:Count pages in category as
{{#ask: [[Category:{{{1}}}]] | format = count}},
- insert query
{{#ask: [[:Category:+]] [[Category:Parent category]] | link = none | format = template | template = Count pages in category}} into your page,
- submit and wait forever until the page is parsed. Alexander Mashintalk 02:00, 23 April 2015 (UTC)
How to hide the "Previsualization message"
I want to add some pre-made questions, were user just have to feel a box , make a click, and obtain the answer.
In order to do this i used semantic forms+templates, so that if for example i want to ask "Which are the contributions of a particular user (articles, links, extensions.... basically all in were user is tagged, can be accessed in a organized way just by putting his name in a box and clickig.
For this i converted the "preview" button, in something which takes the value of the box and launches the inline query (#ask) from the template without saving it as a page, obviously.
Problem is that upwards i get this message telling me that "this is a previsualization message....." which i want to get rid of.
fresh install and semantic bundle question
Hi, I want to make a fresh install from source on a redhat 6 64 bit system. Is the order of things to get a working mediawiki, then add the semantic mediawiki extensions? What is the advantage of the bundle? I read the docs but am not clear on what exactly it is and if that would be the best bet for a fresh install. If I install the bundle does it install the extension too? I am assuming with either approach I need to have a working recent (i.e. not rhel6 repo) mediawiki in first. Is that correct? Sorry for such basic questions, but I want to avoid installing the wrong way.
I am particularly excited by the inline query abilities. is SMW the only platform that offers this? Everything else I looked at is only able to query and return rdf in big chunks like tables and we have several projects that could really use the inline query method to good advantage.
Thanks for answering n00b question! Rcrath (talk) 02:16, 13 May 2015 (UTC)
- > I read the docs but am not clear on what exactly it is and if that would be the best bet for a fresh install.
- Have a look at the video [0] which should give a clear picture of how a fresh install can be achieved. For details on the specific installation requirements, see the Installation help.
- > mediawiki in first. Is that correct?
- MediaWiki first, SMW comes second as it requires MW to be working.
- > What is the advantage of the bundle?
- If you talk about the SemanticBundle, not much and it only supports SMW 1.9.2 which is no longer under active maintenance. The current SMW release is 2.2.
- If you want install SMW related extensions such as Extension "Semantic Result Formats" (see [1]) or Extension "Maps" just follow the specific installation guideline of that extension you want to install.
- The following list contains details about SMW extensions available via Composer.
- If you can`t use Composer, see the tarball installation guideline.
- > Sorry for such basic questions
- You might also have a look at Help:Getting started.
- [0] https://vimeo.com/82255034
- [1] https://vimeo.com/82258857
- Cheers James Hong Kong (talk) 01:47, 14 May 2015 (UTC)
Making URL look better
Hey,
is there any way making an URL look better?
for example if i have a link to an image of a galaxy:
And i want the link just to say "galaxy" but making it able to access the image in one click, how would i do it?
Thanks!
EDIT:
Here is the link, should have looked it first at media wiki, kind of out of topic here lol, did not thought about it. Still there is no way to delete this post so i will just give the answer:
http://www.mediawiki.org/wiki/Help:Links Maiser (talk) 19:17, 21 May 2015 (UTC)
Problems uploading and deleting files
Hello,
i have enable file upload with $wgEnableUploads=true; in the LocalSettingsp.php, but i am having some problems.
Each time i try to download a file, i will get a screen which says:
Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594
That line stands for this peace of code:
static public function getDataItemExpElement( SMWDataItem $dataItem ) {
return self::$dataItemToElementEncoder->mapDataItemToElement( $dataItem );
}
Anyway, even if i get that error, file gets uploaded to the repository.
Afterwards, when i go to repository and i try to delete that file i get:
Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594
Exactly the same error, but this time the file will not be deleted.
What is causing this and how could i solve it?
Atm i am installing the semantic media wiki on a free host (hostinger), which uses linux's Centos 5.5 distribution i believe, do not know if that has an influence. Maiser (talk) 11:52, 27 May 2015 (UTC)
- > Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594
- This error can virtually not happen because each call in SMW is using `Exporter::getInstance()->getDataItemExpElement` and there should be not one single caller that is executing `Exporter::getDataItemExpElement` directly therefore I cannot tell as to what happens on your installation. Furthermore, the upload is tested against SQLStore and SPARQLStore with a real upload process [0].
- Having the complete stack trace would help in guessing where `Exporter::getDataItemExpElement` is called from.
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/Integration/MediaWiki/Hooks/FileUploadIntegrationTest.php James Hong Kong (talk) 12:29, 27 May 2015 (UTC)
- Ok, problem was definitively coming from:
- http://www.mediawiki.org/wiki/Extension:RDFIO
- which was calling that function. Going to try to solve it by making a clean instalation of it again (to see if i made an error, even if i know pretty much for sure that it sometimes randomly fails, from previous local instalations) and if that does not the thing, i will go for the complete stack trace.
- Many thanks. Maiser (talk) 12:45, 27 May 2015 (UTC)
- > Ok, problem was definitively coming from:
- http://www.mediawiki.org/wiki/Extension:RDFIO
- The `Exporter` should always be called using `Exporter::getInstance()->...`. James Hong Kong (talk) 12:50, 27 May 2015 (UTC)
- https://github.com/samuell/RDFIO/issues/11 James Hong Kong (talk) 13:11, 27 May 2015 (UTC)
Semantic Forms: Forminput with Multiple Rows
Hey,
like I wrote above, I would like to create a forminput multiple input fields. I want to do that because our workers always mess up the form Name and put in to many spaces or delete the commas.
I hope you understand what I mean, if not I try to explain it better with this:
Currently our Forminput looks like this
{{#forminput:Installation|70|Installation: Ort,Projektname,Rechner1}}
and after that comes the rest of the form.
Now this is only one input row, and I want three input rows where each contains a part of the title.
Ort:
Projektname:
Rechner:
If it stays like this our workers keep messing up the title names and sometimes the names are full of underlines.
Sorry for my bad english, if there is something not clear I try my best to edit it. Arty (talk) 06:10, 15 June 2015 (UTC)
- Have a look at the one step process. So the form should have something like {{{info|page name=Installation: <Installation[Ort]> <Installation[Projektname]> <Installation[Rechner]>|add title=Installation erfassen|edit title=Installation bearbeiten}}}. The best and fastest entry point to help regarding Semantic Forms is this talk page. Cheers [[kgh]] (talk) 18:20, 15 June 2015 (UTC)
- Okay thanks for helping me, but somehow this won't work for me
- When i try the info tag it only prints the stuff thats in the first "bracket" like I put in your code and it only prints "page name=Installation: <Installation[Ort]> <Installation[Projektname]> <Installation[Rechner]>"
- Then when you put other things in the first place it for examples prints "add title=Installation erfassen"
- Maybe I'm just overlooking something but it would be nice if you could also help me out with this problem Arty (talk) 06:05, 17 June 2015 (UTC)
- > Maybe I'm just overlooking something but it would be nice if you could also help me out with this problem
- Unfortunately this forum is mostly concerned with SMW-core questions and
#forminput is a specific SF question (and is not related to SMW) therefore it would be best to ask the maintainer [0] directly.
- [0] https://www.mediawiki.org/wiki/Extension_talk:Semantic_Forms James Hong Kong (talk) 13:31, 17 June 2015 (UTC)
Album-to-song and tracklists relationships
Hi. First of all, thanks for SMW, a great software solution. I've just discovered it recently, and it looks really cool. I'm a long-time MediaWiki user and maintain a public music band wiki. I'm going to start a new project and now I would like to introduce SMW to avoid the existing wiki problems. I have a local playground where I do my SMW experiments, and I'm wondering if it's possible to make an album tracklist solution (one-to-many). Let's say, there is an album titled ALBUM and it contains the following template invocation:
{{Tracklist
| TRACK1
| TRACK2
| TRACK3
| TRACK4
}}
The Tracklist template is as follows:
<includeonly>
{{#fornumargs: I
| V
| {{#set:
Type=tracklist
|Collection={{FULLPAGENAME}}
|Version={{{Version|}}}
|Index={{#var: I}}
|Song={{#var: V}}
}}
}}
</includeonly>
It produces:
{{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG1}}
{{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG2}}
{{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG2}}
{{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG4}}
And when, by my intention, I'm trying to query a tracklist for the album, I get a grouped result unfortunately (as far as I understand, this is how SMW works):
==Tracklist==
{{#ask: [[Type::tracklist]]
|?Collection
|?Version
|?Index
|?Song
}}
turns into a one-row table (format=ol produces a single line list) because of grouping:
+---------+------------+---------+-------+--------+
| | Collection | Version | Index | Song |
+---------+------------+---------+-------+--------+
| | | | 1 | SONG 1 |
| | | +-------+--------+
| ALBUM | ALBUM | | 2 | SONG 2 |
| | | +-------+--------+
| | | | 3 | SONG 3 |
| | | +-------+--------+
| | | | 4 | SONG 4 |
+---------+------------+---------+-------+--------+
After all, the whole ALBUM just got 4 properties, and this is why the result is grouped. I would like to "ungroup" it as if it's a SQL-like query without a GROUP BY clause. The only solution I see is spreading the tracklist information onto each of 4 song pages, like {{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG1}} thus associating the tracklist album/index with a particular song, not the album itself where I'd expect to store the actual tracklist I used to do in my existing non-SMW wiki. This may look unusual, odd and violationg the SMW principles. Sorry for probably a vague explanation.
My question is as follows: what would you suggest to "ungroup" the result? Does my SQL-like idea violate the SMW principles? Any comments are appreciated. Thanks! Halo (talk) 23:34, 24 June 2015 (UTC)
To build a one-to-many relationship for a subject (e.g. Album entity) it would be best to use the #subobject instead of #set.
{{#subobject:
|Type=tracklist
|Collection={{FULLPAGENAME}}
|Version={{{Version|}}}
|Index={{#var: I}}
|Song={{#var: V}}
}}
{{#ask: [[Collection::{{FULLPAGENAME}}]]
|?Version
|?Index
|?Song
|mainlabel=-
}}
See also Examples/Queries/Subobject to display table rows
> music band wiki. I'm going to start a new project and now
You may want to look at [0] to get some ideas about a music related wiki that uses SMW.
[0] http://tangowiki.org/wiki/Main_Page James Hong Kong (talk) 18:38, 25 June 2015 (UTC)
- This is interesting. I'm currently testing it, and it seems to be what I want. Thank you! Halo (talk) 09:08, 28 June 2015 (UTC)
- One more question, please. Is it possible to refer the properties defined at the "sub/child"-pages? I would like to extend the above template/table output with the "Length" column so it could look like a real tracklist. The
?Song property refers to song pages, and every song page has a song definition with the Length property set. It's like the INNER JOIN operation, but I feel like I'm abusing SMW capabilities (and it looks like I'm more of finding a search mechanism like XPath). Is it possible somehow? Halo (talk) 19:16, 28 June 2015 (UTC)
- In case you go with the #subobject then your data model will most likely be something like:
- An ALBUM is represented by a wikipage ->
- Subobjects are embedded in a page to represent each individual song ->
- Each song has attributes like:
- Song title
- Song index
- Song length
- Song author/composer/writer (optional in case it is a compilation where a song can have different writers from the Album)
- etc.
- As demonstrated you attach attributes/properties to an individual song which a #subobject not a page (we are talking about an entity)
- If you want to split an ALBUM/SONG by page/subpage then you can take a similar approach only that subobjects need to contain a reference to the album.
- For example, looking for an album of song writer YYY where you want to see songs with title and length -> [[Has song writer::YYY]]|?Song title|?Song length. James Hong Kong (talk) 14:02, 7 July 2015 (UTC)
The task for SMW or not?
I need to solve the following problem: there are several thousands of pages, and each page contains a variety of unique labels (up to several dozen). These labels are unique globally and I need be able to find the page on the label. It is clear that, in theory, this problem can be solved by standard Mediawiki redirects, but they are difficult to automatically create (or remove when modifying pages).
Question: how far is it appropriate to solve this task by means of SMW? StasR (talk) 08:17, 5 July 2015 (UTC)
- What is a "label", how is it defined in the wikitext, and how do you ensure that it's globally unique? Yaron Koren (talk) 23:10, 5 July 2015 (UTC)
- There are partial dumps of external database, these labels - unique keys in the database. I will convert the dump to xml for import into wiki, so I can include labels into the body of tag pages in any form. When parsing I can resolve internal links within a single partial dump, but links to other parts (already included in the wiki, or included in the future) should be linked by means of mw / smw / something else. StasR (talk) 08:17, 6 July 2015 (UTC)
- Alright. What's a "tag page", and what does it mean to resolve an internal link? Yaron Koren (talk) 19:54, 6 July 2015 (UTC)
- If the page refers to labels that have been defined on another page of the same partial dump, then I convert it into a normal Wiki link when I convert the dump to XML. StasR (talk) 20:39, 6 July 2015 (UTC)
- I don't know, I still don't really understand the question. Hopefully someone else can help you. Yaron Koren (talk) 20:18, 8 July 2015 (UTC)
I may confer with the previous commenter not being able to see the full extend of what you want to achieve but for what it's worth maybe the following datamodel can help.
Have your labels that point (from the origin subject) to (or from) the source being collected as part of a subobject like:
Page "SomeSubject" that relates to:
{{#subobject:
|Has label=One,Two,Three,...|+sep=,
}}
With above statement you should be able the search for labels that point to the subject that contain those labels without having to create any redirects.
{{#ask: [[Has label::~*Two*]] }}
If the search of a subject that contain some of those labels (with "Has label" being of either "Page" or "Text" type) is not your primary objective then you need to clarify the intention of your DM. James Hong Kong (talk) 06:50, 9 July 2015 (UTC)
Using SMW to query Anchors
Good day:
My Versions: MediaWiki: 1.25.1 | PHP: 5.6.8 | MySQL: 5.6.24 Semantic MediaWiki: 2.2.1 | Lingo: 1.2.0 | Semantic Glossary: 1.1.0
I searched the MediaWiki website for the phrase “Anchor”.
About 13 items down in the Search results I see an entry like the following:
Manual:PAGENAMEE encoding (section Whitespaces in page names and anchors (section headings))
The search returns a particular anchor inside an article.
Is there a way that I can use MSW to mark MediaWiki anchors so that I can get an SMW query to return anchors? AKSHA (talk) 00:54, 29 July 2015 (UTC)
- Looks like that you should use subobjects instead of or in addition to anchors. Alexander Mashintalk 02:05, 30 July 2015 (UTC)
- Thank you Alexander:
- Could you say a little more please? I use subobjects presently. They are very good for precisely querying articles.
- Is there a way to arrange a subobject so that a query it returns a section of an article?
- Perhaps there is some alternative way to create sections in an article? AKSHA (talk) 11:43, 30 July 2015 (UTC)
I'm not quite sure I understand the issue/question but what if you create a page `ArtitlceWithSection` that contains:
{{#subobject:
|Has page=ArticleWithSection
|Has section=ArticleWithSection#abc
}}{{#subobject:
|Has page=ArticleWithSection
|Has section=ArticleWithSection#123
}}
{{#ask: [[Has page::+]][[Has section::+]]
|?Has section
}}
== abc ==
== 123 ==
The query should display and link to the correct section. James Hong Kong (talk) 15:29, 30 July 2015 (UTC)
- Good morning:
- Honestly; I saw that a search on Wikipedia or MediaWiki could return sections of articles as well as articles. I wanted that precious ring and was told it was accomplished using CirrusSearch. I failed to get CirrusSearch working and got lost trying to follow the detailed configuration advice. Is this because I am using the latest MediaWiki version? Is it because of some configuration I have not done on my wiki? Is it because of subtle CirrusSearch requirements?
- The answer to these questions, clearly, was to see if I could have a search of my wiki return article sections by relying solely on SMW.
- The solution you provide works neatly and is easy. Thank you Alexander.
- I worry that a subobject per anchor adds some overhead per anchor in an article across the wiki. That is to say that it is more work.
- In addition to a subobject per anchor; I see that I can shift to a larger number of shorter articles.
- Shorter articles will leave me better able to zoom in on a very specific topic without being able to query sections of an article.
- Then I will want to mitigate that my articles are become grains of sand on a beach.
- I can give each short article a subobject. I can then query to organize related short articles to create a more inclusive article using the Embedded Format.
- http://semantic-mediawiki.org/wiki/Help:Embedded_format
- Sorry to be verbose. Thanks to the forum. AKSHA (talk) 12:43, 7 August 2015 (UTC)
Issues with the "sep" function in mode Query template.
There is a issue since the 2.1 SMW version when we use a "sep" function with the Archive:Template format.
Here is the code:
{{#ask: [[Category:City]] [[located in::Germany]]
| format = template
| template = Link
| sep = •
| link = none
}}.Here is the result:
Semantic MediaWiki • Semantic MediaWiki • Semantic MediaWiki • Semantic MediaWiki • Semantic MediaWiki • Semantic MediaWiki
There should be a separator between the each value. That's not the case obviously. It seems to be a bug. LIMAFOX76 (talk) 15:05, 24 August 2015 (UTC)
`sep` is only used as divider for when multiple values are assigned to same field (property) for querys like:
{{#ask: [[Category:City]] [[located in::Germany]]
|?Has something --> used by/for sep
The template has to care for the formatting, values do not contain arbitrary separators (except those concatenated of multiple values) that weren't part of its value declaration.
You can make a feature request [0] to have the `sep` parameter made available as {{{sep}}} in a template (so it can be used further within a template).
BTW: I tested it against 1.9.2.
[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/ James Hong Kong (talk) 16:14, 24 August 2015 (UTC)
- Yet it's working on a version 1.8
- Here are the link (bottom template): http://stargate.shoutwiki.com/wiki/MacKenzie_%28doctor%29
- And now the same template on a 2.1.3 version: http://battlestar.wiki/Mod%C3%A8le:Palette_Personnages LIMAFOX76 (talk) 20:18, 24 August 2015 (UTC)
- I replaced |format = template by |format = list living the rest as this and now it's working well. With this, I can change the sep parameter using the template I need. LIMAFOX76 (talk) 09:34, 8 September 2015 (UTC)
- Has been addressed with https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/2022. James Hong Kong (talk) 06:37, 19 November 2016 (UTC)
Creating new content (tables) through other tables
What I have:
Manual created projects (movies) with master data for: Actor, Role, Voice Actor
Example:
Actor
Role
Voice Actor
Actor 1
Role 1
Voice Actor 1
Actor 2
Role 2
Voice Actor 2
What I need:
An automatic generated table on the page of the actor/voice actor with the information:
for the Voice Actor:
Project
Role
Actor
Project 1
Role 1
Actor 1
Project 2
Role 2
Actor 2
for the Actor:
Project
Role
Voice Actor
Project 1
Role 1
Voice Actor 1
Project 2
Role 2
Voice Actor 2
- In addition to table lines on the page about a project, your template (I hope you use template for this) should create subobjects:
{{#subobject: | Project = {{FULLPAGENAME}} | Role = {{{Role|}}} | Actor = {{{Actor|}}} | Voice actor = {{{Voice actor|}}} }}.
- The tables you want will then be produced by queries:
{{#ask: [[Voice actor::{{{Voice actor|+}}}]] | ?Project | ?Role | ?Actor | format = table }} and {{#ask: [[Actor::{{{Actor|+}}}]] | ?Project | ?Role | ?Voice actor | format = table }}.
- Of course, you will need to create properties Project, Actor, Voice actor of the type Page and Role of the type Text. Alexander Mashintalk 09:07, 15 September 2015 (UTC)
Thanks for the quick reply,
yes I am using templates for the projects (not for the tables yet since I didnt know how to create n+1 tables as of yesterday since I found this extension)
but it shouldnt be a problem to change the projects.
the template looks like that for now:
{{Movies
|Picture=
|Title=
|Original Title=
|Release=
|Bluray=
|Trailer=
|Dubbing Studio=
|Dialogue Script=
|Dialogue direction=
|Description=
}}
and then I am adding the tables by hand
{| class="wikitable sortable"
|-
! scope="col"|Actor
! scope="col"|Role
! scope="col"|Voice Actor
|-
| [[Actor 1 ]]||Role 1||[[Voice Actor 1]]
|-
| [[Actor 2 ]]||Role 2||[[Voice Actor 2]]
|}
Clemonde (talk) 09:51, 15 September 2015 (UTC)
- Hi Clemonde, Alexander made a mistake, probably by accident. Don't use #set for subobjects but #subobject, which is documented here. Cavila (talk) 10:07, 15 September 2015 (UTC)
- Yes, it should be #subobject. Alexander Mashintalk 13:41, 15 September 2015 (UTC)
You can define template {{role}} like this:
<tr><td>[[{{{Actor|}}}]]</td><td>{{{Role|}}}</td><td>[[{{{Voice actor|}}}]]{{#subobject: | Project = {{FULLPAGENAME}} | Role = {{{Role|}}} | Actor = {{{Actor|}}} | Voice actor = {{{Voice actor|}}} }}</td></tr>
and call any number of times it on any project page between <table class="sortable wikitable"><thead><tr><th>Actor</th><th>Role</th><th>Voice actor</th></tr></thead><tbody> and </tbody></table>.
These table header and footer can also be wrapped in a template {{roles}}: <table class="sortable wikitable"><thead><tr><th>Actor</th><th>Role</th><th>Voice actor</th></tr></thead><tbody>{{{1|<tr><td colspan="3">put one or more role templates here</td></tr>}}}</tbody></table>.
Or better, create a Lua function that can accept a variable number of arguments. Alexander Mashintalk 13:48, 15 September 2015 (UTC)
- thanks guys, I will see if it works and give feedback tomorrow Clemonde (talk) 15:43, 15 September 2015 (UTC)
- before I can can even start testing:
- maybe I am just too stupid for the basic installation of semantic mediawiki ...
- do I need to install composer on my server where the wiki is located or on my local machine?
- Maybe I should use the tarball method :D Clemonde (talk) 20:32, 15 September 2015 (UTC)
- The recommended way to install SMW is with composer, yes. The second best (I hope it is still working) is with git, although it will not take care of the dependencies. Downloading tarball will make upgrading difficult. Alexander Mashintalk 21:37, 15 September 2015 (UTC)
- Composer is the recommended installation method (this is to ensure that dependencies as specified are loaded and not added by random selection or version).
- I would not recommend git unless you are a developer or know what you are doing (if we change dependencies then this will have to be taken care of by the user him(her)self, and we do change dependencies).
- Tarball is another option but if a new release occurred then you need to replace files in the extension and vendor directory to update all dependencies deployed by the new tarball. James Hong Kong (talk) 21:51, 15 September 2015 (UTC)
- > do I need to install composer on my server where the wiki is located or on my local machine?
- Please have look at Help:Using Composer. James Hong Kong (talk) 21:54, 15 September 2015 (UTC)
dear Alexander Mashin, could you show me the {{{role}}} and {{{roles}}} templates with an example in wiki please?
btw the ask function does work perfectly:
{{#ask: [[Actor::{{{Actor|+}}}]]
| mainlabel=-
| ?Year
| ?Project
| ?Role
| ?Voice Actor
| format = sortable
| sort = Year
| order = desc
}}
btw you can use "nocinclude" to make it look like I did
and is it possible to set a width for the output-table? Clemonde (talk) 21:07, 17 September 2015 (UTC)
- I have not created those templates in any wiki. You could just copy the wikitext for them that I wrote in one of my previous replies.
- As to table's width, you can use widetable format or set the table width for .smwtable class with site-wide CSS in MediaWiki:Common.css. Alexander Mashintalk 21:24, 17 September 2015 (UTC)
- It's plain HTML, which is also allowed in wikis. You can try to use equivalent wikicode, but there might be issues while assembling a table from several templates. You may need to screen pipes (
| → {{!}}) and carefully avoid extra spaces. Alexander Mashintalk 15:39, 18 September 2015 (UTC)
- this is how it looks like for now:
- Men in Black (1997)
- and
- Template:Name
- (it's just my wiki where I test stuff) Clemonde (talk) 16:47, 18 September 2015 (UTC)
I've got the link to this community-portal from Clemonde and tried it on a fresh mediawiki with smw extension.
My sobobject tuples look like this.
{{#subobject:
| Project = {{FULLPAGENAME}}
| Year = 1995
| Role = Det. Mike Lowrey
| Actor = Will Smith
| Voice Actor = Leon Boden
}}
{{#subobject:
| Project = {{FULLPAGENAME}}
| Year = 1995
| Role = Det. Marcus Burnett
| Actor = Martin Lawrence
| Voice Actor = Torsten Michaelis
}}
The following statement made it possible to put these subobjects in one table:
{{#ask: [[Actor::{{{Actor|+}}}]]
| mainlabel= -
| ?Actor
| ?Role
| ?Voice Actor
| format = sortable
| sort = Year
| order = desc
}}
What exactly does [[Actor::{{{Actor|+}}}]] do? I red the user-manual but could not figured it out properly
I tried to write two actor/voice-actor/role tuple in one subobject. But as a result the site of the Actor/Voice-Actor did show all tuple and not just the one WHERE Actor.Name = Will Smith
The ask command in the actor template:
{{#ask: [[Actor::{{FULLPAGENAME}}]]
| mainlabel=-
| ?Year
| ?Project
| ?Role
| ?Voice Actor
| format = sortable
| sort = Year
| order = desc
}}
Is there an easy way to fill the project table manually (by hand) and extract the needed data in the pages of Actor/Voice actor? A subobject for every tuple is a bit overwhelming.
Maybe a pseudo SQL statement helps:
SELECT Actor.Name, Role.Name, VoiceActor.Name
FROM Project
WHERE Actor.Name = Will Smith
- > What exactly does
[[Actor::{{{Actor|+}}}]]</code> do? This is the WHERE clause of the query.
- My example assumes that the
{{{#ask:…}} statement is used on the template called, say Template:Actor's roles, which receives Actor as an argument: {{Actor's roles|Actor=John Smith}}.
- If
Actor is not given ({{Actor's roles}}), + will be used to choose all role subobjects where Actor property is set.
- Another possible solution is to use the page title as the default value for
Actor argument: [[Actor::{{{Actor|{{FULLPAGENAME}}}}}]]. In this case the template call on a page about an actor will look simply like this: {{Actor's roles}}. Alexander Mashintalk 20:40, 21 September 2015 (UTC)
Semantic search in documents (indexing)
Hello everyone,
Recently I've started doing some research about semantic web and this amazing mediawiki. Currently i'm wondering if it's possible to do a full text search on documents such as docx and pdf on my wiki page. That's the reason why I want to make my search engine as smart as possible. For example if I fill in an unknown keyword that my search engine will search in everything like what I stated above such as documents/files on all pages.
Is there such extension or a way already that searches in documents ?
I hope someone can help me out with this, because i've been stuck for days, for trying to reinvent the wheel.
PS: these are all educational purposes and it's all for my research. Tinnie (talk) 09:33, 9 October 2015 (UTC)
- > Currently i'm wondering if it's possible to do a full text search on documents such as docx and pdf on my wiki page.
- If we talk about Semantic MediaWiki then the answer is no.
- > Is there such extension or a way already that searches in documents ? I hope someone can help me out with this, because i've been stuck for days, for trying to reinvent the wheel.
- Maybe CirrusSearch [0] which underneath uses ElasticSearch can help with file indexing.
- [0] https://www.mediawiki.org/wiki/Extension:CirrusSearch
- Cheeers James Hong Kong (talk) 11:51, 9 October 2015 (UTC)
- Thank you for your reply I was actually wondering about this extension
- https://www.mediawiki.org/wiki/Extension:SolrStore Tinnie (talk) 12:42, 9 October 2015 (UTC)
- Right, forget about this one maybe it will work (I never used it). James Hong Kong (talk) 12:48, 9 October 2015 (UTC)
- I just created Full-text search, it would be of great help if you could extend this page with your research experience about this topic. James Hong Kong (talk) 12:53, 9 October 2015 (UTC)
- Of course, will do Tinnie (talk) 13:12, 9 October 2015 (UTC)
- apparently https://www.elastic.co/guide/en/elasticsearch/guide/current/full-text-search.html does support documented full text search since the engine is based on Lucene's ! Solrstore is outdated btw. Tinnie (talk) 10:22, 19 October 2015 (UTC)
- > apparently https://www.elastic.co/guide/en/elasticsearch/guide/current/full-text-search.html does support documented full text search
- In general, arbitrary text search (matching a string) and attributive search (matching an entity on certain attributive conditions) are two distinct approaches and suffice depending on the objective one tries to achieve.
- Having full-text search (as a string match) combined with an attributive search is the challenge as both result sets need to be combined into one.
- In the past we (core-team) had some minor exchange about ElasticSearch [2, 3, 4] integration but since that requires commitment and manpower it hasn't been on anyone's agenda.
- [2] https://github.com/eea/eea.elasticsearch.river.rdf
- [3] http://elasticsearch-users.115913.n3.nabble.com/Faceted-search-using-RDF-triple-like-related-documents-td4049280.html
- [4] https://github.com/jprante/elasticsearch-plugin-rdf-jena James Hong Kong (talk) 10:32, 19 October 2015 (UTC)
- Perhaps, you should think about converting your *.docs and *.pdfs into wikitext. Alexander Mashintalk 04:40, 21 October 2015 (UTC)
Version support
It says here that the latest SMW release is compatible with MW 1.19.0 - 1.24.x. What about MW 1.25? Jackson667 (talk) 08:04, 13 October 2015 (UTC)
- Good catch! The whole point of this release was to provide compatibility with MW 1.25. I have just fixed this. More detailed and more up-to-date information on compatibiliy is also provided with the software itself. Have a look at COMPATIBILITY.md. Cheers [[kgh]] (talk) 09:04, 13 October 2015 (UTC)
Strange Properties appearing
I've had a persistent problem with a Property I use: "CentralIndexRef" this is usually a reference number eg V51 or X1, it seems fairly straightforward. I use a form to build the data.
Article |CentralIndexRef=G T X W
However I get loads of junk entries appearing
CentralIndeB1Ref (134 uses)
CentralIndeC2Ref (88 uses)
CentralIndeP4Ref (56 uses)
CentralIndeR2Ref (54 uses)
CentralIndeA3Ref (52 uses)
CentralIndeK5Ref (40 uses)
CentralIndeN3Ref (39 uses)
CentralIndeS3Ref (34 uses)
CentralIndeN1Ref (24 uses)
CentralIndeK4Ref (24 uses)
CentralIndeDRef (22 uses)
CentralIndeG T X WRef (21 uses)
Etc, etc. It seems as though it's treating the x in the property title as a variable. I've just wiped and rebuilt all the data as suggested here: Repairing data and data structures, but it doesn't seem to have solved it.
is this a known issue? Stuarticus (talk) 14:24, 16 October 2015 (UTC)
- > Etc, etc. It seems as though it's treating the x in the property title as a variable
- No, a property label (or title) doesn't make any arbitrary decisions about part of the character set it represents.
- I don't fully understand the issue, maybe it would be good if you try the replicate your issue on [0] so we can attempt to eliminate or identify the potential problem.
- [0] http://sandbox.semantic-mediawiki.org/ James Hong Kong (talk) 14:34, 16 October 2015 (UTC)
- I have seen it to appear in [0] and I suspect that this relates to this code {{#arraymap:{{{CentralIndexRef|}}}|,|y|[[CentralIndexRef::y]]}} in your
Template:Article that creates an empty property.
- I think if you remove the arraymap call then those arbitrary properties should no longer be created but this isn't really related to smw-core (this parser is provided by SF).
- I think the x in CentralIndexRef in combination with arraymap causes this strange appearance, if you would use something else without x the issue might also disappear but again this relates to the use of arraymap and not smw-core.
- [0] http://sandbox.semantic-mediawiki.org/w/index.php?title=Special:Properties&limit=51&offset=0 James Hong Kong (talk) 16:31, 16 October 2015 (UTC)
- I suspect that entries like CentralIndeB1Ref are empty (when created by the arraymap) and despite being void are still created as property reference hence the visibility in Special:Properties.
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/1217 James Hong Kong (talk) 17:42, 16 October 2015 (UTC)
- That makes sense, thanks MWJames. Replaced the variable x with y and rebuilt data and it's all gone. Stuarticus (talk) 11:37, 20 October 2015 (UTC)
Images in Graphviz nodes - which path to use?
I need to create a graph with the Graphviz extension, in which the node is filled with an image. "Image" is used as an attribute in a "node" definition. An example is found here: http://www.graphviz.org/content/kennedyanc. However, that example does not run on MediaWiki, which has a different way to store images. That could be a problem. According to the extension description at https://www.mediawiki.org/wiki/Extension:GraphViz, a restriction states that "Any image attribute values are required to be the names of uploaded files". Okay... but whatever I do, just the filename, or the full link to the file in the images folder, it doesn't work. The system error message is "The dot image attribute must be the name of an uploaded file". Has anyone worked with this and found a solution? Peter Woudsma (talk) 21:23, 20 October 2015 (UTC)
http://wiki.bitplan.com/index.php/SimpleGraphModuleHubAndSpoke has an example
e.g.
SMW [ URL="[[SimpleGraph-SMW]]" label="" image="SemanticMediaWiki Logo.png" ]
Wolfgang Fahl (talk) 07:18, 16 February 2019 (UTC)
The phrase, "... in conjunction with many spinoff extensions ..."
Could be, "... in conjunction with many spinoff extensions ...". I'd be bold, but the homepage is blocked for editing. Also, why not stick the survey in what was the SMWCon banner? kthxbi Dan Bolser (talk) 21:58, 3 November 2015 (UTC)
Error on talk pages
Our talk/discussion pages are getting a SMW-related error that I have no clue about:
Catchable fatal error: Argument 2 passed to SMW\MediaWiki\Hooks\ArticleFromTitle::__construct() must implement interface Page, boolean given, called in /home/services/xf/public_html/wiki/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/HookRegistry.php on line 446 and defined in /home/services/xf/public_html/wiki/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/ArticleFromTitle.php on line 39
We're on the following versions:
MW 1.25.1
SMW 2.2.2
Semantic Forms 3.4
Anyone have any helpful insights? As-is, our talk pages are completely unusable. Aerrin99 (talk) 00:33, 17 November 2015 (UTC)
- > Anyone have any helpful insights? As-is, our talk pages are completely unusable
- Because we expect either a NULL or a page object and not a boolean (true, false) as value according to [0].
- Please open an issue with [1] and in the meantime you could try removing the type check [2] (change from "Page &$article = null" to "&$article = null").
- [0] https://github.com/wikimedia/mediawiki/blob/0a90e7ca653e1dae86887d8c454069015a725dd2/includes/page/Article.php#L121
- [1] https://github.com/SemanticMediaWiki/SemanticMediaWiki
- [2] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/fd777541ce0f455f6ae5c7774a66850fd1dcbcd9/src/MediaWiki/Hooks/ArticleFromTitle.php#L39
- Cheers James Hong Kong (talk) 00:46, 17 November 2015 (UTC)
SMW 2.3 and #ask format=template
SMW 2.3 has a problem with the mw:Extension:NamespaceHTML. I use query {{#ask: ...|format=template|template=SomeTemplate}}. The 'Template:SomeTemplate' transcludes a page 'HTML:SomePage' (from HTML namespace). SMW 2.2 accomplishes this correctly. In SMW 2.3 HTML-namespace flag is lost and the HTML-code is prohibited. How can this be overcome? StasR (talk) 20:00, 28 November 2015 (UTC)
- I suspect this relates to [0] which has been fixed and will be released with 2.3.1.
- Cheers
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/1255 James Hong Kong (talk) 09:01, 29 November 2015 (UTC)
SMW and ShortUrl
Is it possible to fix the incompatibility of SMW and mw:Extension:ShortUrl? This is a very simple extension, but extremely useful for non-Latin wikis. It works fine, but only in the absence of SMW. When SMW is installed: if I turn ShortUrl, all SMW special pages disappear from the list.
It is an old issue, at least since SMW 2.1 StasR (talk) 10:29, 29 November 2015 (UTC)
Expired Security Certificate
It seems the site's security certificate expired on 11/8/2015 7:11 AM. Are there plans to renew it? All the embedded SMW links point here with https. Alianin (talk) 19:44, 8 December 2015 (UTC)
Product database
Hi, we use MW as a source for basic information about our products in our company for internal use. Recently I have been asked, whether it is possible to return some information from the Wiki using some API. As it would be difficult to parse the source text and extract the info, I'm thinking about using the SMW.
Today the structure of our wiki pages is as follows:
- Each product is described in a separate page (there are also pages not directly related to individual products)
- Products are categorized
- Products can consists of other products (such as CPU board in rack based system) via links
- Each product has one or more model variants. The variants are described via a table where rows are models and columns are attributes. The attributes are usually number or availability of an interface, display resolution, redundancy support, etc. The table is created via a template.
My idea is to move some important information about the product from the plain text into SMW attributes. However I'm not sure, how to go with the model variants. I would like to avoid creating of individual pages for every model variant. Also the model variants are named using a slash and letter (product/A, product/B), which collides with MW sub-pages.
I would be thankful for any idea. Kalas (talk) 16:23, 4 January 2016 (UTC)
- > I would like to avoid creating of individual pages for every model variant. Also the model variants are named using a slash and letter (product/A, product/B), which collides with MW sub-pages.
- [0] should give you an idea how to accomplish this. Feel free to use the sandbox and adjust the example.
- [0] http://sandbox.semantic-mediawiki.org/wiki/Product_A
- Cheers James Hong Kong (talk) 19:19, 4 January 2016 (UTC)
- Thanks for the example! It looks so simple :-)
- I have noticed that attribute names like in your demo are "Has component of", "Is product variant of", "Has description" e.g. long names using "Is", "Has". etc. What is the idea or requirement behind?
- Our Wiki pages are in Czech. We often tend to use English in source code as sometimes we have to provide it to our customers and Czech is difficult to understand for foreigners and English is universal. This is not the case, but I always have in mind someday can change it. Do you recommend to use English for SMW or is there a way for multilanguage attributes? Kalas (talk) 08:53, 5 January 2016 (UTC)
- > I have noticed that attribute names like in your demo are "Has component of", "Is product variant of", "Has description" e.g. long names using "Is", "Has". etc. What is the idea or requirement behind?
- Help:Property naming should help to explain the idea of the naming convention and for a quick introduction to SMW, see Help:Getting started.
- > Do you recommend to use English for SMW or is there a way for multilanguage attributes?
- It depends on your use case but in future we hope to support labels in different languages with work currently under way [0] which could look similar to [1].
- I've just created Localization and multilingual content to collect requirements and ideas on how to make this topic more actionable.
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/1344
- [1] https://www.youtube.com/watch?v=jcau-ZA_uYc James Hong Kong (talk) 15:42, 5 January 2016 (UTC)
I have successfully installed new MW 1.26 and SMW extension. Now I'm doing tests and thinking how to specify the properties of product and its variants, best if I do not need to repeat them.
For example we have a product A:
- CPU: MPC5200B
- LCD size: 10.4"
- LCD resolution: 640x480 or 800x600
- RAM memory: 256MB
- MRAM memory: 1MB
- Interfaces: Ethernet, USB, video in, audio out
Product A variant /A:
- LCD resolution: 640x480
- Interfaces: 3x Ethernet, 2x USB, 0x video in, 0x audio out
Product A variant /B:
- LCD resolution: 800x600
- Interfaces: 1x Ethernet, 1x USB, 1x video in, 1x audio out
You see there are attributes that are common to all variants, but there are attributes that are different for each variant.
I would like to be able to find:
- all products that have LCD, resolution (at least) 800x600 and Ethernet and USB interfaces
- will find "Product A"
- all product variants that have LCD, resolution (at least) 800x600 and Ethernet and USB interfaces
- will find "Product A/B"
- all products that have LCD and at least 2xEthernet and 1xUSB interfaces
- will find "Product A"
- all product variants that have LCD and at least 2xEthernet and 1xUSB interfaces
- will find "Product A/A"
Actually the last two should satisfy our needs, as the search 1 and 2 is a subset.
I'm in doubt, how to specify the product "has interface" and how to specify the interface count. Also how to share the attributes between the product and its variants so I do not need to specify for example the changing attributes for product and the common attributes for variants.
I could do
[[Has interface:Ethernet]] [[Has interface:USB]]
or
[[Has Ethernet interfaces:3]] [[Has USB interfaces:2]]
Last but not least, on the product page I have now a table showing all variants and the available interfaces. The table shows, which exact interfaces are available: If there are 3 Ethernet ports, there are connectors labeled as ETH-1, ETH-2 and ETH-3. E.g. product variant A can offer ETH-1, ETH-2 and ETH-3 whilst variant B only ETH-2. This is than visualised in 3 columns - and each variant has either + or - if the interface is available or not. Not sure how to store and show this info using SMW.
I would be thankful for any tips. Kalas (talk) 09:56, 3 February 2016 (UTC)
- I would point you to example [0, 1].
- I'd prefer the record type for a truth or count matrix, similar on how [2, 3] is modeled which avoids having to create properties for every combination and apply constraints on values instead to permit certain values.
- The data model maybe a bit difficult to understand at first but I hope [0, 1] can shed some light.
- [0] http://sandbox.semantic-mediawiki.org/wiki/Intel_8%E2%88%9516_LAN_Adapter
- [1] http://sandbox.semantic-mediawiki.org/wiki/Product/A
- [2] http://sandbox.semantic-mediawiki.org/wiki/Property:Ethernet_device_classification
- [3] http://sandbox.semantic-mediawiki.org/wiki/Property:Has_interface_device_name James Hong Kong (talk) 13:31, 3 February 2016 (UTC)
- I'm still not sure how to design the subobjects holding the individual variants. Actually I have not yet found an way to visualize the values of the record datatype as I would like.
- However my question is different now. Have to be defined all properties of a subobject using the {{#subobject so1 |...}} tag or is there a way to add additional values later on? I tried adding second {{#subobject so1 |}}, but saving the page resulted in a critical error of MWException type. Kalas (talk) 09:33, 5 February 2016 (UTC)
> I'm still not sure how to design the subobjects holding the individual variants. Actually I have not yet found an way to visualize the values of the record datatype as I would like
There are always different ways to accomplish things, in the given example I used to declare subobjects to represent a product variation that relates to a subject (lets called the super product).
In my understanding, products and each different variations of it would represent a different entity and are therefore distinguishable from the rest hence can be queried individually.
> However my question is different now. Have to be defined all properties of a subobject using the {{#subobject so1 |...}} tag or is there a way to add additional values later on?
Using #subobject to be declared within a wiki-page (== subject) and having {{#subobject:ABC declared on top of the page and later on within the same page you try the extend #subobject:ABC that is not possible because, SMW only sees a page in its entirety. (This not completely true for named subobjects but the would stretch this thread)
Further more, declaring a #subobject:ABC on Page A and declaring a #subobject:ABC and Page B are two totally different entities that can be linked to each other but do not represent the same thing (or knowledge, or data, or fact). Remember that we interpret a data by Subject A (== Page A) posses an object value (property value) described by an attribute (the property itself), so that it reads as "A has something of X value".
As named subobject, Page A + #subobject:ABC|has something of=Foo !== Page B + #subobject:ABC|has something of=Foo
As anonymous (or hashed) subobject, Page A + #subobject: |has something of=Foo !== Page B + #subobject: |has something of=Foo
> I tried adding second {{#subobject so1 |}}, but saving the page resulted in a critical error of MWException type.
I would be interested to see what sort of issue you encountered together with a stack trace.
PS: Don't try to build Rome in a day, finding the right data model may take some time but with more practice (just use the sandbox) things should get clearer.
- Build a simple product without variations, query its component and understand what can and cannot be done.
- Build the same simple product but this time using the #subobject and query it.
- ... James Hong Kong (talk) 14:22, 5 February 2016 (UTC)
- Thanks again for your detailed description and help. Exactly as you have suggested, I'm now researching what SMW can and what data model is best to use to solve my product catalogue. For that I'm using both SMW sandbox and my own sandbox installation. I think that defining product attributes is pretty clear for me now but I'm still not happy with the product variants. I try to make it as simple as possible, so I tend to use templates to add and display data.
- I know that subobjects defined in different pages will create different entities even they have same name. Anyway I was interested, if it would be possible to add more information to subobject on the SAME PAGE using second, third etc. subobject with the same name. Exactly the same way I can add attributes using #set. I have just tried it on SMW sandbox and it seems to work :-) Maybe there is some improvement over SMW 2.3.1 I'm using.
- Additionally I tried subproperty and it does not seem to work - please look at the demo [[7]]
- Thanks! Kalas (talk) 08:34, 8 February 2016 (UTC)
Talk/Discussion Pages
I have a basic question that I haven't read yet...How do I get the talk pages to produce like the ones on here? I've added Template: Talk page, and I have Semantic Form up and running,
I'm guessing I have to do something with properties and classes, but haven't figured it out yet!
Thank you,
Reziun Reziun (talk) 03:51, 10 February 2016 (UTC)
- Hi Reziun,
- The way the talk pages are set up has nothing to do with SMW or Semantic Forms. This site makes use of the LiquidThreads extension (v2.2 alpha). I'm not sure I could recommend it to you because it is no longer very actively maintained, but then as you can see, it's working alright. Cavila (talk) 08:14, 10 February 2016 (UTC)
Is it possible to specify and obtain another pages properties in a query results table?
Hi.
As I'm still researching SMW facilities, I've requested a test account in the SMW sandbox. The main interest for me is binding pages using the Has page property. I've managed to make it work using subqueries, but I have no idea how to make it work for tabular views generating a simple report.
As of March 7, 2016 my test page looks pretty cool for inline queries since I can "dive" through multiple pages using a query per a required page. (All of the objects are split into separate pages) But would it work for tables? Perhaps it's better to ask it as: "can I use multiple subqueries in a single query depending on the main label somehow?". There's a table and I'm aware of displaying "directly on page" properties only (Has text in my case). What I would like to achieve is
Venue
City
Country
HaloTestHeinekenMusicHall
Heineken Music Hall
Amsterdam
Netherlands
but I'm only able to get:
Venue
HaloTestHeinekenMusicHall
Heineken Music Hall
using this query: {{#ask: [[Has text::Heineken Music Hall]] | ?Has text = Venue | format = table}}. Still have no idea even how to fetch the city.
Is it possible to display properties of referenced pages per a single row in query result tabular representation? Could anyone review/suggest whether I'm doing it right?
- Oops, maybe it's better to ask it at Help talk:Selecting pages? Halo (talk) 09:57, 7 March 2016 (UTC)
As far as I understand, this is not possible in Semantic MediaWiki directly, however it can be worked around. In short, the template format is required, and here it is:
{{#ask: [[Category:Live events]]
| ?Self date = Date
| ?Ref venue = Venue
| mainlabel = -
| format = template
| template = Row:Live events table
| named args = yes
}}
The Template:Row:Live events table template is as follows:
<includeonly><!--
-->{{#vardefine: DATE | {{{?Date}}}}}<!--
-->{{#vardefine: VENUE | {{{?Venue}}}}}<!--
-->{{#vardefine: CITY | {{SHOW_REF|{{#var: VENUE}}|?Ref city}}}}<!--
-->{{#vardefine: COUNTRY | {{SHOW_REF|{{#var: CITY}}|?Ref country}}}}<!--
-->{{#vardefine: CONTINENT | {{SHOW_REF|{{#var: COUNTRY}}|?Ref continent}}}}<!--
-->{{#var: DATE}}, {{#var: VENUE}}, {{#var: CITY}}, {{#var: COUNTRY}} {{#var: FLAG}}, {{#var: CONTINENT}}<br/><!--
--></includeonly>
In the template above I use named arguments for easiness. However, I use #vardefine and #var to store and retrieve some data from the current row. Also I use two auxiliary templates: SHOW SELF and SHOW REF to simplify data extraction. The first template, SHOW SELF, is just a shortcut:
<includeonly>{{#show: {{FULLPAGENAME}} | {{{1|}}}}}</includeonly>
to extract a property for the current page. The second template called SHOW REF simplifies data extraction for the given page, not the current one:
<includeonly>{{#show: {{PARSE_SMW_PAGE | {{{1|}}} }} | {{{2|}}}}}</includeonly>
And yes, the PARSE SMW PAGE just strips left and right brackets, and optional leading colon:
<includeonly>{{#explode:
{{#sub: {{{1}}} | {{#ifeq: {{#pos: {{{1}}} | [:}} | 1 | 3 | 2 }} | -2 }}
| {{!}}
}}</includeonly>
So I managed to crawl the following page relationships:
- This is surely a more elaborate example on how to use the template output and it would be nice if you could try to remodel this in a way that it would not require #vardefine/#sub (as we cannot use this in our test environment) so that we can convert this example into something like [0].
- Examples like [0] are run by our test environment and help use to ensure that releases or developments don't break codified examples by running them as Integration tests.
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/Integration/ByJsonScript/Fixtures/p-0203.json James Hong Kong (talk) 10:15, 11 March 2016 (UTC)
- Honestly I don't understand what context you're referring... However I'm not sure if it can be remodelled since I use the variables to hold intermediate data that's supposed to be propagated for "deeper" queries and templates to simplify some SMW aspects. Halo (talk) 16:48, 11 March 2016 (UTC)
- > Honestly I don't understand what context you're referring
- Well, the context is that the more we can include use cases such as yours in our integration test repository the more we are able to ensure that those will work in future.
- > However I'm not sure if it can be remodelled since I use the variables to hold intermediate data
- In this case, never mind. We can only work with examples that don't introduce extra inter-dependencies (we have no direct control over #var etc. therefore it cannot be used in our tests). James Hong Kong (talk) 17:13, 11 March 2016 (UTC)
- Would SMW ever support such a scenario out of box let's say that it won't ever require such a heavy and hard to understand template scenario as mine? Probably something being able to "peek deeper" across several pages? Or, as I asked in the question, I'm abusing the SMW facilities? Halo (talk) 17:50, 11 March 2016 (UTC)
- > Would SMW ever support such a scenario out of box let's say that it won't ever require such a heavy and hard to understand template scenario as mine?
- I really haven't looked at what your doing but of course the template format is given to users to do things that are generally hard to commodities because any special handling comes at the cost of extra code, maintenance, and possible errors that have not been uncovered by the time a feature is introduced.
- > Probably something being able to "peek deeper" across several pages?
- One would need a compelling use case that is generalizable together with a clear guideline of what a "peek deeper" across several pages entails without introducing a performance bottleneck.
- I don't know whether resolving a property chain on a printrequest (|?Foo.Bar.Foobar) would be worthwhile considering or not.
- > I'm abusing the SMW facilities?
- Well, I have seen worse ;-) but of course sometimes one should think about what kind of data are stored and where. It can be easier to store the output of a template as property value and use this as starting point instead of doing everything ad hoc and dynamic. James Hong Kong (talk) 18:08, 11 March 2016 (UTC)
- > I don't know whether resolving a property chain on a printrequest (|?Foo.Bar.Foobar) would be worthwhile considering or not.
- Oh, I would really love to use it but I failed to get the expected result no matter what I tried to do. I always got an empty value, and that's why I could not find any other way rather than templates. I would really love to get rid of my ugly templates. :( I've just tried the following:
- [[Category:Live events]]
- ?Self date - works great, displays the event date plain text.
- ?Ref venue - works great, displays the event venue link
- ?Ref venue.Self name - empty, the event venue name expected
- ?Ref venue.Ref city - empty, the event venue city link expected
- ?Ref venue.Ref city.Self name - empty, the event venue city name expected
- Also I noticed that the generated table suggests unknown properties in the table header cells: Ref venue.Self name, Ref venue.Ref city, and Ref venue.Ref city.Self name. It looks like it does not make a property chain. I do believe it must work as you suggested, but I'm probably blind to see a very obvious thing. Halo (talk) 21:56, 11 March 2016 (UTC)
- > considering or not.
- "... considering or not." was meant on context of "to be implemented". A property chain on printrequest is currently not supported in core and would need to be developed and as it stance I'm busy with other things so this isn't on my list. James Hong Kong (talk) 09:41, 12 March 2016 (UTC)
Help:Incoming format
Hopefully, it's just a temporary glitch, but at the moment, I cannot access Help:Incoming format. Cavila (talk) 15:54, 30 March 2016 (UTC)
- The problem has something to do with {{#smwdoc:incoming}}, which causes the page to black out. Cavila (talk) 15:58, 30 March 2016 (UTC)
- Thanks for mentioning! I added issue 1484. Cheers [[kgh]] (talk) 17:30, 30 March 2016 (UTC)
Could anyone explain unexpected behavior please?
Recently I have finally found this gem: http://sandbox.semantic-mediawiki.org/w/index.php?title=Utilisateur:Cavila/previous_and_next&oldid=2336 - this page describes a nice example of getting previos and next pages against a certain query. And it would be very nice to introduce it to my wiki I'm currently developing. For example, I have 4 pages:
- Live event:2012/05/26
- Live event:2012/07/14
- Live event:2012/12/03
- Live event:2012/12/21
Each page above is categorized as [[Category:Live events]]. So the following query works perfect: [[Category:Live events]] returning all 4 pages.
However, if I add another greater-than predicate specifying a certain page, [[Category:Live events]] [[>Live event:2012/03/03]], I get a syntax error:
Some part "<nowiki>...</nowiki>" of the query was not understood
I'm really confused on:
- how the
<nowiki> token got there
- where the ellipsis came from
Not sure if it's possible to escape it somehow, and initially I thought that < or > might the reason of the issue. So I also tried !: [[Category:Live events]] [[!Live event:2012/03/03]] -- that simply gives nothing, and not three pages as it was expected.
If it would help:
- I'm using SMW 2.3.1, however the current SMW sandbox version is 2.4-alpha (68d3701)
Live event is a wiki namespace
Has 2.4 something new that allows these queries to run? At least, the only place I found it described was a personal page of User:Cavila I provided above (or I'm blind to see it in the official documentation).
Thank you in advance. Halo (talk) 10:09, 21 April 2016 (UTC)
- > Has 2.4 something new that allows these queries to run? At least, the only place I found it described was a personal page of User:Cavila I provided above (or I'm blind to see it in the official documentation).
- https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/RELEASE-NOTES.md#new-features-and-enhancements
- https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/1291 James Hong Kong (talk) 10:59, 21 April 2016 (UTC)
Illegal property values + sorting
Just a couple of short questions:
- Can SMW support "partial dates"? Let's say, I would like to make an event article with date set to
1990-01-xx as I'm still not sure what the correct date is, effectively read as "just January 1990". Is there any workaround to use it in SMW? (Maybe "Allows pattern" but with date-semantics, not text, somehow?)
- My "partial dates" lead to errors marked with exclamation marks, and that's fully clear why. However, would it be possible not to exclude broken pages from the
#ask result refined with | sort = Has date?
- Indeed, currently only things shown on the help page for datatype date are possible so this would be a feature request. Probably you could recreate an example setup at sandbox.semantic-mediawiki.org and link to this when creating and elaborating the feature request at github.com. Personally I cannot assess if it will be possible to support partial dates such as year-month or month-day.
- Perhaps you could additionally set some kind of "helper" property which is automatically set in a way that it allows sorting, e.g. a property of type text: So a date like January 1, 2016 could be 20160101 or January 1990 would be 19900100 etc. and sorted accordingly afterwards. [[kgh]] (talk) 17:02, 27 April 2016 (UTC)
- > still not sure what the correct date is, effectively read as "just January 1990". Is there any workaround to use it in
- I'm not sure what the problem is but annotations like
Jan 1990 are supported, please have a look at [0].
- Of course
1990-01-xx is not supported because the parser doesn't know how -xx should be interpret and I'm not entirely sure to have the parser in future to assume that it means Jan 1990.
- [0] http://sandbox.semantic-mediawiki.org/wiki/Partial_dates James Hong Kong (talk) 19:12, 27 April 2016 (UTC)
- Oops, that's news to me. Did not know that this was working though admittedly a couple of years passed since I had a more intense peep at something like this. Great! [[kgh]] (talk) 19:24, 27 April 2016 (UTC)
- > I'm not sure what the problem is
- Me and my inattention... Reading the official documentation always helps, and I'm very sorry for being not careful reading it. Thank you very much! Also I noticed that for some reason I used
Has type::Text instead of Has type::Date for one my properties whilst the rest were and are well-typed. Fixed it locally.
- P.S. It looks like
YYYY-MM can work as well thus I need neither xx nor 00. That's awesome! Halo (talk) 08:55, 28 April 2016 (UTC)
How to escape links in properties
Hi,
I would like to set and show a property that contains internal links (i.e. a description containing links to other pages). This however does not work for in-text annotations and the {{#set}} does not show the value. How to do it? Kalas (talk) 14:30, 27 April 2016 (UTC)
- I guess you are looking for the $smwgLinksInValues configuration parameter. [[kgh]] (talk) 16:45, 27 April 2016 (UTC)
- > {{#set}} does not show the value. How to do it?
- [0, 1, 2] contains some examples that shows how #set can be used to display values with the help of a template.
- [0] http://sandbox.semantic-mediawiki.org/w/index.php?title=Template:Human
- [1] https://www.semantic-mediawiki.org/wiki/Examples/Parser/Text_that_includes_other_annotations
- [2] https://www.semantic-mediawiki.org/wiki/Help:Setting_values#Template_parameter James Hong Kong (talk) 18:54, 27 April 2016 (UTC)
Link to Tips on main page
Hello, could we not have the tips on the main page? I was thinking under "Usage". For readers and contributors a good idea to promote them, I was thinking. It's a lovely format, are there ideas to expand/sort those? Sabine Melnicki (talk) 16:39, 1 June 2016 (UTC)
- Heiya Zabien, actually the link is already on main page but in the "User Community" section. Since we cannot have enough of it I also place it in the "Usage" section. Cheers [[kgh]] (talk) 16:54, 1 June 2016 (UTC)
- Ah, was blind there! Hidden under support! Like it better where it is now, though! Superb, thanks! – As I am at it: Would the "Community portal" not be missing in the User Community list, too? I know this is redundant with the sidebar, but so are other links... Sabine Melnicki (talk) 16:58, 1 June 2016 (UTC)
#github exception
I just noticed that the #github parser (from the Github extension) is currently throwing exceptions. See Sorting for an example.
Exception encountered, of type "FileFetcher\FileFetchingException"
[80edb86c] /wiki/Help:Sorting FileFetcher\FileFetchingException from line 30 of /.../w/vendor/jeroen/file-fetcher/src/SimpleFileFetcher.php: Could not fetch file: https://cdn.rawgit.com/SemanticMediaWiki/SemanticMediaWiki/master/issues/902
Backtrace:
#0 /.../w/vendor/jeroen/file-fetcher/src/CachingFileFetcher.php(44): FileFetcher\SimpleFileFetcher->fetchFile(string)
#1 /.../w/vendor/jeroen/file-fetcher/src/CachingFileFetcher.php(37): FileFetcher\CachingFileFetcher->retrieveAndCacheFile(string)
#2 /.../w/vendor/jeroen/mediawiki-github/src/GitHubParserHook.php(58): FileFetcher\CachingFileFetcher->fetchFile(string)
#3 /.../w/vendor/jeroen/mediawiki-github/src/GitHubParserHook.php(48): GitHub\GitHubParserHook->getFileContent()
#4 /.../w/vendor/jeroen/mediawiki-github/src/GitHubParserHook.php(36): GitHub\GitHubParserHook->getRenderedContent()
#5 /.../w/vendor/mediawiki/parser-hooks/src/FunctionRunner.php(49): GitHub\GitHubParserHook->handle(Parser, ParamProcessor\ProcessingResult)
#6 /.../w/vendor/mediawiki/parser-hooks/src/HookRegistrant.php(45): ParserHooks\FunctionRunner->run(Parser, array, PPTemplateFrame_DOM)
#7 [internal function]: ParserHooks\HookRegistrant->ParserHooks\{closure}(Parser, PPTemplateFrame_DOM, array)
Heiya Cavila, thanks for finding. I just opened issue 4 on GitHub for this. Also I removed the offending lines from the page:
** {{github|issues/902|title=#902: Extend sort/order options for query / queryresults}}
** {{github|issues/874|title=#874: Do not filter when asked to sort}}
** {{github|issues/1045|title=#1045: Feature request: parameter for custom collation algorithm in query}}
Please add Greek flag to MediaWiki:Common.css
I've just translated Main Page to Greek language (el): Σημασιολογικό MediaWiki
and also uploaded Greek flag:
Can someone please add:
span.lang-el {
padding-right: 25px;
background: url(images/5/5d/Lang-el.png) center right no-repeat;
}
to MediaWiki:Common.css so as for the flag to show on the language template?
Or maybe give me the appropriate rights to do it myself.
Thanks! Ioannis Protonotarios (talk) 17:23, 28 January 2017 (UTC)
Permission for content translation
Hi there
The translation app ( semantic-mediawiki.org:Translating content ) took me to Creating semantic-mediawiki.org:Translator when I asked permission to begin translating.
Sorry, I do not know what I am expected to do.
Translating spanish: Should we use "usted" or "tu"?
Hi there
I am working on translation here. Spanish.
I wonder if there are any best practices stablished for the use of "tu" or "usted".
Any ideas o criteria?
- I actually to not know what "tu" or "usted" mean. If this refers to formal or informal versions of the English word "you" when use whatever is generally more appropriate in Spanish regarding this websites audience. I trust that you will make the best choice. :) [[kgh]] (talk) 19:35, 12 March 2017 (UTC)
Link from start page to spinoff extensions
Why not link to Semantic MediaWiki extensions (and MediaWiki extensions) from the text "spinoff extensions" (on the start page)? Just a suggestion. Sabine Melnicki (talk) 15:48, 6 November 2017 (UTC)
Translate to Spanish
Hi everyone!
I am always reading the documentation and I have been able to check that it isn't in Spanish mostly. I like very much to help with translations and, in this case, I think I can collaborate with this project in this way.
Many pages there isn't marked for translations, so I need the permissions to make it. Then I would translate each page that I marked.
If you need to check that I know how works the translation tools of MediaWiki, you can check my contributions in the translations namespace of Wikidata.
I await your answer!
Regards, Iván Hernández-Cazorla (talk) 17:28, 9 December 2017 (CET)
- Thanks a lot for wanting to contribute translations. I just made you a translator. There are still quite a lot of messages marked for translation which are not translated (see the stats for es). The reason why a lot of pages are not marked for translation is that the docu is currently being reworked completely. However datatypes and configuration parameters are mostly ready to go. So I will prioritize creating the translation template. After that was done you could work your way through them if you like. [[kgh]] (talk) 17:01, 9 December 2017 (UTC)
- One thing that is even more a priority is to translate the system messages. There are still a lot to be done on translatewiki.net. See here. Moreover related semantic extensions are lacking translations, too. Doing them will be very much appreciated, too. [[kgh]] (talk) 17:06, 9 December 2017 (UTC)
- Hi User:kghbln!
- Thank you to you for granted me the permissions! Yes, there is a lot of pages marked for translations but no translated. I check and translate it bit by bit as the time allows me. I am agree with your way to work, I will prioritize the translation template and the pages marked. If I check some page that could be marked and translated because possibly it will never have important changes, I will do it too.
- About the system messages, all right. I will try to help with that too. One doubt about semantic extensions, is there any centralized website in which I can work its translations? Or, have I check for each case?
- Ah! Excuse me for the double signature in my last messages. I usually write in the Wikipedia talk pages, where is not able any system like this or Flow yet.
- Regards Iván Hernández-Cazorla (talk) 17:08, 10 December 2017 (UTC)
- Hi Ivanhercaz,
- thanks a lot for you effort. You approach sounds reasonable. Indeed, pages already marked for translation are priority. In case there is something to ask do so ...
- The individual semantic extensions for translating the system messages can be chosen from the dropdown menu on this page, so yes there is a centralized website to do so. This one uses the same translating system as this wiki and most of the other websites running MediaWiki.
- Do not worry about signatures. :) [[kgh]] (talk) 09:35, 12 December 2017 (UTC)
English error in the system messages
Hi everyone,
I am translating the system messages in Translatewiki.net to Spanish. During the translation I found an error in English that I want to share with you here to be fixed. It is not a serious error, only a typo error: catagorized, must be categorized.
If I find more errors, I will notice you here. If you prefer that I report it in the mailing list or wherever you think more appropiate, tell me and I will do it.
Regards Iván Hernández-Cazorla (talk) 21:39, 25 December 2017 (UTC)
- Thanks for reporting the typo. Apparently I have no idea where you found the typo. In case you cannot correct the typo yourself please also indicate the whereabouts of the typo. In case you are able to correct the typo yourself you are most welcome to do so. Thanks also for you effort on this wiki. [[kgh]] (talk) 19:24, 27 December 2017 (UTC)
- Ah, now I got it. Yeah, found the typo and fixed it. I will be great if you could specify the respective system message for faster detection. Thanks a lot for noticing! [[kgh]] (talk) 11:16, 28 December 2017 (UTC)
- Excuse me, kgh! I thought that I link where I found the typo error. Iván Hernández-Cazorla (talk) 20:35, 8 February 2018 (UTC)
Must I translate the internal links «Special:X/Y|X»?
Hi everyone,
I am translating and reviewing what it is already translated to Spanish in TranslateWiki. I continue translating but at this moment I have doubts with the internal links to the special pages. Must I have translate the internal links? An example:
- [[Special:Types/Date|type]] » [[Especial:Tipos/Fecha|tipo]]
I think the correct should be translate them, because each system have a language configured and because, at least in my SMW version (2.5.5) and in the case of the special pages for types, if the links are in English, the base page (Types/Tipos) is translated, but the subpage for each type is not translated, I mean, if you link to Special:Types/Date the URL will be Especial:Tipos/Date and the display title "Date", it doesn't redirect to Especial:Tipos/Fecha, however it exists. Maybe the English title could be a redirection and not the same page than the other language, I think to have the same content in both pages could be unnecessary use of resources, when the only difference is the display title.
In TranslateWiki I have translated some of this links because I checked in my SMW local installation that it works fine, but in some cases I have not translated because I receive a warning notice that says literally "Following link is missing: [[Special:Types/Boolean|type]]".
What is the correct way to translate this internal links? What do you think about my proposal about the dual names? I only have experimented this with the Special:Types/*, so I have to review the rest of the translation.
Thanks in advance for your help!
Regards Iván Hernández-Cazorla (talk) 23:53, 9 February 2018 (UTC)
- Here you have an example for the first example that I gave (Special:Types/*). I forgot to share a string as example in the post, excuse me.
- Regards Iván Hernández-Cazorla (talk) 00:56, 10 February 2018 (UTC)
- Thanks a lot for bringing this up and remind me of a task I should have done long ago! Shame on me! The links should indeed be translated too for best experience. Translatewiki.net configuration has to be changed to stop the link checks you are referring to and thus allowing to translate. I will author the change and give you a note here as soon as it is doen. [[kgh]] (talk) 18:43, 10 February 2018 (UTC)
- I have now authored the configuration change. From experience this should not take long to be merged. [[kgh]] (talk) 19:45, 10 February 2018 (UTC)
- Oh, it seems that I reply to you practically at the same time you post your note. Fine! When it will be updated, I will make the respective changes.
- Thanks a lot! Iván Hernández-Cazorla (talk) 19:51, 10 February 2018 (UTC)
- Don't worry, Karsten! There is many things to do and it is normal that we forgive something and enter in a loop of oversight things hehe, it also happens to me. Just a note, it also should change too in the strings in which is
[[Property:*]] or similar links.
- All right, I will be awaiting for your note here. Don't be hurried! Iván Hernández-Cazorla (talk) 19:49, 10 February 2018 (UTC)
- Yeah, included them at the same time. :) [[kgh]] (talk) 21:19, 10 February 2018 (UTC)
- Karsten, I checked if it was merged successfully and yes, it was merged, but in TranslateWiki there is errors yet. I made a Ctrl + Shif + R, but the errors persist.
- Regards Iván Hernández-Cazorla (talk) 17:30, 14 February 2018 (UTC)
- You need to allow some time for the merged settings to roll in. This is why I have not yet notified you. I believe everything should be fluffy now. :) [[kgh]] (talk) 23:50, 14 February 2018 (UTC)
- Oh, I was desperate to check the change hehe, excuse me! Yes, not it is fine and it doesn't detect as fail the correct format. I already translated all the SMW's strings, so tomorrow I will try to begin to review all the Spanish translation, because I have detected errors that have to be fixed, some of them are not very alarming, but there are another that have to be fixed until of the release of SMW 3.0. I am expecting the release, I want to do the best as possible, and what I can, to collaborate and improve SMW :). Iván Hernández-Cazorla (talk) 02:09, 15 February 2018 (UTC)
- That's the spirit! :) Thanks a lot for your involvement! [[kgh]] (talk) 08:50, 15 February 2018 (UTC)
- What just comes to my mind: Never ever change the link [[Special:Types/Date|type]] to [[Especial:Tipos/Fecha|tipo]] because in this case everything breaks for people that use Spanish on a non Spanish wiki. You can only do [[Special:Types/Date|tipo]]. I think that adding an alternate label was possible before so disabling the link check was a pretty bad idea since it will do more harm than good. [[kgh]] (talk) 09:38, 1 March 2018 (UTC)
- Oh, true... Excuse me, Karsten. I will fix it in TranslateWiki. I will notice you. I am busy now, but I will do it and the Twitter issues soon.
- Regards Iván Hernández-Cazorla (talk) 14:07, 2 March 2018 (UTC)
- Well I did not think of this either. No big deal but the links should remain canonical. I could have figured this out earlier, too. Still I understand why you originally asked for this. (related discussion for further reference) [[kgh]] (talk) 16:53, 2 March 2018 (UTC)
Meaning of "prehistoric" in the context of datatypes
Hi everyone,
Today I am nosy hehe. Translating SMW I have another doubt, in addition to my last thread opened. The string in question is:
- "Unable to interpret a prehistoric "$1" input value. For example, having specified more than years or a calendar model may return unexpected results in a prehistoric context" (link to TranslateWiki).
I would like to know what is the meaning of "prehistoric" in this case to know if I translated it fine, or if there is another word in Spanish for that sense. In Spanish, "prehistoric" is "prehistórico/a" and has two meanings:
- Part of or related with a period studied by the Prehistory.
- Antiquated, old.
If "prehistoric" in the context of a datatype refers to antiquated or old, in Spanish I suggest to use "anticuado". Is it refers to any of those meanings?
Thanks in advance!
Regards Iván Hernández-Cazorla (talk) 02:11, 10 February 2018 (UTC)
- > I would like to know what is the meaning of "prehistoric"
- Please see [0], hope this clarifies the context.
- [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/includes/dataitems/SMW_DI_Time.php#L37-L41 James Hong Kong (talk) 11:42, 10 February 2018 (UTC)
- Surly ante-diluvian dates. :) I just expanded the message docu. Thanks for asking! [[kgh]] (talk) 13:15, 10 February 2018 (UTC)
- Thank you, mwjames and Karsten Hoffmeyer! Now I have clear the concept. I added a specification with the year from which a context is considered "prehistoric", I say in a parentheses at the end of the sentence "previous to year 10000", in Spanish "anterior al año 10000". Although as historian I could debate it hahaha. It is a joke, I understand that it is a concept to understand this limitation.
- Regards Iván Hernández-Cazorla (talk) 15:51, 10 February 2018 (UTC)
Survey Portal
- Wow. What a downer, although not completely unexpected I must say.
- For ones I made the general exception to fill in some survey. In this case the SMW survey (
link at top of this page(Removed, until re-added))
- So I filled in the questions (nothing general good toward SMW's documentation or communications levels).
- And after that I hit the save button on the survey form.
- ... nothing seemed to happen.
- ... maybe I miss clicked. So I click it again.
- ... still nothing that re-samples some action feedback.
- ... 3th time is a charm of course. Still nothing ... ok, fine by me.
- Guess SMW is not aware of the general rule that proper feedback on an action is essential in letting the user(or whatever other system for that matter) know its action was detected.
- O well. I guess that was the last survey I ever spend my time on (for real, although I'm of course the only one that knows I'll truly stick to that.)
- ... Science is not the only area where bad apples generate some ripple effect (usually initiated by some butterfly flapping its wings). ... MvGulik (talk) 19:21, 26 February 2018 (UTC)
- I can understand your frustration and I am sorry for this. I was not aware that the survey offered was broken so thank you for reporting it. I now removed it until it was fixed to prevent others from running into the issue you experienced. [[kgh]] (talk) 20:54, 26 February 2018 (UTC)
Disabeling special properties?
Hi, I'm currently trying to get rid of special property "Has query", as my wiki generated hundreds of thousands of those for which I have no use, and making my semantic store very difficult to refresh. Any clue? Steph (talk) 13:52, 2 March 2018 (UTC)
- See $smwgQueryProfiler for how to do it. [[kgh]] (talk) 16:52, 2 March 2018 (UTC)
I've just started looking at Semantic Mediawiki. I'm an experienced Wikipedia editor and also have a lot of experience developing OWL ontologies in Protege. I'm looking at various tools for a project to create a semantic knowledge portal for a set of related topics in cognitive science for a non-profit. We have a budget so I could use a commercial tool, I'm looking at Pool Party and Open Calais as well. I'm pretty technical but more at the level of OWL and logic and editing Wikipedia rather than setting up and configuring servers. I'll have a team to do this eventually but right now I'm in the really early stages of evaluating various tool options so I want to do as much as I can to get a feel for SMW just using the Sandbox. I just wanted to give that as background. So my questions are: 1) How much can I do working in the Sandbox? I noticed some extensions that seem like they would be useful. Especially the extension to create custom forms but I'm sure there are others. The Forms extension is a zip download. Can I download that and use it with my Sandbox or can I only download that (and other extensions) into an environment where I have my own server? 2) I've heard a lot about Dublin Core and it seems like the right model to use for things like books, journal articles, videos, etc. to store all the metadata (authors, date created, publisher, etc.) about them. That seems like such a common possible requirement I was wondering is there any way to load a vocabulary for Dublin Core into my Sandbox environment (or do people recommend a different vocabulary or different way to store such metadata?) 3) As I said I've developed several ontologies in OWL using Protege and also using the Semantic Web Rule Language (SWRL). Ideally, I would like to develop an ontology and import it into my SMW environment. Is that possible? I'm guessing not from my preliminary look it seems like the number of OWL like capabilities that are supported is pretty small. Just inverses, subclasses, but not things like transitive properties, DL definitions for classes much less SWRL rules. It's not a deal killer if this isn't supported but I just wanted to double check to make sure I'm understanding things correctly. But even if I can't take advantage of SWRL I would still like to load OWL ontologies. Again wondering if that can be done with a Sandbox environment or if it requires I set up a server. MDeBellis (talk) 01:30, 13 March 2018 (UTC)
- > 1) How much can I do working in the Sandbox? I noticed some extensions that seem like they would be useful.
- Do you mean [0] or do you want to build your own sandbox? In the latter case you have to follow the installation instruction from SMW and any of the extension you want to use in addition.
- If you are unfamiliar with the technical management of MediaWiki but eager to evaluate whether SMW can provide the environment you are looking for or not then I would suggest you use [0] as test environment. We provide [0] for users who want to try out SMW or evaluate new features we develop with newer SMW releases therefore [0] runs with a higher version.
- > 2) I've heard a lot about Dublin Core and it seems like the right model to use for things like books, journal articles, videos, etc. to store all the metadata (authors, date created, publisher, etc.) about them. That seems like such a common possible requirement I was wondering is there any way to load a vocabulary for Dublin Core into my Sandbox environment
- Since we are rely on MediaWiki we have to account for the management of those data in certain ways (different from what you are use to in comparison to Protege). Importing vocabulary provides an introduction on how external vocabularies can be imported with [2, 3, 4, 5] containing some definition examples for the DC/FOAF/DWC namespace.
- > 3) As I said I've developed several ontologies in OWL using Protege and also using the Semantic Web Rule Language (SWRL). Ideally, I would like to develop an ontology and import it into my SMW environment. Is that possible?
- Depending on the features you used for the ontology, that should be possible except for SWRL related elements. See above about the importing of vocabularies.
- > Just inverses, subclasses, but not things like transitive properties, DL definitions for classes much less SWRL rules. It's not a deal killer if this isn't supported but I just wanted to double check to make sure I'm understanding things correctly.
- Yes, transitive properties are not supported as that would require a reasoner which is not part of SMW core. If you are using a SPARQL instance as query backend that you may query instances that rely on a reasoner [7] in connection with a selected triple store.
- > I would still like to load OWL ontologies. Again wondering if that can be done with a Sandbox environment
- As I said above, try using [0] first before starting your own server so that you can get a feel for the environment and see whether it fits your expectation or not.
- We deploy some standard vocabularies with each installation to make it easier for users to start reusing them where they see fit.
- I hope this answers some of your questions, in regards to SMW and while less directed towards ontologies and OWL, the following video playlist [8, 9] may give an insight as to what and how SMW works.
- > portal for a set of related topics in cognitive science for a non-profit. We have a budget so I could use a commercial tool, I'm looking at Pool Party and Open Calais as well. I'm pretty technical but more at the level of OWL and
- If the project somehow doesn't meet your expectation maybe you can tell us about those shortcomings so that we may take them into account for future refinements.
- [0] https://sandbox.semantic-mediawiki.org
- [1] https://sandbox.semantic-mediawiki.org/wiki/Sp%C3%A9cial:Version
- [2] https://www.semantic-mediawiki.org/wiki/Property:Dc:identifier
- [3] https://www.semantic-mediawiki.org/wiki/Property:Foaf:knows
- [4] https://sandbox.semantic-mediawiki.org/wiki/Attribut:Dwc:kingdom
- [5] https://terms.tdwg.org/wiki/dwc:kingdom
- [6] https://www.semantic-mediawiki.org/wiki/Help:Transitive_relationships
- [7] https://www.cs.ox.ac.uk/isg/people/yujiao.zhou/aaai2014/paper.pdf
- [8] https://www.youtube.com/playlist?list=PLIJ9eX-UsA5cQY7T0ZmLI2ASdea3ffrvG
- [9] https://www.youtube.com/edit?o=U&video_id=ZsNMFpNfUdE James Hong Kong (talk) 07:55, 17 March 2018 (UTC)
Extremely basic question about properties with multiple values
I feel like I'm missing something obvious here, but I do not understand how to select pages with #ask where a property with multiple values shouldn't have a certain value.
I'll just use the demo pages here for an example:
{{#ask: [[Located in::Europe]] [[Located in::!Europe]] }}It seems to me like this query should select nothing, but it it renders England, due to that page's "Located in" property having multiple values, both Europe and United Kingdom. (According to the definition of the ! operator, this is technically the expected behavior, i.e. England is a page that does have a value other than Europe for it's "Located in" property.)
So the use case I have is a property where the values do not even have a hierarchical relationship. For example, let's assume we have pages with a "Has colors" property that can have more than one value of red, green, blue, etc. How would I go about selecting pages that are not red? Blackice (talk) 19:45, 4 August 2018 (UTC)
- Ok, so it turns out that things are not so easy as they appear. Currently it depends on the data backend used which results you will be getting. The example page used uses the supplementary "SMWElasticStore" backend which will be available with SMW 3.0. Here you are getting the result as shown, whereas if you are using the "SMWSQLStore3" backend it indeed turns out that it is not possible this way. So you have to apply some tricks, e.g. adding a (hidden) category called e.g. "Has colors red" or better model a different data structure with using sub-properties like "Has colors red" both allowing for direct selection for querying. I must note that you do not necessarily have do set up this extra property as a sub-property. [[kgh]] (talk) 14:16, 7 August 2018 (UTC)
In the navigation menu (MediaWiki:Sidebar) is a link to MediaWiki, included under Users, Administrators and Developers. It links directly to the MediaWiki start page mediawiki.org. Besides being repetitive (3 times) I don't think it's good practice to lead away from the website in the main navigation, since it's surprising, unexpected and lacking context. Maybe a short subpage about MediaWiki including the link and added under General would work better? The same applies to a link to OSDA under General. Sabine Melnicki (talk) 10:47, 23 October 2018 (UTC)
- I did not see your post till now. Sorry for the delay in answering and thank you for your suggestions.
- > Besides being repetitive (3 times)
- I believe that if you know what you are there is a high chance that you will not have a look at the other menus. Spares us from providing a single menu with 20+ selection items.
- > I don't think it's good practice to lead away from the website in the main navigation
- I have never thought about this but you may very well be right. Just changed to internal landing pages before the people can head of to ... :) [[kgh]] (talk) 13:57, 13 November 2018 (UTC)
Request for permission
Please, give me permission for translation. </>Rul1902</> (talk) 03:47, 1 January 2019 (UTC)
Why <pre> nowrap?
The content of <pre> doesn't support wrap. Anything of the paragraph will be displayed in one line. Suggest adding pre{white-space:pre-wrap} to MediaWiki:common.css or so. (My English is poor.) SolidBlock (talk) 13:32, 9 November 2019 (UTC)
Install CodeMirror
That extension is very useful to me because I can distinguish if a text is inside a template, tag or not by means of the colors. Without it, I would have a hard time finding out if what I am looking for is a template, tag or link, especially if a page has a lot of content. No se (talk) 23:59, 4 December 2024 (UTC)