Hello Hans,

Both would be great! The ideal functionality would obviously be to prevent bad 
data ever entering the database, and so this would need some sort of pre-commit 
validation.
If the only possibility though is to analyse constraints on demand, once the 
data is in the database, then that is still better than nothing.

Kind Regards,
Luke


From: Hans-Juergen Rennau <hren...@yahoo.de>
Sent: Thursday, 12 December 2019 7:16 PM
To: basex-talk@mailman.uni-konstanz.de; ERRINGTON Luke 
<luke.erring...@sydac.com>
Subject: Re: [basex-talk] BaseX and validating the entire database

How very interesting, Luke! Answers will come from other people, but may I ask 
a question?

Which is this: are you only interested in checks of referential constraints 
performed as guards, before insertion, or would it be at least of some value to 
have possibilities of analyzing existing db contents and reporting any 
violations?

Thanks, cheers -
Hans

Am Donnerstag, 12. Dezember 2019, 03:08:34 MEZ hat ERRINGTON Luke 
<luke.erring...@sydac.com<mailto:luke.erring...@sydac.com>> Folgendes 
geschrieben:



Hello,



We are evaluating moving from an RDBMS (Oracle), to BaseX as much of our source 
data originate in XML files and converting to tables in a relational schema is 
painful. In general BaseX looks great!



However, one thing that we lose is referential integrity, and the ability to 
validate data in one XML file that is referring to data in another. Are there 
any possibilities within BaseX or an additional module that can do this?



For example:

•             Can we validate using a schema that applies across a collection 
of documents, rather than just one?

•             Can we use Schematron (which looks cool) to apply its inteRnal 
XPaths to the entire collection of documents?

•             Or both?

•             Something else?



We could try using XLinks, but that would involve changing our XML 
data/structure, and my understanding is that BaseX doesn’t support (let alone 
validate) them, anyway.



A situation I have in mind is something like (very, very simplified):



A.xml

<object id=”1” name=”One”>

</object>



B.xml

<object id=”2” name=”Two”>

</object>



X.xml

<mapping object_from_id=”1” object_to_id=”2” />



Is there any way to ensure that when X.xml is added to the database that the 
object IDs that it is referring to actually exist in the database too?

I would also like to be able to ensure that all of the <object>s in the 
database have unique id attributes. A schema can do this within a file, but how 
can I ensure that when a new object xml file is added that it is not using an 
ID that already exists?



Thanks for any answers,

Luke


Reply via email to