I am trying to create my own property rules in fuseki. To do so I am using
the Generic Rule Reasoning that allows me to use my own rules. When I use
this strategy with my rules in a file everything works fine:
:model_inf a ja:InfModel ;
ja:baseModel :tdbGraph ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/GenericRuleReasoner> ;
ja:rulesFrom <file://...> ;
] .
However, I would not want to use a file but add the rules directly as a
string. I tried just to copy the content of the rule files that worked in
the example above, but the repository was not created, apparently due to
special characters (e.g. #, \n...):
:model_inf a ja:InfModel ;
ja:baseModel :tdbGraph ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/GenericRuleReasoner> ;
ja:rule "[${string_rules_variable}]"`;
] .
where ${string_rules_variable} (javascript string interpolation) contains
the rules read from the file.
So, what am I doing wrong? I believe this is about escaping special
characters, if so, what would be the way to resolve it?
At.te,
Marcelo de Oliveira Costa Machado