Ticket #1738 (closed: fixed)
Create XSD schema file for Instrument definitions and other XML
Reported by: | Freddie Akeroyd | Owned by: | Mike Thomas |
---|---|---|---|
Priority: | critical | Milestone: | Release 3.0 |
Component: | Framework | Keywords: | Maintenance |
Cc: | campbellsi@…, michael.thomas@… | Blocked By: | |
Blocking: | #6106 | Tester: | Gesner Passos |
Description (last modified by Anders Markvardsen) (diff)
This would allow validation of files both before and during mantid loading and also be a source of documentation on the format.
Edit: Other XML in Mantid that should (perhaps) get XSD:
- BoxController XML
- Grouping files XML
Change History
comment:2 Changed 10 years ago by Nick Draper
- Owner changed from Freddie Akeroyd to Anders Markvardsen
- Status changed from new to assigned
comment:3 Changed 10 years ago by Nick Draper
- Milestone changed from Iteration 27 to Iteration 28
Bulk move of tickets at the end of iteration 27
comment:4 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 28 to Iteration 29
Bulk move of tickets at the end of iteration 28
comment:5 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 29 to Iteration 30
Accepted and assigned tickets moved at iteration 29 code freeze
comment:6 Changed 9 years ago by Anders Markvardsen
- Cc A.J.Markvardsen@… added
- Owner changed from Anders Markvardsen to Anyone
Definitely a useful ticket to complete, although not critical for the running of Mantid, but is struggling to fit this ticket in at the moment
comment:7 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 30 to Iteration 31
Bulk move of tickets to iteration 31 at the iteration 30 code freeze
comment:8 Changed 9 years ago by Anders Markvardsen
- Owner changed from Anyone to Karl Palmen
Please note that to complete this ticket the XML schema does not need to cover all aspects of instrument definition langauge initially. Although first version must cover the concept that any number of <component>'s can be a child of a <type> but the other way around, and a <component> is required to contain at least one <location> element.
Further it would be useful if a XML schema could be used to spot if a user adds an attribute to say a <location> element which is not one of those recognised by Mantid a warning is display to the user. This would help the debugging of wrongly typed IDF files.
For now put the schema in the instrument directory. Name it IDFschema dot either xsd or dtd (likely xsd is used).
Note it would likely make sense that the some implementation for reading schema into mantid used in #3780 should be used for this ticket and visa verca.
comment:9 Changed 9 years ago by Owen Arnold
Our API for XML processing (POCO) does not seem to support schemas. This seems to me to be a major limitation. I don't know if this is available in newer versions of the Framework? #3780
comment:10 Changed 9 years ago by Karl Palmen
I've found on the POCO website http://pocoproject.org/documentation/index.html in the 3rd slide of http://pocoproject.org/slides/170-XML.pdf that Schemas are not supported by POCO.
comment:11 Changed 9 years ago by Anders Markvardsen
- Owner changed from Karl Palmen to Nick Draper
Karl has found:
- Boost does not support schemas
- A possible XML schema library we may use is Apache Xerces
Note this ticket is like a 2-3 week job, where the most important step is to find and integrate a suitable xml schema reading libraty
comment:12 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 32 to Iteration 33
Moved to iteration 33 at iteration 32 code freeze
comment:13 Changed 9 years ago by Janik Zikovsky
- Description modified (diff)
- Summary changed from Create XSD schema file for Instrument definitions to Create XSD schema file for Instrument definitions and other XML
comment:14 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.1 to Release 2.2
Moved at end of release 2.1
comment:15 Changed 8 years ago by Russell Taylor
- Cc campbellsi@… added
The subject of this has been raised again over here. It looks as though the previous investigation got hung up over the lack of support for schema validation in Poco. It's not obvious to me that we necessarily need runtime validation. It seems as though, with a schema in place, we could have a set of automated tests that validated all of the IDFs that we will ship via external means (i.e. outside of Mantid).
comment:16 Changed 8 years ago by Owen Arnold
I second Russell's proposal.
This sort of functionality is well supported in Java and .Net, so one possibility would be to write it outside our c++/python Mantid framework. In c#, this would just be a few lines. It would be relatively simple to kick-off a process to run the schema validation against all our XSD.
comment:17 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.2 to Release 2.3
Moved at the end of release 2.2
comment:18 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.3 to Release 2.4
Moved to milestone 2.4
comment:19 Changed 8 years ago by Owen Arnold
- Owner changed from Nick Draper to Anders Markvardsen
All we need is the schema. I'll create a python script as a Jenkins job to go through and validate the schema against each IDF in the instrument folder.
comment:21 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.4 to Release 2.5
Moved at the code freeze for release 2.4
comment:22 Changed 8 years ago by Anders Markvardsen
- Cc A.J.Markvardsen@… removed
- Priority changed from major to critical
comment:23 Changed 8 years ago by Nick Draper
- Priority changed from critical to blocker
- Milestone changed from Release 2.5 to Release 2.6
Moved into 2.6 for early maintenance inclusion
comment:24 Changed 7 years ago by Nick Draper
- Priority changed from blocker to critical
- Keywords Maintenance added
comment:27 Changed 7 years ago by Nick Draper
- Milestone changed from Release 2.6 to Backlog
Moved to the Backlog after R2.6
comment:28 Changed 7 years ago by Anders Markvardsen
- Description modified (diff)
Probably as a separate ticket have when you can
- open a IDF_Parameters.xml in MantidPlot in a editor that is schema aware
- same for any IDF_Defintion.xml
comment:31 Changed 7 years ago by Mike Thomas
- Status changed from new to inprogress
Schemas for IDF Parameters and Facilies XML Refs #1738
Changeset: 5e13994dd79f3341ea116c41d26d5c1ed3c38d1f
comment:32 Changed 7 years ago by Anders Markvardsen
- Status changed from inprogress to verify
- Resolution set to fixed
To test - check that schema folder exist in instrument folder
comment:33 Changed 7 years ago by Gesner Passos
- Status changed from verify to verifying
- Tester set to Gesner Passos
comment:34 Changed 7 years ago by Gesner Passos
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/feature/1738_IDF_Parameters_Facilites_Schemas'
comment:35 Changed 7 years ago by Gesner Passos
The folder exists, the schema files are valid.
comment:36 Changed 7 years ago by Nick Draper
- Owner changed from Anders Markvardsen to Mike Thomas
After the summer contact Anders Markvardsen about these tickets
comment:37 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 2585
Bulk move of tickets to iteration 27, if your ticket is essential for Iteration 26 then move it back.