Unable to retrieve literal with invalid language tag

Description

I have accidentally added literal with invalid language tag to http repository and whenever it would be returned from query I get error. To reproduce:

1 2 3 4 5 6 7 8 9 10 11 HTTPRepository httpRepository = new HTTPRepository("http://localhost:8080/openrdf-sesame/", "TEST"); httpRepository.initialize(); RepositoryConnection connection = httpRepository.getConnection(); connection.add(connection.getValueFactory().createBNode(), RDFS.LABEL, connection.getValueFactory().createLiteral("Fooo", XMLSchema.STRING.stringValue())); System.out.println("Added"); RepositoryResult<Statement> statements = connection.getStatements(null, null, null, true); for (Statement statement : statements.asList()) { System.out.println(statement.getSubject().stringValue() + " " + statement.getPredicate().stringValue() + " " + statement.getObject().stringValue()); }

Generates:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Added 2012-04-27 13:53:32 org.openrdf.rio.helpers.ParseErrorLogger error WARNING: [Rio error] Expected '}', found ':' (5, -1) Exception in thread "main" org.openrdf.repository.RepositoryException: Malformed query result from server at org.openrdf.http.client.HTTPClient.getRDF(HTTPClient.java:1169) at org.openrdf.http.client.HTTPClient.getStatements(HTTPClient.java:676) at org.openrdf.repository.http.HTTPRepositoryConnection.exportStatements(HTTPRepositoryConnection.java:283) at org.openrdf.repository.http.HTTPRepositoryConnection.getStatements(HTTPRepositoryConnection.java:269) at Lang.main(Lang.java:33) Caused by: org.openrdf.rio.RDFParseException: Expected '}', found ':' [line 5] at org.openrdf.rio.helpers.RDFParserBase.reportError(RDFParserBase.java:497) at org.openrdf.rio.turtle.TurtleParser.reportError(TurtleParser.java:1096) at org.openrdf.rio.turtle.TurtleParser.verifyCharacter(TurtleParser.java:996) at org.openrdf.rio.trig.TriGParser.parseGraph(TriGParser.java:147) at org.openrdf.rio.trig.TriGParser.parseStatement(TriGParser.java:89) at org.openrdf.rio.turtle.TurtleParser.parse(TurtleParser.java:184) at org.openrdf.rio.turtle.TurtleParser.parse(TurtleParser.java:129) at org.openrdf.http.client.HTTPClient.getRDF(HTTPClient.java:1163) ... 4 more

The connection.getValueFactory().createLiteral("Fooo", XMLSchema.STRING.stringValue()) is clearly invalid but it was added successfully but subsequent retrieval fails. It would be better to fail earlier during insert, because now repository ends "broken" and for example workbench export functionality do not work.

Environment

Windows Vista

Status

Assignee

Jeen Broekstra

Reporter

Grzegorz Abramczyk

Labels

None

Components

Fix versions

Affects versions

2.6.5

Priority

Minor
Configure