Wimmics/corese

Insert query fails if local name contains an "@"

frmichel opened this issue · 0 comments

Hi @remiceres.

Issue Description:

Using Corese server 4.5.0 jar version.
Submitting query:

PREFIX ma: <http://www.w3.org/ns/ma-ont#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX schema: <http://schema.org/>
PREFIX sd: <http://www.w3.org/ns/sparql-service-description#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX api: <http://ns.inria.fr/sparql-micro-service/api#>
@prefix ns2: <https://flickr.com/photos/> .
@prefix ns1: <http://localhost/ld/flickr/photo/> .
@prefix ns3: <https://farm6.staticflickr.com/5689/> .
@prefix ma: <http://www.w3.org/ns/ma-ont#> .
@prefix api: <http://ns.inria.fr/sparql-micro-service/api#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

INSERT DATA { 
  GRAPH <http://localhost/service/resp-graph-65c25bb204ca31.43833646> {
     
    ns1:31173091246 schema:author ns2:10770266@N04 ;
      schema:contentUrl <https://farm6.staticflickr.com/5689/31173091246_fffc2c9f36_z.jpg> ;
      schema:dateCreated "2016-11-24 06:43:25" ;
      schema:description "" ;
      schema:fileFormat "image/jpeg" ;
      schema:keyword "taxonomy:binomial=delphinusdelphis" ;
      schema:mainEntityOfPage <https://www.flickr.com/photos/10770266@N04/31173091246/> ;
      schema:name "Delphinus delphis 3 (13-7-16 San Diego)" ;
      schema:thumbnailUrl <https://farm6.staticflickr.com/5689/31173091246_fffc2c9f36_q.jpg> ;
      a schema:Photograph .
    
    ns2:10770266@N04 schema:identifier "10770266@N04" ;
      schema:name "" ;
      schema:url ns2:10770266@N04 ;
      a schema:Person .
} }

Corese returns:

2024-02-06 16:17:54 ERROR webservice.SPARQLRestAPI.updateTriplesDirect:904 [] - Error while querying Corese SPARQL endpoint
fr.inria.corese.sparql.exceptions.QuerySyntaxException: fr.inria.corese.sparql.triple.javacc1.JavaccParseException: Encountered "@N" at line 20, column 47.

This corresponds to ns2:10770266@N04.

Steps to Reproduce:

The query is submitted with HTTP "POST directly" method, not with the URL-encoded POST.
Problem occurs in Corese server 4.5.0 jar version.
This is working with Corese server 4.4.1.