Entering Resource Strings contianing backslashes


#1

Hi

I’m trying to enter a string that represents a directory path which contain backslashes and cannot find a way to enter a single backslash. I’ve tried various options without success. For example I want to enter the value:

“\server\dir1\dir2” - when I use
insert $x isa server has path “\server\dir1\dir2”; I get the value “\serverdir1dir2”. I’ve tried escaping and other options but without success. Can you advise how this can be done in a single string value?

Regards
Dave


#2

Hi Dave,

An escaped backslash should do it, like so:

insert $x isa server has path “\\server\\dir1\\dir2”;

Let me know if this works!


#3

Hi Felix

I tried this but I end up with two backslashes in all cases:

$x id “2433088” isa server; $y val “\server\dir1\dir2” isa path; (note that this post is removing the second \ which is visible on the output on screen from Graql)

I’m looking for two backslashes at the start with one for each directory but I’m getting two in all cases in this example.

Regards
Dave


#4

Hi @dave_man That is actually just a question of how the string is rendered. You have to escape each backlash you use, and the response in the shell will actually show the escaping backslash. Using the dashboard will show you how the string looks when rendered.


#5

Hi

Ok - I understand - thanks.

Regards Dave