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.errington@sydac.com Folgendes geschrieben:
<!--#yiv6295396231 _filtered #yiv6295396231 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv6295396231 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv6295396231 #yiv6295396231 p.yiv6295396231MsoNormal, #yiv6295396231 li.yiv6295396231MsoNormal, #yiv6295396231 div.yiv6295396231MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", sans-serif;}#yiv6295396231 a:link, #yiv6295396231 span.yiv6295396231MsoHyperlink {color:blue;text-decoration:underline;}#yiv6295396231 a:visited, #yiv6295396231 span.yiv6295396231MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv6295396231 span.yiv6295396231EmailStyle17 {font-family:"Calibri", sans-serif;color:windowtext;}#yiv6295396231 .yiv6295396231MsoChpDefault {font-family:"Calibri", sans-serif;} _filtered #yiv6295396231 {margin:72.0pt 72.0pt 72.0pt 72.0pt;}#yiv6295396231 div.yiv6295396231WordSection1 {}--> 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