Semantic MediaWiki Community Portal

From semantic-mediawiki.org

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.

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

Declaring subcategory without entering the category page

Edited by another user.
Last edit: 18:09, 4 April 2018

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: catego1

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)18:31, 23 March 2015

Several related Newbie questions

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)03:30, 13 March 2018

> 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.

mwjames (talk)09:55, 17 March 2018

Thanks for that very detailed and informative reply. This is such an amazing resource.

MDeBellis (talk)22:24, 31 March 2018
 
 

Must I translate the internal links «Special:X/Y|X»?

Edited by author.
Last edit: 04:11, 10 February 2018

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

Ivanhercaz (talk)01:53, 10 February 2018

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

Ivanhercaz (talk)02:56, 10 February 2018

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)20:43, 10 February 2018

I have now authored the configuration change. From experience this should not take long to be merged.

[[kgh]] (talk)21:45, 10 February 2018

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!

Ivanhercaz (talk)21:51, 10 February 2018
 

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!

Ivanhercaz (talk)21:49, 10 February 2018

Yeah, included them at the same time. :)

[[kgh]] (talk)23:19, 10 February 2018

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

Ivanhercaz (talk)19:30, 14 February 2018
 
 
 
 
 

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)15:52, 2 March 2018

See $smwgQueryProfiler for how to do it.

[[kgh]] (talk)18:52, 2 March 2018

Worked! Thx a lot.

Steph (talk)21:02, 3 March 2018
 
 

Survey Portal

Edited by author.
Last edit: 02:18, 27 February 2018
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)21:21, 26 February 2018

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)22:54, 26 February 2018
 

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:

  1. Part of or related with a period studied by the Prehistory.
  2. 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

Ivanhercaz (talk)04:11, 10 February 2018

> 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

mwjames (talk)13:42, 10 February 2018

Surly ante-diluvian dates. :) I just expanded the message docu. Thanks for asking!

[[kgh]] (talk)15:15, 10 February 2018

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

Ivanhercaz (talk)17:51, 10 February 2018
 
 
 

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

Ivanhercaz (talk)23:39, 25 December 2017

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)21:24, 27 December 2017
 

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)13:16, 28 December 2017

Excuse me, kgh! I thought that I link where I found the typo error.

Ivanhercaz (talk)22:35, 8 February 2018

No worries. All is fine now. :)

[[kgh]] (talk)23:46, 8 February 2018
 
 
 

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, Ivanhercaz (talk) 17:28, 9 December 2017 (CET)

Ivanhercaz (talk)18:28, 9 December 2017

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)19:01, 9 December 2017

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)19:06, 9 December 2017

Hi Karsten Hoffmeyer!

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

Ivanhercaz (talk)19:08, 10 December 2017

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)11:35, 12 December 2017
 
 
 
 

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)17:48, 6 November 2017

Thanks for the suggestion, however I have the feeling that this should actually be do. However, I need to work on the respective page to make it better.

[[kgh]] (talk)01:26, 7 November 2017
 

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?

Thanks

Amglez (talk)21:14, 12 March 2017

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)21:35, 12 March 2017

Yes, that is.

Ok, thinking of my american readers I decided to choose the formal version. As this is an English resource it is dificult for me but I suppose it is better to be too polite than making anybody unconfortable.

Thanks a lot.

Amglez (talk)01:19, 13 March 2017

Good thinking. I agree. Thanks for you help!

[[kgh]] (talk)11:10, 13 March 2017
 
 
 

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.

Help?

Amglez (talk)14:23, 12 March 2017

Sure, you are now a translator. Now you should be able to use the translation feature. Thank you for your involvement! Cheers

[[kgh]] (talk)14:30, 12 March 2017
:-)
Amglez (talk)17:47, 12 March 2017
 
 

Please add Greek flag to MediaWiki:Common.css

I've just translated Main Page to Greek language (el): Σημασιολογικό MediaWiki and also uploaded Greek flag: Lang-el.png

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)19:23, 28 January 2017

Done!

[[kgh]] (talk)23:24, 30 January 2017
 

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 Template format.

Here is the code:

{{#ask: [[Category:City]] [[located in::Germany]]
              | format = template
              | template = Link
              | sep =  • 
              | link = none
}}.

Here is the result:

Main Page • Main Page • Main Page • Main Page • Main Page • Main Page

There should be a separator between the each value. That's not the case obviously. It seems to be a bug.

LIMAFOX76 (talk)17:05, 24 August 2015

`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/

mwjames (talk)18:14, 24 August 2015

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)22:18, 24 August 2015

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)11:34, 8 September 2015
 
 
 
 

#github exception

Edited by another user.
Last edit: 10:21, 11 July 2016

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)

etc, etc.

Cavila (talk)23:10, 10 July 2016

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}}
[[kgh]] (talk)10:21, 11 July 2016
 

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)18:39, 1 June 2016

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)18:54, 1 June 2016

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)18:58, 1 June 2016
 
 

Illegal property values + sorting

Edited by another user.
Last edit: 19:00, 27 April 2016

Just a couple of short questions:

  1. 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?)
  2. 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?

Thanks.

Halo (talk)10:02, 25 April 2016
  1. 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.
  2. 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)19:02, 27 April 2016
 

> 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

mwjames (talk)21:12, 27 April 2016

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)21:24, 27 April 2016
 

> 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)10:55, 28 April 2016
 
 

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)16:30, 27 April 2016

I guess you are looking for the Help:Con­figu­ration para­meter "$smwgLinksInValues" configuration parameter.

[[kgh]] (talk)18:45, 27 April 2016
 

> {{#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

mwjames (talk)20:54, 27 April 2016
 

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)12:09, 21 April 2016

> 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

mwjames (talk)12:59, 21 April 2016

I would never have found it myself. Thank you!

Halo (talk)13:08, 21 April 2016
 

Finally switched to a SMW 2.4 snapshot, and your pull request works like a charm! Thank you again! Navigation now got better. :)

Halo (talk)00:57, 22 April 2016
 
 

Hopefully, it's just a temporary glitch, but at the moment, I cannot access Help:Incoming format.

Cavila (talk)17:54, 30 March 2016

The problem has something to do with {{#smwdoc:incoming}}, which causes the page to black out.

Cavila (talk)17:58, 30 March 2016

Thanks for mentioning! I added issue 1484. Cheers

[[kgh]] (talk)19:30, 30 March 2016
 
 

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?

Thank you in advance.

Halo (talk)09:42, 7 March 2016

Oops, maybe it's better to ask it at Help talk:Selecting pages?

Halo (talk)11:57, 7 March 2016
 

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:

  • Venue to city
  • City to country
  • Country to continent
Halo (talk)00:45, 11 March 2016

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

mwjames (talk)12:15, 11 March 2016

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)18:48, 11 March 2016

> 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).

mwjames (talk)19:13, 11 March 2016

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)19:50, 11 March 2016
 
 
 
 
 
First page
First page
Previous page
Previous page
Last page
Last page