Skip to content

Commit b388c47

Browse files
committed
add internal dcmi xsd definitions in inst/extdata for #28
1 parent 264cd23 commit b388c47

File tree

7 files changed

+572
-3
lines changed

7 files changed

+572
-3
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repos:
5656
- id: file-contents-sorter
5757
files: '^\.Rbuildignore$'
5858
- id: end-of-file-fixer
59-
exclude: '\.Rd\\.txt'
59+
exclude: '\.Rd|\.txt|\.xsd'
6060
- repo: local
6161
hooks:
6262
- id: forbid-to-commit

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: deposits
22
Title: A universal client for depositing and accessing research data
33
anywhere
4-
Version: 0.0.3.173
4+
Version: 0.0.3.174
55
Authors@R:
66
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0003-2172-5265"))
@@ -13,6 +13,7 @@ BugReports: https://github.com/ropenscilabs/deposits/issues
1313
Imports:
1414
atom4R,
1515
checkmate,
16+
frictionless,
1617
here,
1718
httr2,
1819
jsonlite,

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"codeRepository": "https://github.com/ropenscilabs/deposits",
88
"issueTracker": "https://github.com/ropenscilabs/deposits/issues",
99
"license": "https://spdx.org/licenses/MIT",
10-
"version": "0.0.3.173",
10+
"version": "0.0.3.174",
1111
"programmingLanguage": {
1212
"@type": "ComputerLanguage",
1313
"name": "R",

data-raw/get-dcmi-xml.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
# From https://www.dublincore.org/schemas/xmls/
3+
4+
urls <- c (
5+
"https://www.dublincore.org/schemas/xmls/qdc/dc.xsd",
6+
"https://www.dublincore.org/schemas/xmls/qdc/dcterms.xsd",
7+
"https://www.dublincore.org/schemas/xmls/qdc/dcmitype.xsd"
8+
)
9+
10+
for (u in urls) {
11+
f <- file.path (here::here (), "inst", "extdata", "dc", basename (u))
12+
download.file (u, f)
13+
}

inst/extdata/dc/dc.xsd

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3+
xmlns="http://purl.org/dc/elements/1.1/"
4+
targetNamespace="http://purl.org/dc/elements/1.1/"
5+
elementFormDefault="qualified"
6+
attributeFormDefault="unqualified">
7+
8+
<xs:annotation>
9+
<xs:documentation xml:lang="en">
10+
DCMES 1.1 XML Schema
11+
XML Schema for http://purl.org/dc/elements/1.1/ namespace
12+
13+
Created 2008-02-11
14+
15+
Created by
16+
17+
Tim Cole ([email protected])
18+
Tom Habing ([email protected])
19+
Jane Hunter ([email protected])
20+
Pete Johnston ([email protected]),
21+
Carl Lagoze ([email protected])
22+
23+
This schema declares XML elements for the 15 DC elements from the
24+
http://purl.org/dc/elements/1.1/ namespace.
25+
26+
It defines a complexType SimpleLiteral which permits mixed content
27+
and makes the xml:lang attribute available. It disallows child elements by
28+
use of minOcccurs/maxOccurs.
29+
30+
However, this complexType does permit the derivation of other complexTypes
31+
which would permit child elements.
32+
33+
All elements are declared as substitutable for the abstract element any,
34+
which means that the default type for all elements is dc:SimpleLiteral.
35+
36+
</xs:documentation>
37+
38+
</xs:annotation>
39+
40+
41+
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
42+
schemaLocation="http://www.w3.org/2001/03/xml.xsd">
43+
</xs:import>
44+
45+
<xs:complexType name="SimpleLiteral">
46+
<xs:annotation>
47+
<xs:documentation xml:lang="en">
48+
This is the default type for all of the DC elements.
49+
It permits text content only with optional
50+
xml:lang attribute.
51+
Text is allowed because mixed="true", but sub-elements
52+
are disallowed because minOccurs="0" and maxOccurs="0"
53+
are on the xs:any tag.
54+
55+
This complexType allows for restriction or extension permitting
56+
child elements.
57+
</xs:documentation>
58+
</xs:annotation>
59+
60+
<xs:complexContent mixed="true">
61+
<xs:restriction base="xs:anyType">
62+
<xs:sequence>
63+
<xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
64+
</xs:sequence>
65+
<xs:attribute ref="xml:lang" use="optional"/>
66+
</xs:restriction>
67+
</xs:complexContent>
68+
</xs:complexType>
69+
70+
<xs:element name="any" type="SimpleLiteral" abstract="true"/>
71+
72+
<xs:element name="title" substitutionGroup="any"/>
73+
<xs:element name="creator" substitutionGroup="any"/>
74+
<xs:element name="subject" substitutionGroup="any"/>
75+
<xs:element name="description" substitutionGroup="any"/>
76+
<xs:element name="publisher" substitutionGroup="any"/>
77+
<xs:element name="contributor" substitutionGroup="any"/>
78+
<xs:element name="date" substitutionGroup="any"/>
79+
<xs:element name="type" substitutionGroup="any"/>
80+
<xs:element name="format" substitutionGroup="any"/>
81+
<xs:element name="identifier" substitutionGroup="any"/>
82+
<xs:element name="source" substitutionGroup="any"/>
83+
<xs:element name="language" substitutionGroup="any"/>
84+
<xs:element name="relation" substitutionGroup="any"/>
85+
<xs:element name="coverage" substitutionGroup="any"/>
86+
<xs:element name="rights" substitutionGroup="any"/>
87+
88+
<xs:group name="elementsGroup">
89+
<xs:annotation>
90+
<xs:documentation xml:lang="en">
91+
This group is included as a convenience for schema authors
92+
who need to refer to all the elements in the
93+
http://purl.org/dc/elements/1.1/ namespace.
94+
</xs:documentation>
95+
</xs:annotation>
96+
97+
<xs:sequence>
98+
<xs:choice minOccurs="0" maxOccurs="unbounded">
99+
<xs:element ref="any"/>
100+
</xs:choice>
101+
</xs:sequence>
102+
</xs:group>
103+
104+
<xs:complexType name="elementContainer">
105+
<xs:annotation>
106+
<xs:documentation xml:lang="en">
107+
This complexType is included as a convenience for schema authors who need to define a root
108+
or container element for all of the DC elements.
109+
</xs:documentation>
110+
</xs:annotation>
111+
112+
<xs:choice>
113+
<xs:group ref="elementsGroup"/>
114+
</xs:choice>
115+
</xs:complexType>
116+
117+
118+
</xs:schema>
119+
<!--#include virtual="/schemas/xmls/qdc/2008/02/11/dc.xsd" -->

inst/extdata/dc/dcmitype.xsd

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3+
xmlns="http://purl.org/dc/dcmitype/"
4+
targetNamespace="http://purl.org/dc/dcmitype/"
5+
elementFormDefault="qualified"
6+
attributeFormDefault="unqualified">
7+
8+
<xs:annotation>
9+
<xs:documentation xml:lang="en">
10+
DCMI Type Vocabulary XML Schema
11+
XML Schema for http://purl.org/dc/dcmitype/ namespace
12+
13+
Created 2008-02-11
14+
15+
Created by
16+
17+
Tim Cole ([email protected])
18+
Tom Habing ([email protected])
19+
Jane Hunter ([email protected])
20+
Pete Johnston ([email protected]),
21+
Carl Lagoze ([email protected])
22+
23+
This schema defines a simpleType which enumerates
24+
the allowable values for the DCMI Type Vocabulary.
25+
</xs:documentation>
26+
27+
28+
</xs:annotation>
29+
30+
31+
<xs:simpleType name="DCMIType">
32+
<xs:union>
33+
<xs:simpleType>
34+
<xs:restriction base="xs:Name">
35+
<xs:enumeration value="Collection"/>
36+
<xs:enumeration value="Dataset"/>
37+
<xs:enumeration value="Event"/>
38+
<xs:enumeration value="Image"/>
39+
<xs:enumeration value="MovingImage"/>
40+
<xs:enumeration value="StillImage"/>
41+
<xs:enumeration value="InteractiveResource"/>
42+
<xs:enumeration value="Service"/>
43+
<xs:enumeration value="Software"/>
44+
<xs:enumeration value="Sound"/>
45+
<xs:enumeration value="Text"/>
46+
<xs:enumeration value="PhysicalObject"/>
47+
</xs:restriction>
48+
</xs:simpleType>
49+
</xs:union>
50+
</xs:simpleType>
51+
52+
</xs:schema>
53+
<!--#include virtual="/schemas/xmls/qdc/2008/02/11/dcmitype.xsd" -->

0 commit comments

Comments
 (0)