Discuss Search operators

From semantic-mediawiki.org

Contents

Thread titleRepliesLast modified
Unexpected behavior selecting pages using search operator “!~”212:00, 25 May 2021
representing a range by OR!211:51, 25 May 2021
Using the like operator for page names216:00, 20 March 2019

Unexpected behavior selecting pages using search operator “!~”

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]] }}

11:21, 25 May 2021

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.

11:52, 25 May 2021

Thank you Karsten. If it's confirmed that this indeed is not the intended result of the query, I will report it as an issue on Github. I'll try to fabricate a live example as well...

12:00, 25 May 2021
 
 

representing a range by OR!

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

00:34, 8 February 2019

It is always possible to contemplate the semantics of AND and OR. :)

21:58, 8 February 2019
 
Edited by another user.
Last edit: 11:51, 25 May 2021

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...

11:16, 25 May 2021
 

Using the like operator for page names

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 :-) )

01:36, 7 November 2018

The help page on single page constaints should provide the answer. I believe it should be:

{{#ask:
 [[~NDC*]] 
 |default=none found
}}
21:54, 8 February 2019

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.

16:00, 20 March 2019