Difference between revisions of "Talk:Semantic Wiki"

From BattleMaster Wiki
Jump to navigation Jump to search
m (→‎Ontology: new section)
(request for info on external data updates)
 
(33 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
== Cleanup ==
 
== Cleanup ==
 
It would be a good idea for people who post ideas to remove them or clean them up when they are moved to the front page, or we decide they are not appropriate. This page will rapidly get too cluttered with old idea to follow the current discussion. --[[User:Indirik|Indirik]] 18:10, 5 February 2009 (UTC)
 
It would be a good idea for people who post ideas to remove them or clean them up when they are moved to the front page, or we decide they are not appropriate. This page will rapidly get too cluttered with old idea to follow the current discussion. --[[User:Indirik|Indirik]] 18:10, 5 February 2009 (UTC)
 +
 +
== Special Characters in Character Names Breaks Things ==
 +
Check the Lord's name here: [[Partora]]. It breaks the semantic coding. I tried dong a <nowiki>[[has lord::<nowiki>...</nowiki></nowiki>]], but got an error. --[[User:Indirik|Indirik]] 16:52, 25 March 2009 (UTC)
 +
:Yeah, that character desperately needs renaming. The name wouldn't even be possible anymore today. --[[User:Tom|Tom]] 18:34, 25 March 2009 (UTC)
 +
  
 
== Maps Service ==
 
== Maps Service ==
 
Using [http://semantic-mediawiki.org/wiki/Help:Service_links Service Links] we can easily add links to region detail pages and other backlinks into the game (family pages, etc.)
 
Using [http://semantic-mediawiki.org/wiki/Help:Service_links Service Links] we can easily add links to region detail pages and other backlinks into the game (family pages, etc.)
 
 
== Infoboxes ==
 
These infoboxes, which are used often as templates, are most important to update, because in one stroke you can convert dozens or even a hundred region or realm pages to semantic information.
 
 
 
=== Options for Region Info templates ===
 
The following ones have been - more or less completly - modified to include semantics:
 
* [[Template:Infobox Regions]]
 
* [[Template:Infobox region]]
 
* [[Template:Region]]
 
* [[Template:Infobox_Regions_Small]]
 
* [[RealmBox Project]] - Can be easily configured for regions as shown here: [[RealmBox Project/Customizing]]
 
 
=== Options for Realm Info templates ===
 
(add those you found)
 
* [[RealmBox Project]] - Composite but customizable) realm templates can be seen here: [[RealmBox Project/Preconfigured Templates]]
 
 
  
 
== Various Ideas ==
 
== Various Ideas ==
Line 32: Line 19:
 
== Calculating realm population ==
 
== Calculating realm population ==
  
I've gotten stuck trying to calculate the population of a realm. I can generate a count of the regions/duchies/nobles in a realm, but I can't seem to figure how to do a mathematical computation using the populations of individual regions to get the total population. There is the <nowiki>{{#expr: ... }}</nowiki> parser function, but there is no way to have it perform operations on an unknown number of values. i.e. there is no SUM operator. I'd appreciate any help anyone has.
+
OK, I'm calculating population, using this query:
 +
 
 +
<pre>{{#ask: [[part of::Keplerstan]] | ?population | format=sum }}</pre>
 +
 
 +
It works and gets the right answer, but with one problem: it wraps the answer in <nowiki><p>...</p></nowiki> tags, like this:
 +
 
 +
<pre>The population of Keplerstan is {{#ask: [[part of::Keplerstan]] | ?population | format = sum }} commoners.</pre>
 +
 
 +
The population of Keplerstan is {{#ask: [[part of::Keplerstan]] | ?population | format = sum }} commoners.
 +
 
 +
This only seems to affect the "sum" format. The "list" format doesn't do this:
  
Population of the regions of Keplerstan, this would list all of them, separated by commas:
+
The population of Keplerstan is {{#ask: [[part of::Keplerstan]] | ?population= | mainlabel=- | format = list }} commoners.
  
{{#ask: [[Category:Regions]] [[located on::Beluaterra]] | ?population= | mainlabel=- | format = list}}
+
Anyone have any ideas? This is *really* annoying.
 +
--[[User:Indirik|Indirik]] 23:41, 25 February 2009 (UTC)
  
I can use "sep=+" t replace the separators with + signs, like this:
+
:Looks like being a "feature" of the sum format.  --[[User:Tom|Tom]] 07:32, 26 February 2009 (UTC)
 +
:Testing if this is also for the other math functions:
 +
:The max population in Keplerstan is {{#ask: [[part of::Keplerstan]] | ?population | format = max }} commoners.
 +
:The min population in Keplerstan is {{#ask: [[part of::Keplerstan]] | ?population | format = min }} commoners.
 +
:The avg population in Keplerstan is {{#ask: [[part of::Keplerstan]] | ?population | format = average }} commoners.
  
{{#ask: [[Category:Regions]] [[located on::Beluaterra]] | ?population= | mainlabel=- | format = list | sep=+}}
 
  
But when I try and feed the whole thing through  <nowiki>{{#expr: ... }}</nowiki>, I get this:
+
== Region properties ==
  
{{#expr: {{#ask: [[Category:Regions]] [[located on::Beluaterra]] | ?population= | mainlabel=- | format = list | sep=+}} }}
+
The [[New Economy]] appears to assign two major resource types to each region. How about assigning semantic properties for these? That would allow us to easily create a list of all regions that have, for example, stoneworks, or mining. Perhaps: <nowiki>[[has resource:: ... ]]</nowiki>? Maybe we could then even dynamically list the resource types produced by a realm... --[[User:Indirik|Indirik]] 20:40, 20 March 2009 (UTC)
 +
:It's not that simple, but I agree in principle. The thing is that this is not a list of available resources, it expresses something different. Let's wait with that until the system is done. --[[User:Tom|Tom]] 18:36, 25 March 2009 (UTC)
  
If the population values contain thousand separators, you get an error...
+
== [[:Template:Pie]] ==
 +
I've not done much research into this Semantic wiki stuff, but would adding a Semantic query to [[:Template:Pie]] (referenced by [[New Attributes]]) be appropriate/possible? Something like <nowiki>{{#show: {{PAGENAME}} | ?attributes}}</nowiki> (which, when rendered, would be <nowiki>{{#show: [[November_Family/Calvin]] | ?attributes}}</nowiki> for this character)? --[[User:Calvin November|Calvin November]] <sup>[[User talk:Calvin November|t]]</sup>/<sub>[[Special:Contributions/Calvin_November|c]]</sub> on 06:55, 21 February 2009 (UTC)
 +
:Not worth the effort right now, because it's not certain the new attributes are ever going to go active. --[[User:Tom|Tom]] 12:07, 21 February 2009 (UTC)
  
If you restrict it to populations less than 1000, you get this:
+
== Articles and News ==
  
{{#expr: {{#ask: [[population::<1000]] | ?population= | mainlabel=- | format = list | sep=+}} }}
+
Should we also put semantics on articles and news? We could use something like "about" or "news date" and it would allow us to do searches on articles across the various newspapers, generate timelines and other interesting stuff. --[[User:Tom|Tom]] 21:38, 4 March 2009 (UTC)
  
So it works, if we just get rid of the thousand separator on all the region pages. But if anyone uses one, then it will error out on all pages that reference that region.
+
:That is an interesting idea. An "about/topic/keyword" attribute could be very nice. As to date, is that really a viable option? As far as I know, the timeline only points to the page name on which the property is placed. This means that the date would point to, in the case of the Dwilight Daily, something like "Dwilight Daily/2009/January", and that would be what appears on the timeline. Or can you somehow give a date property a secondary value with an article name? Or do we need to rethink the way newspapers are done? TO be honest, I haven't had a lot of time to investigate timelines. --[[User:Indirik|Indirik]] 22:35, 4 March 2009 (UTC)
  
Perhaps we could contemplate adding this:
+
::Yes, we would probably have to do that. [http://semantic-mediawiki.org/wiki/Timeline] shows how this works, and it does have one page per news. Unfortunately, multi-valued properties can not be used in timelines. But if nothing else works, we can look into the code and check if we can't add something like a pipe trick. --[[User:Tom|Tom]] 07:57, 5 March 2009 (UTC)
[http://semantic-mediawiki.org/wiki/Semantic_Result_Formats http://semantic-mediawiki.org/wiki/Semantic_Result_Formats]. It would add the Sum operator, as well as timelines, charts, calendar, etc.
 
--[[User:Indirik|Indirik]] 23:12, 10 February 2009 (UTC)
 
  
:Eh.... Information > Realm List? And if the table's not good enough for you, you can click on details and it is also listed on the realm page in simpler text, along with the realm's food production? -[[User:Chénier|Chénier]] 03:21, 11 February 2009 (UTC)
+
== Semantic Properties Generated by Templates From External Data Is Broken==
::Yes, you ''could'' just manually enter the data, but that defeats the entire purpose of the Semantic tagging. All the data is included on the individual region pages. Why enter it again manually on the realm page? And then on the island-wide region listing. And then on the island page where it lists the island population, and anywhere else we might like to display or use the information. The purpose of Semantic tagging is to prevent all of this manual updating of information. Simply update the region's population, and all the places that reference that data are automatically updated at the same time. If a region changes hands you only change the <nowiki>[[part of:: ... ]]</nowiki> tag and it's population/gold/food is deducted form the realm it ''was'' part of, and added to the new realm.  --[[User:Indirik|Indirik]]
 
  
:::Oh, I was just talking about having the wiki plug the data from the game pages, but I guess we don't have that technology yet. -[[User:Chénier|Chénier]] 15:19, 11 February 2009 (UTC)
+
The value of semantic properties inserted by templates are set for a page when the page containing the template is saved.<br>
 +
Usually not a problem ''unless'' the template uses external data to choose the semantic properties to insert on the page, if the external data changes the semantic property values does not until the page containing the template is edited and saved again.<br>
 +
This means semantic properties set from, for example Template:RealmBox can be (and in some cases definately are) wrong.
 +
The fix is to run a cron job to update the semantic data, (an hour after turn changes would be perfect if the server can handle the load, no reason not to heavily 'nice' the process).
  
::::Not yet, but I hope that we will, eventually. The tagging of the data is a first important step on the path to getting that done, though. --[[User:Indirik|Indirik]] 16:24, 11 February 2009 (UTC)
+
http://www.mediawiki.org/wiki/Extension:External_Data#Using_External_Data_with_Semantic_MediaWiki. -- [[User:Wraith0x29a|Wraith0x29a]] 22:23 5 November 2009 (UTC)
  
== Ontology ==
+
:Yes, this is a known issue. I've discussed the matter with Tom a few times. He does have a script which can refresh the semantic data. Server load is definitely the issue. Tom is very busy, and hasn't had a lot of time to look at things. From the checking he did get done, he didn't see any good ways to minimize the load from the script he was using. Still, I will pass along the link you have provided, and see if it can be of any use to him or any of the other devs. --[[User:Indirik|Indirik]] ([[User talk:Indirik|talk]]), [[BattleMaster Wiki:Editors|Editor]] ([[BattleMaster Wiki:User-Editors Talk|talk]]) 17:52, 7 December 2009 (UTC)
  
I believe the properties "has lord" and "has knights" should be listed under the Regions section of the properties page and not the Realm level. If they are listed on the region, they can easily be pulled up to the realm level. The reverse is not true. --[[User:Indirik|Indirik]] 21:29, 11 February 2009 (UTC)
+
::Any progress on this or should we add instructions on how to do this manually (edit, add space if no other edit required, save as minor edit.. starting with lowest level..eg. realm page, duchy page then region page for region data updates)? [[User:Wraith0x29a|wraith0x29a]]

Latest revision as of 05:06, 4 February 2011

Cleanup

It would be a good idea for people who post ideas to remove them or clean them up when they are moved to the front page, or we decide they are not appropriate. This page will rapidly get too cluttered with old idea to follow the current discussion. --Indirik 18:10, 5 February 2009 (UTC)

Special Characters in Character Names Breaks Things

Check the Lord's name here: Partora. It breaks the semantic coding. I tried dong a [[has lord::<nowiki>...</nowiki>]], but got an error. --Indirik 16:52, 25 March 2009 (UTC)

Yeah, that character desperately needs renaming. The name wouldn't even be possible anymore today. --Tom 18:34, 25 March 2009 (UTC)


Maps Service

Using Service Links we can easily add links to region detail pages and other backlinks into the game (family pages, etc.)

Various Ideas

"member of" should cover family relations. The cool thing is that you can also model actual relations using semantic terms, so "son of" and "father of" works great, as does "brother of". I'll add a category for that. --Tom 06:40, 5 February 2009 (UTC)
Maybe a "was member of" for former realms.--Athins 18:41, 5 February 2009 (UTC)
That's an interesting idea, but it would also require further annotations, specifically dates. Anyone know if there's a way to express things like "was a member of X from (date A) until (date B)" ?
I think this could be done using Many-valued properties. --Tom 13:42, 7 February 2009 (UTC)
Following that idea(which I like, but could see troubles with), I think we need a had ruler/judge/general/banker/capital etc. function for lost realms or for just former people in those offices. This could apply to lordships as well and begin to collect a database of claims when you view former council members, regions, lords etc. --Vita Family 15:06, 8 February 2009 (UTC)

Calculating realm population

OK, I'm calculating population, using this query:

{{#ask: [[part of::Keplerstan]] | ?population | format=sum }}

It works and gets the right answer, but with one problem: it wraps the answer in <p>...</p> tags, like this:

The population of Keplerstan is {{#ask: [[part of::Keplerstan]] | ?population | format = sum }} commoners.

The population of Keplerstan is 999 commoners.

This only seems to affect the "sum" format. The "list" format doesn't do this:

The population of Keplerstan is 999 commoners.

Anyone have any ideas? This is *really* annoying. --Indirik 23:41, 25 February 2009 (UTC)

Looks like being a "feature" of the sum format. --Tom 07:32, 26 February 2009 (UTC)
Testing if this is also for the other math functions:
The max population in Keplerstan is 999 commoners.
The min population in Keplerstan is 999 commoners.
The avg population in Keplerstan is 999 commoners.


Region properties

The New Economy appears to assign two major resource types to each region. How about assigning semantic properties for these? That would allow us to easily create a list of all regions that have, for example, stoneworks, or mining. Perhaps: [[has resource:: ... ]]? Maybe we could then even dynamically list the resource types produced by a realm... --Indirik 20:40, 20 March 2009 (UTC)

It's not that simple, but I agree in principle. The thing is that this is not a list of available resources, it expresses something different. Let's wait with that until the system is done. --Tom 18:36, 25 March 2009 (UTC)

Template:Pie

I've not done much research into this Semantic wiki stuff, but would adding a Semantic query to Template:Pie (referenced by New Attributes) be appropriate/possible? Something like {{#show: {{PAGENAME}} | ?attributes}} (which, when rendered, would be {{#show: [[November_Family/Calvin]] | ?attributes}} for this character)? --Calvin November t/c on 06:55, 21 February 2009 (UTC)

Not worth the effort right now, because it's not certain the new attributes are ever going to go active. --Tom 12:07, 21 February 2009 (UTC)

Articles and News

Should we also put semantics on articles and news? We could use something like "about" or "news date" and it would allow us to do searches on articles across the various newspapers, generate timelines and other interesting stuff. --Tom 21:38, 4 March 2009 (UTC)

That is an interesting idea. An "about/topic/keyword" attribute could be very nice. As to date, is that really a viable option? As far as I know, the timeline only points to the page name on which the property is placed. This means that the date would point to, in the case of the Dwilight Daily, something like "Dwilight Daily/2009/January", and that would be what appears on the timeline. Or can you somehow give a date property a secondary value with an article name? Or do we need to rethink the way newspapers are done? TO be honest, I haven't had a lot of time to investigate timelines. --Indirik 22:35, 4 March 2009 (UTC)
Yes, we would probably have to do that. [1] shows how this works, and it does have one page per news. Unfortunately, multi-valued properties can not be used in timelines. But if nothing else works, we can look into the code and check if we can't add something like a pipe trick. --Tom 07:57, 5 March 2009 (UTC)

Semantic Properties Generated by Templates From External Data Is Broken

The value of semantic properties inserted by templates are set for a page when the page containing the template is saved.
Usually not a problem unless the template uses external data to choose the semantic properties to insert on the page, if the external data changes the semantic property values does not until the page containing the template is edited and saved again.
This means semantic properties set from, for example Template:RealmBox can be (and in some cases definately are) wrong. The fix is to run a cron job to update the semantic data, (an hour after turn changes would be perfect if the server can handle the load, no reason not to heavily 'nice' the process).

http://www.mediawiki.org/wiki/Extension:External_Data#Using_External_Data_with_Semantic_MediaWiki. -- Wraith0x29a 22:23 5 November 2009 (UTC)

Yes, this is a known issue. I've discussed the matter with Tom a few times. He does have a script which can refresh the semantic data. Server load is definitely the issue. Tom is very busy, and hasn't had a lot of time to look at things. From the checking he did get done, he didn't see any good ways to minimize the load from the script he was using. Still, I will pass along the link you have provided, and see if it can be of any use to him or any of the other devs. --Indirik (talk), Editor (talk) 17:52, 7 December 2009 (UTC)
Any progress on this or should we add instructions on how to do this manually (edit, add space if no other edit required, save as minor edit.. starting with lowest level..eg. realm page, duchy page then region page for region data updates)? wraith0x29a