How to insert special characters like &, () and others in Sparql using python?

215 Views Asked by At

I am using this query to insert data:

prefix : <http://www.google.com/abc#>

INSERT DATA
{
     
:some&Data a :ABC .
}

But it is failing because of the &. How can I insert the data into Blazegraph db with special characters? The same query like ```

prefix : <http://www.google.com/abc#>

INSERT DATA
{
     
:someData a :ABC .
}
``` passes without errors. I am using python to insert the data, but even in Blazegraph it fails.```

          ERROR: SPARQL-UPDATE: updateStr=prefix : 


INSERT DATA
{
     
:some&Data a :ABC .
}
java.util.concurrent.ExecutionException: org.openrdf.query.MalformedQueryException: Lexical error at line 7, column 7.  Encountered: "D" (68), after : "&"
0

There are 0 best solutions below