Discuss Search operators
- [View source↑]
- [History↑]
Contents
Thread title | Replies | Last modified |
---|---|---|
Unexpected behavior selecting pages using search operator “!~” | 2 | 12:00, 25 May 2021 |
representing a range by OR! | 2 | 11:51, 25 May 2021 |
Using the like operator for page names | 2 | 16:00, 20 March 2019 |
Issue
When attempting to select pages with multiple values for a property, using the “not like” operator results in unexpected results.
For example:
Page_A has been assigned [[subject::Page_1]] and [[subject::Page_2]] (both showing up correctly in page properties overview)
Querying for ...[[subject::Page_1]] [[Subject::!~Page_2]]... will print Page_A as a result (erroneously imho)
f.e.: {{#ask: [[Category:whatever]] [[subject::Page_1]] [[Subject::!~Page_2]] }}
If it does not work it should be reported at GitHub. It is always best to do with together with a live example on sandbox.semantic-mediawiki.org.
In the example given here, finding "all actors that are between 6 feet and and 7 feet tall" is done through an OR as: [[Category:Actor]] [[height::>6 ft||<7 ft]]
But if I'm not awfully wrong, it should be an AND: actor is ≥ 6ft AND actor is ≤ 7ft
Ahmad is right imho, this is not the "logical" equivalent, in line with the definition of logical disjunction and conjunction. (f.e. https://en.wikipedia.org/wiki/Logical_disjunction). It has nothing to do with semantics, it's straightforward boolean algebra...
I have been trying to use the ~ like operator for page names. For example, to find a page name that starts with NDC, I would do
{{#ask: [[:~NDC*]] |default=none found }}
I can get the like syntax to work for parameters, but not page names. Am I using the wrong syntax or does this simply not work with page names. (Let's not argue for the moment why I would want to do such a thing in the first place :-) )
The help page on single page constaints should provide the answer. I believe it should be:
{{#ask: [[~NDC*]] |default=none found }}
When I start searching for #ask documentation I usually start out on Inline queries, since that's where the glossary page [[1]] takes me. From there, nothing directed me toward the single page constraints page. There seems to be some good and some bad duplication between the inline query and the semantic search pages. In the end "how to query" information is needed in both scenarios. Would it be best to break something like that out into its own and then link to it from both semantic search and from inline query? I am willing to help with this, just trying to figure out where you want to take this.