sch:pattern [ name = "known data type" sch:rule [ context = "dcif:dataType" sch:let[name = "type"value = "."] sch:let[name = "types"value = """document('http://www.isocat.org/rest/info/data-types.xml')"""] sch:assert[test = "$types//datatype/@name = $type""""This data type isn't known by ISOcat."""] ] ]
sch:pattern [ name = "known rule type" sch:rule [ context = "dcif:ruleType" sch:let[name = "type"value = "."] sch:let[name = "types"value = """document('http://www.isocat.org/rest/info/rule-types.xml')"""] sch:assert[test = "$types//rule-type/@name = $type""""This data type isn't known by ISOcat."""] ] ]
sch:pattern [ name = "a value has to be a simple DC" sch:rule [ context = "dcif:value" sch:assert [ test = """@pid = /dcif:dataCategorySelection/dcif:dataCategory[@type='simple']/@pid""" "Only simple DCs can be values." ] ] ]
descriptionSection = elementdescriptionSection { elementprofile { xsd:string }+ & languageSection+ & dataElementNameSection* >> sch:pattern [ name = "mandatory english language section with a name section and a definition" sch:rule [ context = "dcif:descriptionSection" sch:assert [ test = """dcif:languageSection[dcif:language=('en','eng')][exists(dcif:definitionSection)][exists(dcif:nameSection)]""" "All DCs should have an english language section with a definition and a name." ] ] ] }
languageSection = elementlanguageSection { elementlanguage { xsd:language } & elementdefinitionSection { elementdefinition { xsd:string, attributexml:lang { xsd:language }? } & elementsource { xsd:string } & elementnote { xsd:string, attributexml:lang { xsd:language }? }? }* & exampleSection* & explanationSection* & elementnote { xsd:string, attributexml:lang { xsd:language }? }* & nameSection* >> sch:pattern [ name = "one language section per language" sch:rule [ context = "dcif:languageSection" sch:assert [ test = "not(dcif:language = (preceding-sibling::dcif:languageSection,following-sibling::dcif:languageSection)/dcif:language)" "Only one language section per language per DC." ] ] ] }
complexDataCategory = attributetype { "complex" }, ( openDataCategory | closedDataCategory | constrainedDataCategory ) >> sch:pattern [ name = "all conceptual domains should have the same data type" sch:rule [ context = """dcif:dataCategory[@type='complex']""" sch:assert [ test = "not(dcif:conceptualDomain/dcif:dataType != .//dcif:conceptualDomain/dcif:dataType)" "All conceptual domains of a complex DC should have the same data type." ] ] ]
closedDataCategory = profileValueDomain+ & closedLinguisticSection* >> sch:pattern [ name = "for each profile there should be a profile value domain" sch:rule [ context = """dcif:dataCategory[@type='complex'][dcif:conceptualDomain[@type='closed']]""" sch:assert [ test = "dcif:descriptionSection/dcif:profile = dcif:conceptualDomain/dcif:profile" "For each profile a closed DC is a member there should be a profile specific conceptual domain." ] ] ]
profileValueDomain = elementconceptualDomain { attributetype { "closed" }, ( elementdataType { xsd:string } & elementprofile { xsd:string } & elementvalue { attributepid { xsd:anyURI }, dataCategorySummary? }+ ) >> sch:pattern [ name = "one profile value domain per profile" sch:rule [ context = """dcif:dataCategory/dcif:conceptualDomain[@type='closed']""" sch:assert [ test = "not(dcif:profile = (preceding-sibling::dcif:conceptualDomain,following-sibling::dcif:conceptualDomain)/dcif:profile)" "Only one profile specific conceptual domain per profile per DC." ] ] ] >> sch:pattern [ name = "a profile value domain can only exists for a profile the DC is a member of" sch:rule [ context = """dcif:dataCategory/dcif:conceptualDomain[@type='closed']""" sch:assert [ test = "dcif:profile = ancestor::dcif:dataCategory/dcif:descriptionSection/dcif:profile" "A profile specific conceptual domain can only exist for a profile the closed DC is a member of." ] ] ] >> sch:pattern [ name = "all simple DCs in a profile value domain should be member of that profile" sch:rule [ context = """dcif:dataCategory/dcif:conceptualDomain[@type='closed'][dcif:profile='Private']/dcif:value""" role = "warning" sch:let[name = "prof"value = "parent::dcif:conceptualDomain/dcif:profile"] sch:let[name = "pid"value = "@pid"] sch:assert [ test = "/dcif:dataCategorySelection/dcif:dataCategory[@pid=$pid]/dcif:descriptionSection/dcif:profile=$prof" "A simple DC used as a value in a profile specific conceptual domain should be a member of that profile." ] ] sch:rule [ context = """dcif:dataCategory/dcif:conceptualDomain[@type='closed'][dcif:profile!='Private']/dcif:value""" sch:let[name = "prof"value = "parent::dcif:conceptualDomain/dcif:profile"] sch:let[name = "pid"value = "@pid"] sch:assert [ test = "/dcif:dataCategorySelection/dcif:dataCategory[@pid=$pid]/dcif:descriptionSection/dcif:profile=$prof" "A simple DC used as a value in a profile specific conceptual domain should be a member of that profile." ] ] ] }
linguisticSection = elementlanguage { xsd:language } & exampleSection* & explanationSection* & elementnote { xsd:string, attributexml:lang { xsd:language }? >> sch:pattern [ name = "one linguistic section per language" sch:rule [ context = "dcif:linguisticSection" sch:assert [ test = "not(dcif:language = (preceding-sibling::dcif:linguisticSection,following-sibling::dcif:linguisticSection)/dcif:language)" "Only one language section per language per DC." ] ] ] }*
valueDomain = elementconceptualDomain { attributetype { "closed" }, ( elementdataType { xsd:string } & elementvalue { attributepid { xsd:anyURI }, dataCategorySummary? }+ ) >> sch:pattern [ name = """a value domain of a linguistic section can't extend the closed DCs value domain""" sch:rule [ context = """dcif:dataCategory/dcif:linguisticSection[@type='closed']/dcif:conceptualDomain/dcif:value""" sch:assert [ test = "@pid = ancestor::dcif:dataCategory/dcif:conceptualDomain/dcif:value/@pid" "A value in a linguistic section related conceptual domain should already be an allowed value in one of the closed DCs conceptual
domains." ] ] ] }
simpleDataCategory = attributetype { "simple" }, elementisA { attributepid { xsd:anyURI }, dataCategorySummary? >> sch:pattern [ name = "the parent DC of a simple DC has to be a simple DC" sch:rule [ context = "dcif:isA" sch:assert [ test = """@pid = /dcif:dataCategorySelection/dcif:dataCategory[@type='simple']/@pid""" "Only simple DCs can be parent DCs." ] ] ] >> sch:pattern [ name = """the parent DC of a simple DC can't be the same DC""" sch:rule [ context = "dcif:isA" sch:assert [ test = "@pid != ancestor::dcif:dataCategory/@pid" """A simple DCs can't be its own parent.""" ] ] ] }?
any = element* - d24438541e1a1480:* { attribute* - d24438541e1a1480:* { text }*, ( text | any )* }