Changeset 7018


Ignore:
Timestamp:
06/10/16 10:33:33 (8 years ago)
Author:
Menzo Windhouwer
Message:

M pom.xml

  • added CLARIN maven repositories

M cmdi-validator-core/src/main/resources/default.sch

  • also work for CMDI 1.2 now

M cmdi-validator-core/src/main/resources/schematron/ExtractSchFromXSD-2.xsl

  • copy xsl:* from AppInfo?, e.g., for keys and functions used by embedded Schematron rules
Location:
CMDIValidator/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CMDIValidator/trunk/cmdi-validator-core/src/main/resources/default.sch

    r5369 r7018  
    11<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
    2     <ns uri="http://www.clarin.eu/cmd/" prefix="cmd"/>
     2    <ns uri="http://www.clarin.eu/cmd/" prefix="cmd11"/>
     3    <ns uri="http://www.clarin.eu/cmd/1" prefix="cmd12"/>
    34    <ns uri="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi"/>
    45
    56    <pattern>
    6         <rule role="warning" context="cmd:Header">
    7             <assert test="string-length(cmd:MdProfile/text()) &gt; 0">
     7        <rule role="warning" context="cmd11:Header">
     8            <assert test="string-length(cmd11:MdProfile/text()) &gt; 0">
    89                [CMDI Best Practices] A CMDI instance should contain a non-empty &lt;cmd:MdProfile&gt; element in &lt;cmd:Header&gt;.
    910            </assert>
    1011        </rule>   
    1112    </pattern>
    12 
    1313    <pattern>
    14         <rule  role="warning" context="cmd:Header">
    15             <assert test="string-length(cmd:MdSelfLink/text()) &gt; 0">
     14        <rule role="warning" context="cmd12:Header">
     15            <assert test="string-length(cmd12:MdProfile/text()) &gt; 0">
     16                [CMDI Best Practices] A CMDI instance should contain a non-empty &lt;cmd:MdProfile&gt; element in &lt;cmd:Header&gt;.
     17            </assert>
     18        </rule>   
     19    </pattern>
     20   
     21    <pattern>
     22        <rule  role="warning" context="cmd11:Header">
     23            <assert test="string-length(cmd11:MdSelfLink/text()) &gt; 0">
    1624                [CMDI Best Practices] A CMDI instance should contain a non-empty &lt;cmd:MdSelfLink&gt; element in &lt;cmd:Header&gt;.
    1725            </assert>
    1826        </rule>   
    1927    </pattern>
    20 
    21     <!--
    2228    <pattern>
    23         <rule context="cmd:Header" role="information">
    24             <report test="cmd:MdSelfLink">MdSelfLink "<value-of select="cmd:MdSelfLink"/>".</report>
    25         </rule>
     29        <rule  role="warning" context="cmd12:Header">
     30            <assert test="string-length(cmd12:MdSelfLink/text()) &gt; 0">
     31                [CMDI Best Practices] A CMDI instance should contain a non-empty &lt;cmd:MdSelfLink&gt; element in &lt;cmd:Header&gt;.
     32            </assert>
     33        </rule>   
    2634    </pattern>
    27     -->
    2835   
    2936    <!--
     
    3441    <pattern>
    3542        <title>Test xsi:schemaLocation</title>
    36         <rule role="warning" context="/cmd:CMD">
     43        <rule role="warning" context="/cmd11:CMD">
    3744            <assert test="contains(@xsi:schemaLocation,'http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/')">
     45                [CMDI Best Practice] /cmd:CMD/@xsi:schemaLocation doesn't refer to a schema from the Component Registry! [Actual value was [<value-of select="@xsi:schemaLocation"/>]
     46            </assert>
     47        </rule>
     48    </pattern>
     49    <pattern>
     50        <title>Test xsi:schemaLocation</title>
     51        <rule role="warning" context="/cmd12:CMD">
     52            <assert test="contains(@xsi:schemaLocation,'http://alpha-vlo.clarin.eu/component-registry-rest/rest/registry/1.x/profiles/')">
    3853                [CMDI Best Practice] /cmd:CMD/@xsi:schemaLocation doesn't refer to a schema from the Component Registry! [Actual value was [<value-of select="@xsi:schemaLocation"/>]
    3954            </assert>
     
    4459    <pattern>
    4560        <title>Test for ResourceProxies</title>
    46         <rule role="warning" context="/cmd:CMD/cmd:Resources/cmd:ResourceProxyList">
    47             <assert test="count(cmd:ResourceProxy) ge 1">
     61        <rule role="warning" context="/cmd11:CMD/cmd11:Resources/cmd11:ResourceProxyList">
     62            <assert test="count(cmd11:ResourceProxy) ge 1">
     63                [CMDI Best Practices] There should be at least one ResourceProxy! Otherwise this is the metadata of what? Itself?
     64            </assert>
     65        </rule>
     66    </pattern>
     67    <pattern>
     68        <title>Test for ResourceProxies</title>
     69        <rule role="warning" context="/cmd12:CMD/cmd12:Resources/cmd12:ResourceProxyList">
     70            <assert test="count(cmd12:ResourceProxy) ge 1">
    4871                [CMDI Best Practices] There should be at least one ResourceProxy! Otherwise this is the metadata of what? Itself?
    4972            </assert>
     
    5477    <pattern>
    5578        <title>Test for known profile</title>
    56         <rule role="warning" context="/cmd:CMD">
    57             <assert test="matches(@xsi:schemaLocation,'clarin.eu:cr[0-9]+:p_[0-9]+.+') or matches(cmd:Header/cmd:MdProfile,'clarin.eu:cr[0-9]+:p_[0-9]+.+')">
     79        <rule role="warning" context="/cmd11:CMD">
     80            <assert test="matches(@xsi:schemaLocation,'clarin.eu:cr[0-9]+:p_[0-9]+.+') or matches(cmd11:Header/cmd11:MdProfile,'clarin.eu:cr[0-9]+:p_[0-9]+.+')">
     81                [CMDI Best Practice] the CMD profile of this record can't be found in the /cmd:CMD/@xsi:schemaLocation or /cmd:CMD/cmd:Header/cmd:MdProfile. The profile should be known for the record to be processed properly in the CLARIN joint metadata domain!
     82            </assert>
     83        </rule>
     84    </pattern>
     85    <pattern>
     86        <title>Test for known profile</title>
     87        <rule role="warning" context="/cmd12:CMD">
     88            <assert test="matches(@xsi:schemaLocation,'clarin.eu:cr[0-9]+:p_[0-9]+.+') or matches(cmd12:Header/cmd12:MdProfile,'clarin.eu:cr[0-9]+:p_[0-9]+.+')">
    5889                [CMDI Best Practice] the CMD profile of this record can't be found in the /cmd:CMD/@xsi:schemaLocation or /cmd:CMD/cmd:Header/cmd:MdProfile. The profile should be known for the record to be processed properly in the CLARIN joint metadata domain!
    5990            </assert>
     
    6495    <pattern>
    6596        <title>Test for CMD namespace schema binding</title>
    66         <rule role="warning" context="/cmd:CMD">
     97        <rule role="warning" context="/cmd11:CMD">
    6798            <assert test="matches(@xsi:schemaLocation,'http://www.clarin.eu/cmd/ ')">
    68                 [possible CMDI Best Practice] is the CMD namespace properly bound to a profile schema?
     99                [possible CMDI Best Practice] is the CMD 1.1 namespace properly bound to a profile schema?
     100            </assert>
     101        </rule>
     102    </pattern>
     103    <pattern>
     104        <title>Test for CMD namespace schema binding</title>
     105        <rule role="warning" context="/cmd12:CMD">
     106            <assert test="matches(@xsi:schemaLocation,'http://www.clarin.eu/cmd/1 ')">
     107                [possible CMDI Best Practice] is the CMD 1.2 namespace properly bound to a profile schema?
    69108            </assert>
    70109        </rule>
     
    75114        <title>Test for cmd:CMD root</title>
    76115        <rule role="warning" context="/">
    77             <assert test="exists(cmd:CMD)">
     116            <assert test="exists(cmd11:CMD) or exists(cmd12:CMD)">
    78117                [CMDI violation] is this really a CMD record? Is the namespace properly declared, e.g., including ending slash?
    79118            </assert>
  • CMDIValidator/trunk/cmdi-validator-core/src/main/resources/schematron/ExtractSchFromXSD-2.xsl

    r5056 r7018  
    6969                        <xsl:copy-of select="$schemas//xs:appinfo/sch:phase"/>
    7070                        <xsl:copy-of select="$schemas//xs:appinfo/sch:pattern"/>
     71                        <xsl:copy-of select="$schemas//xs:appinfo/xsl:*"/>
    7172                        <sch:diagnostics>
    7273                                <xsl:copy-of select="$schemas//xs:appinfo/sch:diagnostics/*"/>
  • CMDIValidator/trunk/pom.xml

    r5736 r7018  
    8686        </pluginManagement>
    8787    </build>
     88
     89<distributionManagement>
     90        <snapshotRepository>
     91                <id>CLARIN-Snapshot</id>
     92                <url>https://nexus.clarin.eu/content/repositories/clarin-snapshot</url>
     93        </snapshotRepository>
     94        <repository>
     95                <id>CLARIN</id>
     96                <url>https://nexus.clarin.eu/content/repositories/Clarin</url>
     97        </repository>
     98</distributionManagement>
    8899</project>
Note: See TracChangeset for help on using the changeset viewer.