Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no such function in standard SPARQL. However, SPARQL is extensible, so you can add your own functions if you want (of course, at the price of losing portability of your query). For example, see this <a href="http://rivuli-development.com/further-reading/sesame-cookbook/creating-custom-sparql-functions/" rel="nofollow">tutorial on how to do this in Sesame's SPARQL engine</a>. </p> <p>I also imagine that some triplestores with extended support for full-text search (like OWLIM, or Virtuoso) may have some built-in support for this kind of thing, but I do not know this for sure.</p> <p><strong>Edit</strong> </p> <p>Assuming you want something like Levenshtein distance, you could have a function <code>ex:ldistance(?string1, ?string2)</code> that given two strings outputs the distance. So <code>ex:ldistance("room", "root")</code> would return 1, <code>ex:ldistance("room", "door")</code> would return 2, and so on. You could then use this to query for a given distance, e.g. to get all strings that are closer than 2 to "room":</p> <pre><code>SELECT ?x ?string1 WHERE { ?x rdfsl:abel ?string1 FILTER(ex:ldistance("room", ?string1) &lt; 2) } </code></pre> <p>or returning all matching strings ordered by their distance:</p> <pre><code>SELECT ?x ?string1 ?ldistance WHERE { ?x rdfsl:abel ?string1 BIND ( ex:ldistance("room", ?string1) as ?ldistance) } ORDER BY ?ldistance </code></pre> <p>However, as said, the function <code>ex:ldistance</code> does not actually exist in SPARQL, so you will need to create it yourself, as an extension. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload