Sparqlify icon indicating copy to clipboard operation
Sparqlify copied to clipboard

Regex: Case (in)sensitivity flag ignored

Open Aklakan opened this issue 11 years ago • 3 comments

Select * {
?s a owl:Class . 
?s rdfs:label ?l
Filter(regex(str(?s), 'school', 'i'))
}

Aklakan avatar Dec 11 '14 16:12 Aklakan

(how) can I convert the literals into lower case during the conversion process? using fn:lower-case?

amrapalijz avatar Nov 24 '15 00:11 amrapalijz

Don't know if there is a fn:lower-case built in, but you could also use Postgres' lower(...) function in the From query. Like so:

Create View foo As
  Construct {
    ?foo a Bar .
  }
  With
   ?foo = uri(blah: ?lower_sth)
  From
    [[SELECT lower(sth) AS lower_sth FROM sometable]]

patrickwestphal avatar Nov 24 '15 09:11 patrickwestphal

Prefix geo: http://geo.bio2rdf.org/ Prefix dcterms:http://purl.org/dc/elements/1.1/ Prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# Prefix rdfs: http://www.w3.org/2000/01/rdf-schema# Prefix xsd: http://www.w3.org/2001/XMLSchema# Prefix fn:http://aksw.org/sparqlify/

Create View Template geo As Construct { ?s geo:gsmID ?l1. ?s geo:characteristic ?l2. ?s geo:characteristic ?l3. } With ?s = uri(concat("http://geo.bio2rdf.org/", ?1)) ?l1 = plainLiteral(?1) ?l2 = plainLiteral(?2) ?l3 = plainLiteral(?3)


Above is my mapping file. I want to convert actually the literals (l2, l3) to lower case.

amrapalijz avatar Nov 24 '15 19:11 amrapalijz