namespace rng = "http://relaxng.org/ns/structure/1.0" datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" namespace xml = "http://www.w3.org/XML/1998/namespace" namespace dsrl = "http://purl.oclc.org/dsdl/dsrl" default namespace = "http://example.org/ns/dml" start = element-dml element-dml = element dml { dmlVersionAttribute? & dml-contents } dmlVersionAttribute = attribute dmlVersion { "1.0" } dml-contents = ( dataModelVersion & organization* & contact-info* & list-order* & data-category* & mustUse-flag* & container-existence* & manual-validation* & units* & conformStatus* & mustUnderstand* ) # Each data model needs a version string dataModelVersion = element version { xsd:string } # Information about the data model author(s). # Seems like this should be in Dublin Core organization = element organization { string-with-lang } contact-info = element contact { xsd:anyURI } # Processing annotations unique = element unique { xsd:anyURI } key = element key { xsd:anyURI } keyref = element keyref { xsd:anyURI } data-category = element infoType { attribute minAccess { list { access-strings }}?, attribute maxAccess { list { access-strings }}?, ("config" | "status" | "statistics" | "action" | "notify") >> dsrl:default-content ["config"] } access-strings = ( "read" | "write" | "create" | "delete" | "execute" ) mustUse-flag = element mustUse { xsd:boolean >> dsrl:default-content ["false"] } manual-validation = element manual-validation-rule { string-with-lang } # Semantic hints list-order = element order { ("any-order" | "user-order") >> dsrl:default-content ["any-order"] } container-existence = element existence { empty } units = element units { xsd:string { pattern="[^: \n\r\t]+" } # allow familiar units, but no whitespace or absolute URIs here | xsd:anyURI { pattern="([a-zA-Z][a-zA-Z0-9\-\+\.]*:|\.\./|\./|#).*" } # allow absolute URIs, plus relative URIs with ./ or ../ # prohibit relative URIs that could look like a unit, ex: m/s } # Definition copied from definition of gml:Uomidentifier from # Section 8.2.3.6 of Geography Markup Language (GML) v3.2.1 string-with-lang = ( attribute xml:lang { xsd:language }, xsd:string ) conformStatus = element status { "active" | "deprecated" | "obsolete" >> dsrl:default-content ["active"] } # the mustUnderstand element contains space separated list of namespace # tokens that need to be supported to correctly process the data model mustUnderstand = element mustUnderstand { list { xsd:NCName } } dml-netconf-error-app-tag = attribute netconf-error-app-tag { xsd:string } dml-phase-attribute = attribute phase { "fragment" | "std" | "full" } dml-moduleDefault = attribute moduleDefault { xsd:boolean >> dsrl:default-content ["false"] }