EDG insert object with delete

27 views
Skip to first unread message

Kasia Kryczka

unread,
May 18, 2023, 5:20:18 AM5/18/23
to TopBraid Suite Users
Hi,

I would like to replace an object with a new object via following query (I'm using EDG):

DELETE {
  ?s ?p ?o .
}
INSERT {
 ?s ?p ?newO .
}
#SELECT DISTINCT ?o ? newO
WHERE {
  ?s ?p ?o .
   
  FILTER(STRSTARTS(STR(?o), "urn:") && STRENDS(STR(?o), "_P_Q"))
  BIND(REPLACE(STR(?o), "^(.*)ttt:(.*)_P_Q$", "$2") AS ?newOB)
  BIND(IRI(CONCAT("urn::", ? newOB  , "_Q")) AS ?newO)      
}

but i get the following error:
Failed to execute SPARQL request: org.apache.jena.graph.Node$NotLiteral: urn:_P_Q is not a literal node

Could you tell how I can correct it?

Thanks,

Kasia

Holger Knublauch

unread,
May 18, 2023, 6:34:44 AM5/18/23
to topbrai...@googlegroups.com
I don't see anything obviously wrong (although you may want to fix the last line to be

  BIND(IRI(CONCAT("urn:", ?newOB, "_Q")) AS ?newO)       

i.e. drop the duplicate ::

Was there anything else in the error message or log, i.e. a full stack trace? It is hard for me to try this out without having suitable instance data.

Holger


--
The topics of this mailing list include TopBraid EDG and related technologies such as SHACL.
To post to this group, send email to topbrai...@googlegroups.com
---
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/989ec7ed-73a4-4bd6-90b1-98fff87c05b0n%40googlegroups.com.

Kasia Kryczka

unread,
May 18, 2023, 9:43:24 AM5/18/23
to TopBraid Suite Users
Hi Holger,

no, only error #500 and this information.

Br,

Kasia

Holger Knublauch

unread,
May 18, 2023, 10:03:17 AM5/18/23
to topbrai...@googlegroups.com
Ok so would you be able to share a couple of instances where this is supposed to return something?

Also, does the SELECT variation work?

Holger


Kasia Kryczka

unread,
May 18, 2023, 10:28:52 AM5/18/23
to TopBraid Suite Users

The Select or Construct works fine  and shows everything but Insert doesn't work.

So we made backup in one instance and we wanted to restore data in the second instance and we needed to modify roles.

i also check the query on one more instance and it worked but on this testing one it shows this error.

Br,

Kasia

Holger Knublauch

unread,
May 19, 2023, 5:17:09 AM5/19/23
to topbrai...@googlegroups.com
Hi Kasia,

sorry I cannot think of a reason for this problem. Unless you can send me sample data to run this against, I am not sure how I could help further.

Thanks,
Holger


Kasia Kryczka

unread,
May 19, 2023, 7:42:35 AM5/19/23
to TopBraid Suite Users
Hi Holger,

We'll try to check it again on our end and if it doesn't help we'll share some data.

Thank you!

Kasia

Reply all
Reply to author
Forward
0 new messages