Violation of Primary Key Constraint

25 views
Skip to first unread message

GaBriella Branson

unread,
Jan 25, 2023, 8:28:04 PM1/25/23
to TopBraid Suite Users
How do I find the other version of an instance using the same Primary Key? I began getting this error after I deleted and recreated a collection from a TTL file. I'm guessing somehow I didn't remove everything and therefore it now thinks I have a violation. Any suggestions on how to resolve? Thanks in advance!

Holger Knublauch

unread,
Jan 26, 2023, 3:21:02 AM1/26/23
to topbrai...@googlegroups.com
If you have selected one of the instances with a duplicate primary key on the Form, open the SPARQL Query panel and run a query such as

SELECT ?other
WHERE {
$this ex:primaryKeyProperty ?value .
?other ex:primaryKeyProperty ?value .
FILTER (?other != $this).
}

where ex:primaryKeyProperty needs to be the qname of the primary key property.

In the query above, $this is representing the currently selected instance.

HTH
Holger



On 26 Jan 2023, at 1:28 am, 'GaBriella Branson' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:

How do I find the other version of an instance using the same Primary Key? I began getting this error after I deleted and recreated a collection from a TTL file. I'm guessing somehow I didn't remove everything and therefore it now thinks I have a violation. Any suggestions on how to resolve? Thanks in advance!

--
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/3de868b5-feb8-4234-9b94-3b2d93fee665n%40googlegroups.com.

Branson, GaBriella C

unread,
Jan 26, 2023, 7:21:13 PM1/26/23
to topbrai...@googlegroups.com

Thank you, Holger. (I really need to learn SPARQL!)

 

This is what appears:

 

Here is the query:

 

I searched in the TTL and only found one instance. Is there something else I can try?

 

Thanks in advance.

 

GaBriella Branson

Wildland Fire Data Management Program - Knowledge Manager

 

Stay Connected! Sign up to receive  email updates from the Wildland Fire Data Management Program

 

From: topbrai...@googlegroups.com <topbrai...@googlegroups.com> On Behalf Of Holger Knublauch
Sent: Wednesday, January 25, 2023 11:21 PM
To: topbrai...@googlegroups.com
Subject: [EXTERNAL] Re: [topbraid-users] Violation of Primary Key Constraint

 

 

 This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding.  

 

Holger Knublauch

unread,
Jan 27, 2023, 4:57:24 AM1/27/23
to topbrai...@googlegroups.com
Hi GaBriella,

the SPARQL looks almost right, but I strongly suspect you have used the URI of the property *shape* instead of the property itself. So what happens if you replace wfpos:IncidentPosition-positionCode with wfpos:positionCode?

Also, to find all cases, replace $this with ?some

Holger


On 27 Jan 2023, at 12:21 am, 'Branson, GaBriella C' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:

Thank you, Holger. (I really need to learn SPARQL!)
 
This is what appears:<image001.png>
 
Here is the query:
<image002.png>
 
I searched in the TTL and only found one instance. Is there something else I can try?
 
Thanks in advance.
 
GaBriella Branson
Wildland Fire Data Management Program - Knowledge Manager
 
<image003.png>
Reply all
Reply to author
Forward
0 new messages