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

Adding a bif:contains SearchProperty #480

Closed
ethieblin opened this issue Apr 21, 2023 · 6 comments · Fixed by #491
Closed

Adding a bif:contains SearchProperty #480

ethieblin opened this issue Apr 21, 2023 · 6 comments · Fixed by #491
Labels
kind: Enhancement 📈 New feature or request what: Configuration Related to how the component is configured what: SPARQL generation SPARQL query generation / compatibility

Comments

@ethieblin
Copy link
Contributor

Hello,

We would like to discuss the addition of a new Subclass of SearchProperty, which would look like GraphDBSearchProperty, but for Virtuoso (bif:contains instead of the lucene queries).
This would make Sparnatural a bit more Virtuoso-compatible.
We propose to develop that feature for you, if you agree with the following proposal:

What we were thinking of for that new configuration would be:

  • the terms input by the user would be transformed into a bif:contains query, e.g., if the user types "jean petit", the bif:contains query would become "'jean' and 'petit'": basically a split on the escape chars, quoting every term found that way and joining them with the keyword "and".

This query processing would have the following advantages:

  • instead of having the user learn the quite hard bif:contains syntax (which is not that of a regex, and quite restrictive), it will allow for literal searching whatever the order of the terms are. The "jean petit" input will match with "Petit, Jean - notaire" for example.
  • It will also be possible to write a request like "frédéri* phély*", transformed into "'frédéri*' and 'phély*'" which will allow to match literals having terms starting by "frédéri" and "phély"
@tfrancart tfrancart added kind: Enhancement 📈 New feature or request what: Configuration Related to how the component is configured what: SPARQL generation SPARQL query generation / compatibility labels Apr 21, 2023
@tfrancart
Copy link
Contributor

Sure, go ahead ! See that other discussion on how to implement something similar but for the Jena full-text search syntax, it can give you pointers on where to start: #447

What I will do is that I will create the necessary entries in the configuration ontology for you to plugin the widget code.
But, without waiting for this, what you can do is modify the behavior of the GraphDBSearchWidget so that it generates the query you need:

case Config.GRAPHDB_SEARCH_PROPERTY: {

@tfrancart
Copy link
Contributor

I think you are all set !

@ethieblin
Copy link
Contributor Author

Quick question regarding the contribution: I see there is a "pretty" script in the package, however when I run it, it modifies a lot of files in the repository.
Are there any coding rules (linting, formatting) I should follow to contribute ?

@tfrancart
Copy link
Contributor

I don't use this "pretty" script from the package. Don't use it.
There are no specific rules to follow. I trust your "bon sens". I use VSCode as dev environment.

@ethieblin
Copy link
Contributor Author

ethieblin commented Apr 28, 2023

Hello, I think there is a small typo in the URI of http://data.sparna.fr/ontologies/sparnatural-config-core/VirtuosoSearchProperty in the http://data.sparna.fr/ontologies/sparnatural-config-core, it uses a slash as delimiter but in the code you provided, it uses a #

@tfrancart
Copy link
Contributor

Hello, I think there is a small typo in the URI of http://data.sparna.fr/ontologies/sparnatural-config-core/VirtuosoSearchProperty in the http://data.sparna.fr/ontologies/sparnatural-config-core, it uses a slash as delimiter but in the code you provided, it uses a #

Thanks this is fixed in the ontology

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: Enhancement 📈 New feature or request what: Configuration Related to how the component is configured what: SPARQL generation SPARQL query generation / compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants