issue inserting new triples via SPARQL endpoint

51 views
Skip to first unread message

Justin Lien

unread,
Nov 16, 2020, 7:18:46 PM11/16/20
to topbrai...@googlegroups.com, Kristian Del Rosario
Hello,

I'm attempting to insert new triples via the SPARQL endpoint using the following query:
 
INSERT DATA
    { GRAPH <urn:x-evn-master:update_test> { update_test:concepts
        skos:hasTopConcept  update_test:one .
    update_test:one  skos:prefLabel  "one" . } }
WHERE { ?s ?p ?o }

and receive the following error:

**Invalid SPARQL query string: Encountered " <INSERT_DATA> "INSERT DATA "" at
line 5, column 1. Was expecting one of: "base" ... "prefix" ... "select" ...
"json" ... "describe" ... "construct" ... "ask" ... .**

We have Enable SPARQL updates set to true in the Server Configuration Parameters and I'm also able to add triples with a slightly modified query 

INSERT
{
    update_test:concepts
        skos:hasTopConcept  update_test:six .
    update_test:six skos:prefLabel  "six" .
  }
WHERE {
  ?s ?p ?o .
}

using the SPARQL query feature in the taxonomy without issue.

Any ideas on how to resolve?

Thank you,

Justin


This email and any attachments may contain confidential information. If you believe that you have received it in error, please delete the email and attachments and then notify Tempus by calling 800.739.4137.

Holger Knublauch

unread,
Nov 16, 2020, 7:25:13 PM11/16/20
to topbrai...@googlegroups.com

Hi Justin,

INSERT DATA is not followed by a WHERE clause - just try removing that WHERE line - none of the variables there are used in the INSERT clause anyway.

https://www.w3.org/TR/2013/REC-sparql11-update-20130321/#insertData

It probably fails to parse this on its first attempt and then falls back to trying the query parser, thus the error message.

Holger

This email and any attachments may contain confidential information. If you believe that you have received it in error, please delete the email and attachments and then notify Tempus by calling 800.739.4137. --
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CANbmBy7EJaedhytxVLCvxy2Gz-MQpSvRDG1RPNXEw5u0Nmo1CA%40mail.gmail.com.

Justin Lien

unread,
Nov 17, 2020, 11:13:20 AM11/17/20
to TopBraid Suite Users
Hi Holger,

Thanks for your response. I tried removing the WHERE line but unfortunately I'm still receiving the same error as before. 

Justin

Holger Knublauch

unread,
Nov 17, 2020, 6:07:00 PM11/17/20
to topbrai...@googlegroups.com

To clarify, how are you running this query - are you making web service calls or do you go through the Web UI? Maybe the prefix definitions are missing and the parsing fails? Can you make the INSERT DATA variation work from the web UI?

Holger

Justin Lien

unread,
Nov 17, 2020, 6:57:43 PM11/17/20
to TopBraid Suite Users
Hi Holger,

I actually just figured it out; it was user error. I was accidentally hitting to the query endpoint instead of the update endpoint. Everything works as expected now.

Thank you!

Justin
Reply all
Reply to author
Forward
0 new messages