Help talk:Semantic search
Contents |
[edit] "join" syntax (query on what links here)
It would be nice if there is some sort of way of performing sql like join. so for each item, i can see all items referencing it with some relation. fore example, to see for each user who loves him, something like: <ask>[[User:+]] [[loves::???]]</ask> ('???' is because i can't suggest a syntax now) Ittayd 15:04, 2 January 2007 (CET)
- Actually, I think you can do this by substituting {{FULLPAGENAME}} for ???. This is a MediaWiki capability; see [1] and/or [2].
Another example is if there are statements about persons and the organizations they belong to, and you want to show all pairs of persons that belong to the same organization (regardless of which organization it is).
[edit] "Not"
Maybe this is not obviuos enough to me, but how can I say != x?
eg: <ask>Username:!=Unknown N</ASK>
us <>? I tried :=> and :=< together and no success? Not a current feature?
- I think "not" is not supported. It would be useful.--Patrick 15:14, 26 February 2007 (CET)
[edit] Date Queries
How would i go about getting pages where the end date > currentdate + 2weeks, without creating a new magic word such as CurrentWeekPlus2
[edit] Returned Pages
Say I have a Namespace:PageTitle/SubPage and that is returned in my results .eg
<ASK>* * </ASK>> This would give me something like Animal:Reindeer/Blue Speckled Reindeer|doctomogonosi invero|Japan Animal:Whale/Humped backed spotted Whale|ingenoginus lavino|Deep See somewhere
Now the problem I have is the title is huge, how can i say put numbers in space of the title, or even just put the subpage title
How about If i included an additional qualifier such as ASK subpage="true" which would then display the url as mysite/index.php?title=namespace:title/subpage subpage
Where would I make the changes in the code ? 81.179.229.28 02:45, 27 April 2007 (CEST)
[edit] Pages in Custom Namespaces
I have 2 custom namespaces in addition to the 6 namespaces of SMW. Those do not show up for any query. Pages in Namespace 0 work fine. I include the Extension like this:
$smwgNamespaceIndex = 200;
require_once('extensions/SemanticMediaWiki/includes/SMW_Settings.php');
$smwgNamespacesWithSemanticLinks[100] = true;
$smwgNamespacesWithSemanticLinks[101] = false;
enableSemantics($wgServerName);
The pages DO actually show up in the special pages SearchByAttribute and SearchByRelation, but not in the inline queries and ask special page. I'm making the annotations in the pages via templates, but that shouldn't be a problem, since the pages show up in the other special pages.
Am I doing something wrong, or is this a bug?
--91.3.122.18 21:47, 12 May 2007 (CEST) (Die_Backe)
- I had the same problem, and I've found that semwiki only allows up to 10 additional namespaces and that the maximum namespace number for the semnamespaces is 110. Ie, for queries to work properly, the namespace index has to be 110 or less.
-- Kphunter
- I also have the same issue. Mine is a genealogy/family history site, and a person may have a main page, an obituary, a number of census records, a death certificate, etc. It seems to me to obviate the usefulness of namespaces to have to put some indication of what the page is about in the title. I find it confusing to be presented with a number of pages in a listing with the same name; I am not sure my readers will think to haver over the page titles to find out what they are. It seems to me that this should be configurable, both as a default and as a parameter in the query. I have been wondering if I can hack it by passing the namespace as a property and using a template. Seems like it shouldn't be this hard. Mathsinger 03:21, 27 August 2010 (CEST)
Here is my hack: Include the following line in templates generating pages for the namespaces:
[[namespace::{{NAMESPACE}}| ]]
"Namespace" is a property of Type:String
Include the new namespace property in the query:
{{#ask: {{{1}}}[[mentions::{{PAGENAME}}]]
| ?namespace
| format=category
| columns=2
| template=ShowNamespace
| intro=<h2>Mentioned in {{{2|}}}:</h2>
}}
where the template "ShowNamespace" looks like this:
{{{1|}}}{{#if: {{{2|}}}| ({{{2|}}}) }}
Results here (Scroll down to "Mentioned in Other Documents".)
Mathsinger 20:43, 27 August 2010 (CEST)
[edit] Exporting search results
I'm running queries using Special:Ask on my Wiki, but I'm also interested in exporting this data to do more in-depth analysis.
Is there any easy way to export this data into some file instead of seeing results on a web page?
--Sergey Chernyshev 18:36, 18 May 2007 (CEST)
[edit] [[attribute:=*]] syntax
Hi everybody! I've installed the SW extension on my company MediaWiki's only a few days ago and I'm exploring its potential, especially in conjunction with templates. I managed to solve many of the problems I stumbled upon, but this one seems to be something different, like a bug or an installation problem.
I'm using the following query in Special:Ask
[[Category:Person]] [[Name:=*]]
but it returns an empty, and I mean empty, browser window.
Notice that the query:
[[Category:Person]] [[Name:=+]]
works just fine, returning the pages that are categorized as person and have a Name defined.
Any idea where the problem might be? Manu3d 19:40, 3 July 2007 (CEST)
[few days later] Further from what described above: I have enabled MediaWiki logging and what follows is the log entry for two consecutive button-press of "Preview" while editing a page. The first button-press completed successfully and loaded the preview page of the article. In this case the <ask> query was using the correctly working [[Name:=+]] clause.
The second is the log entry for the second button-press. The only difference between the two is that in this case the clause in the <ask> query was using the so far problematic (but highly useful) [[Name:=*]] clause. Have a look and notice the last two lines missing, including the missing "Request ended normally". Any idea of what's going on? Manu3d 15:38, 10 July 2007 (CEST)
POST /index.php?title=User:Manu.d/testAsk&action=submit Main cache: FakeMemCachedClient Message cache: MediaWikiBagOStuff Parser cache: MediaWikiBagOStuff Unstubbing $wgMessageCache on call of $wgMessageCache->addMessages from wfCite Unstubbing $wgParser on call of $wgParser->setHook from Cite::setHooks Unstubbing $wgContLang on call of $wgContLang->getMagic from MagicWord::load Unstubbing $wgOut on call of $wgOut->addScript from TreeView::addJS Unstubbing $wgLang on call of $wgLang->getCode from smwfInitMessages Unstubbing $wgUser on call of $wgUser->getOption from StubUserLang::_newObject Cache miss for user 7 Unstubbing $wgLoadBalancer on call of $wgLoadBalancer->getConnection from wfGetDB Logged in from cookie Fully initialised Language::loadLocalisation(): got localisation for en from source EditPage::edit: enter EditPage::importFormData: Passed token check. EditPage::edit: Checking blocks MessageCache::load(): got from global cache OutputPage::sendCacheControl: private caching; ** Request ended normally POST /index.php?title=User:Manu.d/testAsk&action=submit Main cache: FakeMemCachedClient Message cache: MediaWikiBagOStuff Parser cache: MediaWikiBagOStuff Unstubbing $wgMessageCache on call of $wgMessageCache->addMessages from wfCite Unstubbing $wgParser on call of $wgParser->setHook from Cite::setHooks Unstubbing $wgContLang on call of $wgContLang->getMagic from MagicWord::load Unstubbing $wgOut on call of $wgOut->addScript from TreeView::addJS Unstubbing $wgLang on call of $wgLang->getCode from smwfInitMessages Unstubbing $wgUser on call of $wgUser->getOption from StubUserLang::_newObject Cache miss for user 7 Unstubbing $wgLoadBalancer on call of $wgLoadBalancer->getConnection from wfGetDB Logged in from cookie Fully initialised Language::loadLocalisation(): got localisation for en from source EditPage::edit: enter EditPage::importFormData: Passed token check. EditPage::edit: Checking blocks MessageCache::load(): got from global cache
UPDATE: User:Freddy seem to have stumbled on this problem a year ago, as his post in the Inline Query talk page and his end comment on his own user page clearly illustrate. I've now double checked in the most rigorous way and there is a problem, but I have found this is clearly restricted to something in the way my own server is configured as here on Ontoworld the same set of documents and the same query testAsk works just fine. Freddy suggested a php.ini based remedy, but he either couldn't test it himself or it wasn't the only thing needed. I shall verify if that's the solution in the next few minutes. Manu3d 17:01, 10 July 2007 (CEST)
- SOLUTION FOUND!!!: Freddy got it right! The solution to this problem lies in enabling the php extension php_mbstring.dll uncommenting the appropriate line in php.ini (just search the file for the dll filename - in my installation it was around line 633). Notice that the file php.ini is not part of the MediaWiki or SMW installations, but part of the PHP installation, and such file seems to be residing (on a windows server) in C:\Windows. Manu3d 17:19, 10 July 2007 (CEST)
[edit] Asking for a Category without receiving SubCategory's results
Asking for categories Conditions with categories are generally simple, but they are more powerful than they might at first appear: When searching for pages within a category, the result also involves all pages that are contained in subcategories of this category. For example, assume that we have a category "Theatre actor" which is a subcategory of "Actor". Then the query [[Category:Actor]] will also return those "special" actors that are in the category "Theatre actor" only. This makes sense in many situations, but you can still view the pages that were directly put into the category actor by just going to the page of that category (by following the link [[:Category:Actor]]).
How do I get the same listing as one would see at [[:Category:Actor]] through a query? Phrased differently, How do I write a query such that my results are a listing of all the subcategories of the Category I'm specifying as a parameter to my query? Note that I prefer a format that doesn't have the Categories sectioned off by letter, and I'd like to know if there are ways to view A) just the subcategories of a category, B) just the pages of a category, or C) both the subcategories and pages of a category... but I'm most interested in A for my current purpose.
Thank you, TheAlker 04:45, 25 July 2007 (CEST)