db obfuscation how-to?

3 views
Skip to first unread message

Peter Neorr

unread,
Mar 31, 2016, 9:54:58 PM3/31/16
to Stardog
Hello All,

I'm looking for guidance on using the 'stardog data obfuscate' command.  I only want to obfuscate the string literals, not URIs, so that I will be able to still query the data later.  But I can't seem to get the -config option working.  Some googling around led me to some example config files such as this one:

However, when I use this config (unchanged) I always get the error shown below.  

> stardog data obfuscate --format TRIG super-secret-data output.trig --named-graph=ALL -config obfuscation.ttl
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
There was an error parsing the obfuscation configuration for the export

I saw another post suggesting I try the obsConfig.ttl that came with my distro.  I found one bundled with an older v3.0 distribution and that produced the same error.  My v4.0.3 distro doesn't seem to include an example.

Any hints or tips are appreciated. 

Regards,
Peter Neorr

Zachary Whitley

unread,
Apr 1, 2016, 9:07:58 AM4/1/16
to Stardog
it looks like there's only a single dash on the 'config' option. Should be a double dash '--config'.



--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Zachary Whitley

unread,
Apr 1, 2016, 9:36:49 AM4/1/16
to Stardog
I also noticed that there is a "=" in the '--named-graph' that according to the docs shouldn't be there. It is possible that the cli argument parsing lib being used accepts an equals.  I ran the command that you sent with adding the dash and it didn't complain but I'm not sure what the command might be doing with that option so it might not be doing what you expect.

see 'stardog help obfuscate' for the correct argument construction

The following construction works for me and follows the format in the help file.

$> stardog data obfuscate --config obfuscation.ttl --format TRIG --named-graph ALL -- super-secret-data output.trig


Peter Neorr

unread,
Apr 1, 2016, 10:35:09 AM4/1/16
to sta...@clarkparsia.com
Thanks for the extra set of eyes Zachary.  

However, your construction gives me the same error:

> stardog data obfuscate --config obsfuscation.ttl --format TRIG --named-graph ALL -- super-secret-data output.trig
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
There was an error parsing the obfuscation configuration for the export

I'm am using windows.  I wonder if there any funny business happening with how my "shell" is handling command line arguments.  

Anyway, I'm going to switch strategies and see if I can just use a sparql query to change every string literal in my database to "foobar".  That might work for my purposes.

Thank You,
Peter Neorr



Zachary Whitley

unread,
Apr 1, 2016, 11:22:45 AM4/1/16
to Stardog
Just a sec. seems like I got something wrong as well. (I have to pass a user/password) and I must have messed something up. It's working there's just something a little off.

Zachary Whitley

unread,
Apr 1, 2016, 11:25:25 AM4/1/16
to Stardog
What is the exact command you're sending? Are you running it under cmd.exe or cygwin bash?

Zachary Whitley

unread,
Apr 1, 2016, 11:30:38 AM4/1/16
to Stardog
Sorry for the obvious question but is the obfuscation.ttl configuration file in the same directory where you're running the command? If it can't find the config file it will print "There was an error parsing the obfuscation configuration for the export" rather than a "file not found".



Peter Neorr

unread,
Apr 1, 2016, 11:34:55 AM4/1/16
to Stardog
No problem.  Yes the config file is in the same directory.  I'm using cmd.exe.  The exact command is:
   stardog data obfuscate --config obsfuscation.ttl --format TRIG --named-graph ALL -- cyber-reasoner output.trig

On a side note, although I would eventually really like to be able to use the obfuscate feature, my alternative strategy of using sparql to update every xsd:string to "foobar" worked pretty well.  

-Peter

Zachary Whitley

unread,
Apr 1, 2016, 11:58:22 AM4/1/16
to Stardog
Looks like I made a typo in the config file name. It should be  "obfuscation.ttl" not "obsfuscation.ttl. My bad. 

Peter Neorr

unread,
Apr 1, 2016, 12:06:49 PM4/1/16
to Stardog
Oops.  I was making the same mistake.  But it doesn't matter.  Same error for me after fixing it:
  >stardog data obfuscate --config obfuscation.ttl --format TRIG --named-graph ALL -- cyber-reasoner output.trig
  ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
  There was an error parsing the obfuscation configuration for the export

-Peter

Zachary Whitley

unread,
Apr 1, 2016, 12:16:42 PM4/1/16
to Stardog
Ok, I think I've got it. Try passing the full path to the config file. This doesn't work for me

    stardog data obfuscate --config obfuscation.ttl --format TRIG --named-graph ALL -- mydb output.trig

but

    stardog data obfuscate --config /home/myhome/downloads/obfuscation.ttl --format TRIG --named-graph ALL -- mydb output.trig

works

Peter Neorr

unread,
Apr 1, 2016, 1:34:10 PM4/1/16
to sta...@clarkparsia.com
Eureka!  That was it!  Using the full path to the config file worked for me too.
Thanks a million!
-Peter 
Reply all
Reply to author
Forward
0 new messages