From: Schouten, E. J. (RB-NL) <Edg...@re...> - 2010-03-23 14:28:24
|
Hi, Thank you very much for pointing me to Semantic Internal Objects. SIO is a very interesting extension that I unfortunately somehow overlooked until now. After creating Internal objects like the following three for my friend Steven McCoy {{#set_internal:Has position |Has title=CFO |Has startdate=2003-01-01 |Has enddate=2004-04-01 |Has company=RBI }} {{#set_internal:Has position |Has title=CEO |Has startdate=2002-01-01 |Has enddate=2003-04-01 |Has company=KPN }} {{#set_internal:Has position |Has title=CTO |Has startdate=2005-01-01 |Has enddate=3000-01-01 |Has company=V&D }} I can successfully query for current and past positions of a person (and also make lists of current employees and former employees at the pages of the companies) === current positions === {{#ask:[[Has position::{{FULLPAGENAME}}]][[Has enddate::>{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}}]] |mainlabel=- |sort=Has startdate |? Has startdate |? Has title |? Has company }} === previous positions === {{#ask:[[Has position::{{FULLPAGENAME}}]][[Has enddate::<{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}}]] |mainlabel=- |sort=Has startdate |? Has startdate |? Has enddate = |? Has title |? Has company }} This is great! Really great! I am still struggling though, with making a list of co-workers of a person. Somehow I need to compare startdates and enddates of people (within one company). Can I use subqueries (<q></q>) somehow, or do I need some other mechanism that I can't seem to stumble upon. ===Co-workers of Steven McCoy at KPN=== {{#ask:[[Has position::+]] [[Has company::KPN]] [[Has startdate::< <q>...Steven McCoy's enddate at KPN</q>]] [[Has enddate::> <q>...Steven McCoy's startdate at KPN</q>]] |mainlabel=- |sort=Has startdate |? Has startdate |? Has enddate = |? Has title |? Has company }} The other thing is that - In order to keep things dynamic - I need to get red of the hard-coded [[has company::X]] in the example above and loop over the results of the list of companies that Steven McCoy worked for. Thank you very much in advance. Kind regards EdgarS Van: Yaron Koren [mailto:ya...@gm...] Verzonden: maandag 22 maart 2010 17:11 Aan: Schouten, Edgar J. (RB-NL) CC: sem...@li... Onderwerp: Re: [Semediawiki-user] Co-working (Schouten, Edgar J. (RB-NL)) Hi Edgar, I would strongly discourage you from creating a page for each of these combinations of data, and instead strongly encourage you to use the Semantic Internal Objects extension: http://www.mediawiki.org/wiki/Extension:Semantic_Internal_Objects If you're using Semantic Forms to input the data, you should use "mulitple-instance templates" to enter that internal-object data. -Yaron |