Skip to content

Commit a1c99b4

Browse files
committed
Add SciMeta schema validation package
1 parent 3609a31 commit a1c99b4

File tree

374 files changed

+140955
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+140955
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This work was created by participants in the DataONE project, and is
4+
# jointly copyrighted by participating institutions in DataONE. For
5+
# more information on DataONE, see our web site at http://dataone.org.
6+
#
7+
# Copyright 2009-2016 DataONE
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
21+
from __future__ import absolute_import
22+
import logging
23+
24+
try:
25+
from logging import NullHandler
26+
except ImportError:
27+
28+
class NullHandler(logging.Handler):
29+
def emit(self, record):
30+
pass
31+
32+
33+
logging.getLogger(__name__).addHandler(NullHandler())
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definitions name="AuthenticatedQueryService"
3+
targetNamespace="http://ecoinformatics.org/authenticatedqueryservice-1.0.0"
4+
xmlns="http://schemas.xmlsoap.org/wsdl/"
5+
xmlns:queryns="http://ecoinformatics.org/query-1.0.1"
6+
xmlns:resultns="http://ecoinformatics.org/resultset-1.0.1"
7+
xmlns:tns="http://ecoinformatics.org/authenticatedqueryservice-1.0.0"
8+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
9+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
10+
11+
<import location="query.xsd" namespace="http://ecoinformatics.org/query-1.0.1"/>
12+
<import location="resultset.xsd" namespace="http://ecoinformatics.org/resultset-1.0.1"/>
13+
14+
<types>
15+
<schema targetNamespace="http://ecoinformatics.org/authenticatedqueryservice-1.0.0"
16+
attributeFormDefault="qualified"
17+
elementFormDefault="qualified"
18+
xmlns="http://www.w3.org/2001/XMLSchema">
19+
20+
<element name="get" type="xsd:string"/>
21+
<complexType name="Get">
22+
<sequence>
23+
<element name="identifier" type="xsd:string"/>
24+
</sequence>
25+
</complexType>
26+
27+
<element name="getElement" type="tns:GetElementType"/>
28+
<complexType name="GetElementType">
29+
<sequence>
30+
<element name="identifier" type="xsd:string"/>
31+
<element name="sessionId" type="xsd:string"/>
32+
</sequence>
33+
</complexType>
34+
35+
<element name="queryElement" type="tns:QueryElementType"/>
36+
<complexType name="QueryElementType">
37+
<sequence>
38+
<element name="query" type="queryns:QueryType"/>
39+
<element name="sessionId" type="xsd:string"/>
40+
</sequence>
41+
</complexType>
42+
43+
<element name="getResponseElement" type="xsd:base64Binary"/>
44+
</schema>
45+
</types>
46+
47+
<message name="queryResponse">
48+
<part element="resultns:resultset" name="parameter"/>
49+
</message>
50+
<message name="queryRequest">
51+
<part element="tns:queryElement" name="parameter"/>
52+
</message>
53+
54+
<message name="getResponse">
55+
<part name="parameter" element="tns:getResponseElement"/>
56+
</message>
57+
<message name="getRequest">
58+
<part name="parameter" element="tns:getElement"/>
59+
</message>
60+
61+
<portType name="AuthenticatedQueryServicePortType">
62+
63+
<operation name="query">
64+
<input message="tns:queryRequest"/>
65+
<output message="tns:queryResponse"/>
66+
</operation>
67+
<operation name="get">
68+
<input message="tns:getRequest"/>
69+
<output message="tns:getResponse"/>
70+
</operation>
71+
</portType>
72+
73+
<binding name="AuthenticatedQueryService"
74+
type="tns:AuthenticatedQueryServicePortType">
75+
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
76+
<operation name="query">
77+
<soap:operation soapAction="http://ecoinformatics.org/authenticatedqueryservice-1.0.0#query"/>
78+
<input>
79+
<soap:body namespace="http://ecoinformatics.org/authenticatedqueryservice-1.0.0" use="literal"/>
80+
</input>
81+
<output>
82+
<soap:body namespace="http://ecoinformatics.org/authenticatedqueryservice-1.0.0" use="literal"/>
83+
</output>
84+
</operation>
85+
<operation name="get">
86+
<soap:operation soapAction="http://ecoinformatics.org/authenticatedqueryservice-1.0.0#get"/>
87+
<input>
88+
<soap:body namespace="http://ecoinformatics.org/authenticatedqueryservice-1.0.0" use="literal"/>
89+
</input>
90+
<output>
91+
<soap:body namespace="http://ecoinformatics.org/authenticatedqueryservice-1.0.0" use="literal"/>
92+
</output>
93+
</operation>
94+
</binding>
95+
96+
<service name="AuthenticatedQueryService">
97+
<port binding="tns:AuthenticatedQueryService"
98+
name="Query">
99+
<soap:address location="AuthenticatedQueryService"/>
100+
</port>
101+
</service>
102+
103+
</definitions>
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema
3+
targetNamespace="http://ecoinformatics.org/query-1.0.1"
4+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
5+
xmlns="http://ecoinformatics.org/query-1.0.1">
6+
<xs:annotation>
7+
<xs:documentation>
8+
'$RCSfile: query.xsd,v $'
9+
Copyright: 2003 Partnership for Biodiversity Informatics
10+
Project: http://seek.ecoinformatics.org/
11+
12+
'$Author: tao $'
13+
'$Date: 2008-04-23 16:25:50 $'
14+
'$Revision: 1.10 $'
15+
16+
This program is free software; you can redistribute it and/or modify
17+
it under the terms of the GNU General Public License as published by
18+
the Free Software Foundation; either version 2 of the License, or
19+
(at your option) any later version.
20+
21+
This program is distributed in the hope that it will be useful,
22+
but WITHOUT ANY WARRANTY; without even the implied warranty of
23+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24+
GNU General Public License for more details.
25+
26+
You should have received a copy of the GNU General Public License
27+
along with this program; if not, write to the Free Software
28+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29+
</xs:documentation>
30+
</xs:annotation>
31+
<xs:element name="query" type="QueryType"/>
32+
<xs:complexType name="QueryType">
33+
<xs:annotation>
34+
<xs:documentation>An XML-based query structure for combining XPath
35+
pattern matching expressions using logical operators.
36+
</xs:documentation>
37+
</xs:annotation>
38+
<xs:sequence>
39+
<xs:element name="namespace" maxOccurs="unbounded">
40+
<xs:annotation>
41+
<xs:documentation>The namespace element identifies
42+
the scope for the query by giving one or more
43+
namespaces to which the query conditions should be
44+
applied. For example, to query EML documents, one
45+
would indicate a namespace of
46+
"eml://ecoinformatics.org/eml-2.0.0". When more than
47+
one namespace is given, then the query conditions
48+
should be applied to all of those document types within
49+
the EcoGrid repository node.
50+
</xs:documentation>
51+
</xs:annotation>
52+
<xs:complexType>
53+
<xs:simpleContent>
54+
<xs:extension base="xs:string">
55+
<xs:attribute name="prefix"
56+
type="xs:string" use="optional"/>
57+
</xs:extension>
58+
</xs:simpleContent>
59+
</xs:complexType>
60+
</xs:element>
61+
<xs:element name="returnField" type="xs:string" minOccurs="0"
62+
maxOccurs="unbounded">
63+
<xs:annotation>
64+
<xs:documentation>An optional limited XPath expression that
65+
defines a field that should be returned in the resultset
66+
document. The result record constructed will contain a
67+
well-formed xml file that combines all of the returnfields
68+
into a single tree structure. If a returnfield is specified
69+
as a leaf node that is a SimpleType, the value and all
70+
parent elements leading to that value will be included in
71+
the result. If a specified returnfield is not a leaf node,
72+
then all element and value content below that node will be
73+
included in the result along with the parent elements
74+
leading to the matched node.
75+
</xs:documentation>
76+
</xs:annotation>
77+
</xs:element>
78+
<xs:element name="title" type="xs:string" minOccurs="0"
79+
maxOccurs="unbounded">
80+
<xs:annotation>
81+
<xs:documentation>An optional title that names and
82+
describes the query.</xs:documentation>
83+
</xs:annotation>
84+
</xs:element>
85+
<xs:choice>
86+
<xs:element name="AND" type="ANDType"/>
87+
<xs:element name="OR" type="ORType"/>
88+
<xs:element name="condition" type="ConditionType"/>
89+
</xs:choice>
90+
<!--
91+
<xs:element name="resultStruct" type="xs:string"
92+
minOccurs="1" maxOccurs="1"/>
93+
-->
94+
</xs:sequence>
95+
<xs:attribute name="queryId" type="xs:string" use="required"/>
96+
<xs:attribute name="system" type="xs:anyURI" use="required"/>
97+
</xs:complexType>
98+
<xs:complexType name="ANDType">
99+
<xs:annotation>
100+
<xs:documentation>A type of logical operator that requires all of
101+
its child conditions to evaluate to true in order for the whole
102+
clause to evaluate to true.</xs:documentation>
103+
</xs:annotation>
104+
<xs:sequence>
105+
<xs:element name="AND" type="ANDType" minOccurs="0" maxOccurs="unbounded"/>
106+
<xs:element name="OR" type="ORType" minOccurs="0" maxOccurs="unbounded"/>
107+
<xs:element name="condition" type="ConditionType" minOccurs="0" maxOccurs="unbounded"/>
108+
</xs:sequence>
109+
</xs:complexType>
110+
<xs:complexType name="ORType">
111+
<xs:annotation>
112+
<xs:documentation>A type of logical operator that evaluates to true
113+
if any one or more of its child conditions evaluate to true.
114+
</xs:documentation>
115+
</xs:annotation>
116+
<xs:sequence>
117+
<xs:element name="AND" type="ANDType" minOccurs="0" maxOccurs="unbounded"/>
118+
<xs:element name="OR" type="ORType" minOccurs="0" maxOccurs="unbounded"/>
119+
<xs:element name="condition" type="ConditionType" minOccurs="0" maxOccurs="unbounded"/>
120+
</xs:sequence>
121+
</xs:complexType>
122+
<xs:complexType name="ConditionType">
123+
<xs:annotation>
124+
<xs:documentation>The condition represents a portion of the query
125+
that restricts the set of documents that match the query. The
126+
content of the condition element is the value that should be
127+
matched. The symbol '%' should be interpreted as a wildcard that
128+
matches any character. The "operator" determines how the match is
129+
performed (e.g., whether numeric equality or string equality is
130+
used), and the "concept" determines the field to which the
131+
restriction is applied (e.g., for XML sources this will be a
132+
relative or absolute path expression).
133+
</xs:documentation>
134+
</xs:annotation>
135+
<xs:simpleContent>
136+
<xs:extension base="xs:string">
137+
<xs:attribute name="operator" type="OperatorType"
138+
use="required"/>
139+
<xs:attribute name="concept" type="LimitedXPathExpression"
140+
use="required"/>
141+
</xs:extension>
142+
</xs:simpleContent>
143+
</xs:complexType>
144+
<xs:simpleType name="OperatorType">
145+
<xs:annotation>
146+
<xs:documentation>The OperatorType defines the set of allowable
147+
values for the match operator in a condition. The match operator
148+
determines the semantics of how matches occur for that condition.
149+
</xs:documentation>
150+
</xs:annotation>
151+
<xs:restriction base="xs:string">
152+
<xs:enumeration value="LIKE">
153+
<xs:annotation>
154+
<xs:documentation>Matches string containing value exactly
155+
</xs:documentation>
156+
</xs:annotation>
157+
</xs:enumeration>
158+
<xs:enumeration value="NOT LIKE">
159+
<xs:annotation>
160+
<xs:documentation>Matches string not containing value
161+
</xs:documentation>
162+
</xs:annotation>
163+
</xs:enumeration>
164+
<xs:enumeration value="EQUALS">
165+
<xs:annotation>
166+
<xs:documentation>Matches if numerically equal to value
167+
</xs:documentation>
168+
</xs:annotation>
169+
</xs:enumeration>
170+
<xs:enumeration value="NOT EQUALS">
171+
<xs:annotation>
172+
<xs:documentation>Matches if numerically not equal to value
173+
</xs:documentation>
174+
</xs:annotation>
175+
</xs:enumeration>
176+
<xs:enumeration value="LESS THAN">
177+
<xs:annotation>
178+
<xs:documentation>Matches if less than value
179+
</xs:documentation>
180+
</xs:annotation>
181+
</xs:enumeration>
182+
<xs:enumeration value="LESS THAN OR EQUALS">
183+
<xs:annotation>
184+
<xs:documentation>Matches if less than or equal to value
185+
</xs:documentation>
186+
</xs:annotation>
187+
</xs:enumeration>
188+
<xs:enumeration value="GREATER THAN">
189+
<xs:annotation>
190+
<xs:documentation>Matches if greater than value
191+
</xs:documentation>
192+
</xs:annotation>
193+
</xs:enumeration>
194+
<xs:enumeration value="GREATER THAN OR EQUALS">
195+
<xs:annotation>
196+
<xs:documentation>Matches if greater than or equal to value
197+
</xs:documentation>
198+
</xs:annotation>
199+
</xs:enumeration>
200+
</xs:restriction>
201+
</xs:simpleType>
202+
<xs:simpleType name="LimitedXPathExpression">
203+
<xs:annotation>
204+
<xs:documentation>A simple type that provides a restricted version
205+
of standard XPath expressions. These expressions are the valid path
206+
expressions that can be used to express condition concepts and
207+
returnfield paths, and represent a subset of the full XPath syntax.
208+
</xs:documentation>
209+
</xs:annotation>
210+
<xs:restriction base="xs:string">
211+
<xs:pattern value="((/*)@?[a-zA-Z0-9]*)*"/>
212+
</xs:restriction>
213+
</xs:simpleType>
214+
</xs:schema>

0 commit comments

Comments
 (0)