Open nvbach91 opened 5 years ago
Hi, is it possible to use SPARQL Filter to match strings with Regex?
Something like
const context = { 'Company': `http://ontology.com/Company`, 'name': `http://ontology.com/hasName`, 'Name': `http://ontology.com/Name`, 'a': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'value': `http://ontology.com/hasStringValue` };
const query = ` { id ... on Company { name(a:Name) { value(first:20 regex:"/corp/i") } } } `;
PREFIX o: <http://ontology.com/> SELECT ?id ?name_value WHERE { OPTIONAL { ?id a o:Company . { SELECT * WHERE { ?id o:hasName ?name . ?name a o:Name . ?name o:hasStringValue ?name_value . FILTER REGEX(?name_value, "corp", "i") . } LIMIT 20 } } }
Thanks in advance. Btw, I'm your fan!
Not possible at the moment, but this has been on my todo-list for a while, so this is definitely coming in the future! :-)
Hi, is it possible to use SPARQL Filter to match strings with Regex?
Something like
Thanks in advance. Btw, I'm your fan!