> I'm still confused here:
>>> neither [[subclass of::Food]] nore [[subclass of::Fruit]] does not
>>> match "banana"
>> SMW models MediaWiki Category annotations between categories as
>> rdfs:subClassOf, *and* it knows to query subcategories.
> Is this modelled internally/hardcoded,
Heck yes. From a glance at the latest code, I think QueryProcessor
notices queries for [[Category:Food]], and the actual recursive querying
is performed by SMW_SQLStore->getCategoryTable() which builds a
temporary table holding the subcategories by recursively finding the
subcategories of the query's category.
> or there's ability to create
> another such relations ?
Yes, after someone steps up to write a thousand or so lines of code.
Querying for inverse or transitive relations strikes me as even harder.
You're not just taking a search for stuff in Category:Food and turning
it into a search for stuff in categories Food,Fruit,Vegetables. You're
taking a search for subjects "located in Germany" and a) querying for
special properties of "located in" like "inverse of" and "transitive",
then b) adding the inverse search for objects of "Germany is location
of" and then c) performing the recursive search for anything that's
located in Stuttgart (that's located in Baden-Württemberg that's located
in Germany). It's even more complicated, because you also d) need to
expand "located in"/"located of" to include their subproperties like
Hierarchical and recursive queries just aren't a good fit with SQL.
>> So if article Banana is in [[Category:Fruit]] and that category is in
>> [[Category::Food]], then querying for [[Category:Food]] does indeed
>> find Banana.
> (I guess you mean 'category is in [[Category:Food]]' and 'quering for
>> This works in SMW 0.7.
> This works at ontoworld.org (SMW 1.0prealpha / MW 1.10alpha):
> But does not works in default instalation of SMW 0.7 / MW 1.10.1
> Do i miss something ?
It works for me on my local SMW 0.7 / MW 1.9.2.
Article Banana has wiki text [[Category:Fruit]]
Category:Fruit has wiki text [[Category:Food]]
If I go to Special:Ask and enter [[Category:Food]], it
* Try editing (or ?action=purge) each of the three articles.
* A semantic search for [[Category:Fruit]] should also return banana.
* Category:Fruit should show
Articles in category "Fruit"
> And is some reasoning system planned to be implemented in SMW ?
I don't know. The workaround is to export to an RDF triple store, maybe
that's good enough for the people with the time and skill to do it
within SMW. If someone were to do it, it might be easier to implement a
different storage back-end than SQL.