OSLC Query with double quote
2 answers
Unfortunately the OSLC Query specification (https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html) does not define any mechanisms for quoting characters in string values. The specification does permit implementations to support wildcards, but implementations may choose not to do so - see Section7.2.3 oslc.where Semantics. For example, a query expresssion
dcterms:title="This value%11%"
might be supported and might match a value such as
This value "11"
. Currently there is no way to discover at run time whether a server supports this capability. A client can try a particular server to see if the request succeeds and produces what it is wanted. Some implementations might have supported "*" as a wildcard, but such usage was never part of any OSLC specification.
Comments
I was mistaken about quoting. The spec says this:
The
string_esc
term represents an arbitrary sequence of characters. The sequence of characters is enclosed in double quote (") characters. Therefore, the double quote character itself MUST be escaped. More generally, all occurrences of the double quote character in the string MUST be replaced by the sequence \" and all occurrences of the backslash character \ in the actual value MUST be replaced by the sequence \ in the escaped value. This escaping process MUST be reversed to give the actual value of the string. [QUERY-22]
string_esc
term represents an arbitrary sequence of characters. The sequence of characters is enclosed in double quote (") characters. Therefore, the double quote character itself MUST be escaped. More generally, all occurrences of the double quote character in the string MUST be replaced by the sequence \" and all occurrences of the backslash character \ in the actual value MUST be replaced by the sequence \\ in the escaped value. This escaping process MUST be reversed to give the actual value of the string. [QUERY-22]
It only applies to string literal values in
oslc.where
query expressions. The spec shows the syntax (excerpted):
value ::= uri_ref_esc | PrefixedName | literal_value uri_ref_esc ::= / an angle bracket-delimited URI reference in which > and \ are -escaped. / literal_value ::= boolean | decimal | string_esc (LANGTAG | ("^^" PrefixedName))? boolean ::= "true" | "false" decimal ::= / see "XML Schema Part 2: Datatypes Second Edition", http://www.w3.org/TR/xmlschema-2/ / string_esc ::= / a string enclosed in double quotes, with certain characters escaped. See below. / LANGTAG ::= / see "SPARQL Query Language for RDF", http://www.w3.org/TR/rdf-sparql-query/#rLANGTAG /
This type of query where embedded " is escaped as \" certainly works with DOORS Next 7.0.2 iFix009. Note the comparison is case-sensitive and so must precisely match the title you're searching for.
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 19 '22, 7:50 a.m.