Fuzzy String Match in Sparql


My question is whether we can use kind of partially match function within our sparql queries. I know it's not particularly related to Stardog and lots of functions are now available here SPARQL 1.1 Query Language, and an effective use of regex does the job. I was still wondering whether any predefined functions etc are already available for string fuzzy match. For instance,
"I'm a student" matches with "I'm a Student" or "I am aa Student" or "I am a Students"
"That's great!" matches with "This is great." or "That's great." or "Great!"
These are just a few examples in which typos, grammatical mistakes or wordings are ignored

Any thoughts or suggestions are appreciated. Thank you

Hi Cesar,

you can try the semantic mode of the Full-text search feature in Stardog which determines the similarity of strings based on their embeddings instead of lexical similarity. However, be aware of the potential impact on indexing performance and memory usage. Depending on your requirements, lexical full-text search might even be sufficient.
Alternatively, there is the stardog-extensions repo with a variety of string similarity functions that you can extend Stardog with. Note that this repo is not an official Stardog repo and it is not maintained by Stardog. If you have more specific requirements, you can also write your own query functions.

Best regards,

1 Like