Skip to main content

levenshtein_distance

A string comparison function to estimate the similarity between two strings. The result of this function is the number of edit operations (insertions, deletions, or modifications) to convert one string into another. A full discription of the Levenshtein distance function can be found here.

Parameter

Type

x

string

y

string

Returns: Integer

Example

Query:

PREFIX : <https://ddw-doccorp.linked.data.world/d/sparql-function-sample-queries/>
PREFIX fn: <http://data.world/function/functions#>

SELECT (fn:levenshtein_distance("foobar", "boofar") AS ?levenshtein_distance)
{
}

Run query

Results:

levenshtein_distance

2