Hi Clare,

if I understand your scenario correctly then the difference that you describe is because of the Turtle serialization. For any string literal that contains \ Turtle will write \\

As a result, while you edit queries in a form-based editor you just enter \ but when you save to a file or edit Source Code you would see \\

There is nothing wrong about that, and EDG doesn't have to do any automatic conversion.

If I have misunderstood your scenario please send a minimal but complete example, in TTL format.

Regards,
Holger


On 10/26/2020 4:08 AM, Clare Paul wrote:
When I test a query using SPARQL CONSTRUCT and then copy/paste the query to make it part of a sh:SPARQLRule it usually works just fine.

However, if I use an escaped left or right square bracket as part of the REGEX pattern, the CONSTRUCT portion of the SHACL SPARQL rule needs to be edited.

Example: Use pattern to find something like "[4"
SPARQL:
VALUES ?find_pattern {'\\[[0-9]'}

SPARQL Rule:
VALUES ?find_pattern {'\\\\[[0-9]'}

If I use the SPARQL version of the pattern, EDG flags an error when the rule is executed:
Lexical error at line39, column 27. Encountered: "[" (91), after "\'\\"

I believe this has something to do with [ needing to be escaped for REGEX and then the  \  in \[ needing to be escaped for Java.

Would it make sense for EDG to automatically convert \\[ to \\\\[ when encountered in an instance sh:SPARQLRule?

Thanks,
Clare


--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/cc5ff1fd-e230-467b-b187-d0a74c455f43n%40googlegroups.com <https://groups.google.com/d/msgid/topbraid-users/cc5ff1fd-e230-467b-b187-d0a74c455f43n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups "TopBraid 
Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/3cc0723f-81a8-b3aa-63e1-d9d7007868f6%40topquadrant.com.

Reply via email to