You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Michal Wozniak (JIRA)" <ji...@apache.org> on 2017/06/19 12:40:00 UTC

[jira] [Created] (JENA-1362) SPARQL updates parser produces UpdateRequest which cannot be parsed again

Michal Wozniak created JENA-1362:
------------------------------------

             Summary: SPARQL updates parser produces UpdateRequest which cannot be parsed again
                 Key: JENA-1362
                 URL: https://issues.apache.org/jira/browse/JENA-1362
             Project: Apache Jena
          Issue Type: Bug
          Components: ARQ, Jena
    Affects Versions: Jena 3.1.1
         Environment: Windows / Linux
            Reporter: Michal Wozniak
            Priority: Minor


*Issue*: for SPARQL updates containing a list in WHERE clause, UpdateFactory.create() produces UpdateRequest which cannot be parsed again.

*Investigation*: the following SPARQL update:
INSERT {
  ?label skosxl:literalForm ?labelLiteralPart .
}
WHERE
{
  ?label skosxl:literalForm ?labelLiteral .
  ?labelLiteralPart spif:split (?labelLiteral \" \" )
};

is transformed after UpdateFactory.create().toString() into (which is not a valid SPARQL string):
INSERT {
  ?label skosxl:literalForm ?labelLiteralPart .
}
WHERE { 
    ?label    skosxl:literalForm  ?labelLiteral .
    ?labelLiteralPart spif:split          ??0 .
    ??0       rdf:first           ?labelLiteral ;
                 rdf:rest            ??1 .
    ??1       rdf:first           " " ;
                 rdf:rest            rdf:nil
  }

*Note*: the same issue does not happen for SPARQL queries. For a query, the parsed WHERE clause:
WHERE{ 
    ?label    skosxl:literalForm  ?labelLiteral .
    ?labelLiteralPart spif:split          _:b0 .
    _:b0      rdf:first           ?labelLiteral ;
                  rdf:rest            _:b1 .
    _:b1      rdf:first           " " ;
                  rdf:rest            rdf:nil
  }

*Motivation*: we parse UpdateRequest for two reasons: (1) add USING and WITH clauses to indicate target graph, (2) check validity of SPARQL update itself, getting parser's details, such as line and column in case of a parsingerror. Then, we send it as a string parameter to TBL which executes it in: org.topbraidlive.sparql.servlet.UpdateHandler. Thus, in this flow, each update SPARQL is parsed, serialized and parsed again.







--
This message was sent by Atlassian JIRA
(v6.4.14#64029)