|
hi all, I have a disease class and a datatype property "complication" //range is string Can anyone please help me by providing me the SPARQL query to find all complications that contains some specified string like "abc". same as "like operator in sql" |
|
You should use
See the specification for It works... thanks Rob Vesse♦ for the sample code and explanation. Actually, you might not need the STR clause for a couple of reasons, 1 that the property in question is a datatype property and 2 the range of that property is a string, so if the data is being reasoned over at query time or creation time, then the reasoner will infer that the value is of type string (or it might blow up if its not). Its probably good practice to keep it in, but there might be an overhead in performance. Additionally, if the value is a URI and we know that property is a datatype property, then chances are the assertion is a mistake and logically you would want it ignored by the filter, not explicitly casted to a string, matched and included in a result. It depends whether you want to regex within a URI or not. Even if something is inferred to be a string i.e. According to the spec, it should operate the same as a fn:matches which in turn operates as follows: $input as xs:string?, $pattern as xs:string Think it might be casting anyway??? So it will probably end up being implementation specific??? Thanks Rob! There is no automatic casting from IRIs to strings.
showing 5 of 7
show 2 more comments
|
You can play around with the regex as much as you want. |

