I am building an application where users can upload a RDF file containing their data and a corresponding metadata file (XML format) describing some stuff about the data they are uploading.
I will give them a dtd which they will follow to create the XML file.
Now I want to store this information, so that whenever somebody requests for RDF data I can retrieve and display the corresponding metadata from the XML file.
I was thinking when users will upload XML file, I will parse it and store the data in MySql database. Now I am not sure if I should
- store the XML files as blobs? or
- extract individual info by parsing the file and store it? XML files would be pretty small as they are only metadata.
Thanks!
The short answer is that if you plan on using any individual data items from the XML in database queries, either in the columns to be selected or (more importantly) in the WHERE clause, it’s worth creating a table or tables that map to the file and extracting the data and storing it atomically in the relational database.
It sounds like in your case, given your comment, that you’ll want to parse the XML file and store the individual data in the database.