0

I need some help removing an entry from my fuseki server

For example, how can I remove this entry?

<http://person/Test1>
    <http://purl.org/dc/elements/1.1/name> "Test1" ;

This is what I've tried, but it's not working...

public void deletePerson(String[] personalData ) {
        String personURI    = "http://localhost:3030/Date";
        String name = personalData[0];
        String query = "DELETE WHERE { <http://person/" + formattedName + "> }";
        QueryExecution qe = QueryExecutionFactory.sparqlService(
                "http://localhost:3030/Date/query",
                "PREFIX dc: <http://purl.org/dc/elements/1.1/> " + query);
    }

Exception in thread "AWT-EventQueue-0" com.hp.hpl.jena.query.QueryParseException: Encountered " "DELETE WHERE "" at line 1, column 47. Was expecting one of:
"base" ...
"prefix" ...
"select" ...
"describe" ...
"construct" ...
"ask" ...

1 Answers1

1

I think you should use UpdateExecutionFactory Something like that

 UpdateRequest request = UpdateFactory.create(queryString) ;
            UpdateProcessor proc = UpdateExecutionFactory.create(request, graphStore) ;
  • like this : String name = personalData[0]; String query = "DELETE WHERE { }"; UpdateRequest request = UpdateFactory.create(query); UpdateExecutionFactory .createRemote(request, "http://localhost:3030/Date/query", "PREFIX dc: "); – Zineb Errahmouni Jun 09 '17 at 15:55
  • "It's not working" is **not** meaningful! What does not work? And a bit of Java skills have to be provided by yourself - documentation is here: https://jena.apache.org/documentation/query/update.html And by the way, you sample code does not work, you have a Java object `name` but use an unknown Java object `formattedName` - that's for sure wrong. – UninformedUser Jun 09 '17 at 19:27
  • I can't help with the code but an update isn't going to work against the query endpoint anyway. It's probably http://localhost:3030/Date/update but check the config file to be sure. – chrisis Jun 10 '17 at 14:55