inheritance in hierarchies (again)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

inheritance in hierarchies (again)

Cavila Contrafibularity
Here's a draft which aims to offer a couple of tips if you need to use or mimic inheritance in a hierarchy of subclasses.

http://semantic-mediawiki.org/wiki/User:Cavila/inheritance_in_hierarchies

It could be considered a follow-up to the musing brainstorm that I posted back in 2013 with the subject 'Hierarchies again' - more so because the feature that Alexey and Yury were working on at the time for the Wikivote website now seems to have its counterpart in the 'tree' and 'oltree' result formats (SRF) - sorry, I don't know if or how the two things are connected. Pending the status of the 'template' parameter (which seems to be buggy), these formats could be of tremendous value for this important issue.

Any input or further ideas would be welcome, of course. I'm not a developer, just someone trying to make the most of what's available and trying to give something back.

Best,
Cav

     
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Transitive properties

John McClure-2
Hi Cav,
You provide a good review about methods we have today to display
transitive property chains - thanks! Your solutions are very creative
however I think it'd help us all to modify SMW #ask syntax to handle
these chains? It's easy to believe many need to select pages based on a
transitive property predicate and second, to print all values of a
transitive property for each 'root' page in a query result.

*Transitive predicates. *Tests for whether a page
  [[pn::+]]  = has 1+ 'pn' relations
[[pn*::+]] = has 1+ 'pn' relations (implicit wildcard)
[[pn?::+]] = has 1+ 'pn' relations AND that no 'pn' relation has any
'pn' relation
[[pn+::+]] = has 1+ 'pn' relations AND that some 'pn' relation has 1+
'pn' relations

*Transitive property values. *For each page in a result set*,
*|?pn   = prints all 'pn' relations (no transitives)
|?pn* = prints all 'pn' relations (implicit wildcard, no transitives)
|?pn? = prints all 'pn' transitive relations - once-removed (parent)
transitives
|?pn+ = prints all 'pn' transitive relations  - maximum transitivity

This syntax works with multilingual syntax options I have sketched.
Following, a query yields all pages that have a French-qualified value
for property "Located in". It then lists the object's French and English
values, with maximum transitivity for each, for the property.

{{#ask: [[Located in @fr *:: +]]
|?Located in @fr += @en=Located in<br/>(French) @fr=Situe
dans<br/>(Francais)
|?Located in @en += @en=Located in<br/>(English) @fr=Situe
dans<br/>(Anglais)
}}

I don't see much value when querying to lookup whether the named
property is "transitive" or not...

Any thoughts about how to modify the #ask command for transitives?
thanks/john
[1]
https://semantic-mediawiki.org/wiki/Help:Inferencing#Inferencing_features_that_are_not_supported
[2] http://www.w3.org/TR/sparql11-query/#propertypaths


On 9/11/2015 2:19 AM, Cavila wrote:

> Here's a draft which aims to offer a couple of tips if you need to use or mimic inheritance in a hierarchy of subclasses.
>
> http://semantic-mediawiki.org/wiki/User:Cavila/inheritance_in_hierarchies
>
> It could be considered a follow-up to the musing brainstorm that I posted back in 2013 with the subject 'Hierarchies again' - more so because the feature that Alexey and Yury were working on at the time for the Wikivote website now seems to have its counterpart in the 'tree' and 'oltree' result formats (SRF) - sorry, I don't know if or how the two things are connected. Pending the status of the 'template' parameter (which seems to be buggy), these formats could be of tremendous value for this important issue.
>
> Any input or further ideas would be welcome, of course. I'm not a developer, just someone trying to make the most of what's available and trying to give something back.
>
> Best,
> Cav
>
>    
> ------------------------------------------------------------------------------
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user

------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Transitive properties

Cavila Contrafibularity
Thanks John for sharing your ideas!

> it'd help us all to modify SMW #ask syntax to handle these chains ... It's easy to believe many need to select pages based on a transitive property predicate and second, to print all values of a transitive property for each 'root' page in a query result.

Oh, absolutely. Regarding the first, I actually made a feature request to similar (if much less comprehensive) effect once, without any real response - hence the alternatives. But the Bugzilla days must have been too early for this and SMW has progressed a lot since then. The time may be ripe for it.

Thanks for setting out such a detailed plan! It covers more ground than I envisaged but it looks perfectly reasonable. Part of what I like about it is how you've given consideration to existing practices. In other words, a future implementation of this feature should not impact on those with no need for it, because (1) transitive searching is completely optional; and (2) the syntax proposed (question marks, asterisks and plus signs) are not normally part of property names.  

Some additional questions and comments:

* When it comes to data storage, would/could the kind of transivity we're discussing be extremely memory/resource-intensive?
** If so, would we need to have a configuration setting that lets you enable/disable this feature?
** If so, would it be better to introduce a new special property that lets you explicitly mark a property as transitive?
* Or is resource usage mostly irrelevant to data storage and more of a potential issue to do with querying?
* There probably needs to be some sort of handle on infinite transivity loops (say if the lowest subclass is accidentally given as the top superclass). Maybe a maximum depth?
* As for the prospects of this ever being put to practice, would it be within/beyond the skills of our devs (no offence, of course, you're doing amazing work! I can't stress this enough) or is it more of a time/energy issue? Or is something else involved?

Cav

> To: [hidden email]
> From: [hidden email]
> Date: Sat, 19 Sep 2015 16:43:00 -0700
> CC: [hidden email]
> Subject: [Semediawiki-user] Transitive properties
>
> Hi Cav,
> You provide a good review about methods we have today to display
> transitive property chains - thanks! Your solutions are very creative
> however I think it'd help us all to modify SMW #ask syntax to handle
> these chains? It's easy to believe many need to select pages based on a
> transitive property predicate and second, to print all values of a
> transitive property for each 'root' page in a query result.
>
> *Transitive predicates. *Tests for whether a page
>   [[pn::+]]  = has 1+ 'pn' relations
> [[pn*::+]] = has 1+ 'pn' relations (implicit wildcard)
> [[pn?::+]] = has 1+ 'pn' relations AND that no 'pn' relation has any
> 'pn' relation
> [[pn+::+]] = has 1+ 'pn' relations AND that some 'pn' relation has 1+
> 'pn' relations
>
> *Transitive property values. *For each page in a result set*,
> *|?pn   = prints all 'pn' relations (no transitives)
> |?pn* = prints all 'pn' relations (implicit wildcard, no transitives)
> |?pn? = prints all 'pn' transitive relations - once-removed (parent)
> transitives
> |?pn+ = prints all 'pn' transitive relations  - maximum transitivity
>
> This syntax works with multilingual syntax options I have sketched.
> Following, a query yields all pages that have a French-qualified value
> for property "Located in". It then lists the object's French and English
> values, with maximum transitivity for each, for the property.
>
> {{#ask: [[Located in @fr *:: +]]
> |?Located in @fr += @en=Located in<br/>(French) @fr=Situe
> dans<br/>(Francais)
> |?Located in @en += @en=Located in<br/>(English) @fr=Situe
> dans<br/>(Anglais)
> }}
>
> I don't see much value when querying to lookup whether the named
> property is "transitive" or not...
>
> Any thoughts about how to modify the #ask command for transitives?
> thanks/john
> [1]
> https://semantic-mediawiki.org/wiki/Help:Inferencing#Inferencing_features_that_are_not_supported
> [2] http://www.w3.org/TR/sparql11-query/#propertypaths
>
>
> On 9/11/2015 2:19 AM, Cavila wrote:
> > Here's a draft which aims to offer a couple of tips if you need to use or mimic inheritance in a hierarchy of subclasses.
> >
> > http://semantic-mediawiki.org/wiki/User:Cavila/inheritance_in_hierarchies
> >
> > It could be considered a follow-up to the musing brainstorm that I posted back in 2013 with the subject 'Hierarchies again' - more so because the feature that Alexey and Yury were working on at the time for the Wikivote website now seems to have its counterpart in the 'tree' and 'oltree' result formats (SRF) - sorry, I don't know if or how the two things are connected. Pending the status of the 'template' parameter (which seems to be buggy), these formats could be of tremendous value for this important issue.
> >
> > Any input or further ideas would be welcome, of course. I'm not a developer, just someone trying to make the most of what's available and trying to give something back.
> >
> > Best,
> > Cav
> >
> >    
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > Semediawiki-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
     
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user