Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning missing explicitly selected pages as red links #3934

Closed
Larivact opened this issue Apr 16, 2019 · 5 comments
Closed

Returning missing explicitly selected pages as red links #3934

Larivact opened this issue Apr 16, 2019 · 5 comments
Labels
enhancement Alters an existing functionality or behaviour invalid not related to SMW

Comments

@Larivact
Copy link

Larivact commented Apr 16, 2019

Setup and configuration

  • SMW version: 3.0.1

SMW queries currently cannot return missing selected pages, which sometimes can be desirable.

For example:

I have visited:
{{#ask: [[London||Paris||Barcelona]]|?Capital of|format=ol}}

will omit Paris if the page does not (yet) exist.

It would be great if you could set something like return missing=yes (ideally you could also set order=selected).

{{#ask: [[London||Paris||Barcelona]]|?Capital of|format=ol|return missing=yes|order=selected}}

would then return:

  1. London (Capital of: United Kingdom)
  2. Paris (red link)
  3. Barcelona
@s7eph4n
Copy link
Contributor

s7eph4n commented Apr 16, 2019

How should this work in a generalized way? E.g. [[~Paris*]]. Just return a table that has strings starting with Paris? Parisa, Parisb, Parisc, Parisd, Parise,...., Parisaa, Parisab,...

Where should it stop?

@Larivact
Copy link
Author

Larivact commented Apr 16, 2019

I think the option should only affect explicitly given page titles.

@Larivact Larivact changed the title Returning missing results Returning missing explicitly selected pages as red links Apr 16, 2019
@kghbln kghbln added the enhancement Alters an existing functionality or behaviour label Apr 17, 2019
@mwjames
Copy link
Contributor

mwjames commented Apr 20, 2019

SMW queries currently cannot return missing selected pages, which sometimes can be desirable.

I understand the issue but this will not be supported in SMW core as non-existing entities by default are non-existing and therefore not part of a result set.

I think the option should only affect explicitly given page titles.

If you need such a feature then I propose you have a look at [0] which serves as basic example on how your request can be solved using an existing hook. The example doesn't consider ordering or further results which is out of scope and should be solved by the implementing party.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/examples/hook.store.afterqueryresultlookupcomplete.md

@mwjames mwjames closed this as completed Apr 20, 2019
@Larivact
Copy link
Author

I find SMW's lack of support for non-existent entities very limiting because it is in the nature of a wiki to be incomplete. While #ask is awesome, the fact that it does not support the core wiki feature that are red links, is a pity.

Anyway, thanks for your response and your pointer to the hook.

@mwjames
Copy link
Contributor

mwjames commented Apr 20, 2019

it is in the nature of a wiki to be incomplete.

While this is a correct assumption (system are always systems of incomplete information), for something that doesn't exist (as a link, as an ID, or as an existential object etc.) the QueryEngine cannot match unknown entities and therefore behaves as expected.

A QueryEngine selects entities from a pool of known sets and applies conjunctive or disjunctive reductions in order for the input condition to become true.

Of course, there exists some technical solutions (above is one of them) to modify the assumptions about "known sets" but the general premise remains intact of that "a condition is applied to a set of known entities".

the fact that it does not support the core wiki feature that are red links, is a pity.

"Red links" are non-exiting object descriptions with no statements to define their semantics and just because MediaWiki shows them as red links doesn't mean SMW is aware of them and can infer the implied semantics.

OWL and statements created using SMW are generally made under the open world assumption OWA (fact to be true whether it is known or not) and since the system has not enough information it can not positively answer a condition as requested above.

To reframe this into a more technical perspective, under the

  • Closed world assumption (CWA) because the table doesn’t contain this fact, we assume false
  • Open world assumption (OWA) unless we have a statement (or we can infer) we return “don’t know” which is represented in SMW as false (or no existing, hence no match)

The reason I gave the technical example above was so users can redefine assumptions about what is known or not in a wiki specific sense but SMW core will not modify general accepted rules about how to treat incomplete information.

@kghbln kghbln added the invalid not related to SMW label Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Alters an existing functionality or behaviour invalid not related to SMW
Projects
None yet
Development

No branches or pull requests

4 participants