Hi again,

If it is possible to simply resolve a list of  user defined has type:names into its internal system type equivalent (for exemple Page and Address resolved into = "_wpg"), I'd really like to try to fix that.

I'm prepared to look into the code base and try to design a solution, but I'd probably need some helpful comments and pointers about where to start, since I'm not familiar with the code base yet. Therefore I'd really appreciate some comments on the subject from experienced coders, about things like which places in the code to start looking at, for example, and which code and concepts you'd expect to become affected by such a "type name resolution"

As a newbie on the code base one can spend days and weeks on unknown code, not even being able to properly test all consequences of a change, only to eventually realize that it would take immense effort to bring a feature all the way to the goal.

In short, support for user defined aliases of system types which (important) /does not change/ anything about the type itself, may seem meaningless to some of you, but I can assure that it isn't. Types carry important informations, even if only having a different name (like variants of Page). If I could only assign a page of Type:Address (=Page) to it's own Type:Address page and use the type Address elsewhere (everywhere) in the system, then I could also on that very Type-page define all kinds of other useful meta information (useful at runtime).


// Rolf Lampa

Rolf Lampa [RIL] skrev:
= Type aliases revisited =

(Perhaps I better ask abut types in the developers list).

When I have a model with a class Person (with a single link to an 
Address), and a sub class Male, like so:

    [Person]*-inmates------home address-1[Address]
      specialization (inherits)

... and ask for all inmates in that address with this query:

{{#ask: [[Category:Person]] [[home address::{{FULLPAGENAME}}]] | 
intro=inmates | limit=2 | format=table }}

... then the query also returns instances of Male. Well, that's also 
what I'd expect from the semantics of the above model (see also a better 
view of my "Stress Test Model" here): 

But now for a serious problem I have found: If the link Address is 
defined as [[has type:Address]] (that is, a sub-type of Page), then the 
SMW framework doesn't have a clue. This limitation prevents from making 
"self descriptive" code/definitions/models, since I cannot use [[has 
type:Address]] on the definition page of "Property:home address".

The ability to use user defined types (directly derived from system 
types without any change to the type itself, only using new names) seems 
to be a little hole to plug in the SMW framework.

= Type aliases - The Solution(?) =

One possible solution would be to allow for defining something like 
[[alias type of::Page]] on the page Type:Address. An "alias type" would 
then be "resolved" by SMW into type:Page (an operation already 
supported, I presume, since the SMW framework already allows for "multi 
lingual" type aliases defined in the language files).

Is there any chance that something like the suggested "user defined 
alias types" will be implemented, and if so, would it be possible to 
implement it anytime soon?


// Rolf Lampa

This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
Semediawiki-devel mailing list