Semanticmediawiki: Selecting pages with regular expressions

Created on 5 Mar 2021  路  4Comments  路  Source: SemanticMediaWiki/SemanticMediaWiki

Is it possible to select pages (in e.g. inline queries) via regular expressions?
I'm currently only aware of the search operators ~ and !~ (and like: and nlike: since SMW 3.0) and while these certainly help to cover a lot of use cases, they're still somewhat limited compared to regular expressions.

In case this isn't possible at the moment, are there any plans to integrate this into future versions of SMW or is it unlikely that we'll see an implementation because of e.g. security concerns like ReDoS?

feature question

All 4 comments

I'm not aware of any plans for implementing this at the moment. @kghbln ?

There is no plan for implementing regular expressions in queries. SMW always aim to make ASK queries features equivalent among backends (SQL, Triplestores, Elastic), so I think implementing regular expressions would not be an easy task (although it would be really cool to have it).

Not an ASK query, but you can search with regular expressions with Replace text extension.

You might use the the workaround https://www.semantic-mediawiki.org/wiki/Architecture_Tradeoffs and use a mySQL query using requlare expressions. I also intend to make multiple query options available in https://github.com/BITPlan/pyWikiCMS and https://github.com/WolfgangFahl/py-3rdparty-mediawiki - feel free to add an issue with a feature request there.

Was this page helpful?
0 / 5 - 0 ratings