rif-cs 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rif-cs/activity.rb +1 -1
- data/lib/rif-cs/collection.rb +1 -1
- data/lib/rif-cs/party.rb +1 -2
- data/lib/rif-cs/service.rb +1 -1
- data/lib/rif-cs.rb +12 -0
- data/rif-cs.gemspec +4 -6
- data/spec/example_models.rb +906 -0
- data/spec/files/activity.xml +60 -58
- data/spec/files/collection.xml +72 -70
- data/spec/files/party.xml +62 -60
- data/spec/files/service.xml +64 -62
- data/spec/rif-cs_records.rb +23 -0
- data/spec/spec_helper.rb +1 -0
- metadata +15 -17
- data/spec/rif-cs_activity_spec.rb +0 -217
- data/spec/rif-cs_collection_spec.rb +0 -270
- data/spec/rif-cs_party_spec.rb +0 -228
- data/spec/rif-cs_service_spec.rb +0 -223
data/spec/files/activity.xml
CHANGED
@@ -1,59 +1,61 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
<
|
13
|
-
<
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
<
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<
|
22
|
-
|
23
|
-
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
<
|
30
|
-
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
<
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
<
|
44
|
-
|
45
|
-
<
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
<
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
</
|
2
|
+
<registryObjects xsi:schemaLocation="http://ands.org.au/standards/rif-cs/registryObjects http://services.ands.org.au/documentation/rifcs/1.3/schema/registryObjects.xsd">
|
3
|
+
<registryObject group="test group">
|
4
|
+
<key>a key</key>
|
5
|
+
<originatingSource>tomato</originatingSource>
|
6
|
+
<activity dateModified="2012-06-13 14:00:00 UTC" type="program">
|
7
|
+
<identifiers type="uri">http://example.com</identifiers>
|
8
|
+
<identifiers type="local">123</identifiers>
|
9
|
+
<name dateFrom="" dateTo="" type="primary" xml:lang="">
|
10
|
+
<namePart type="">Testing of software</namePart>
|
11
|
+
</name>
|
12
|
+
<location dateFrom="2012-06-13 14:00:00 UTC" dateTo="" type="">
|
13
|
+
<address>
|
14
|
+
<electronic type="email">
|
15
|
+
<value>joe@example.com</value>
|
16
|
+
</electronic>
|
17
|
+
<electronic type="uri">
|
18
|
+
<value>http://example.com/people/a key</value>
|
19
|
+
<arg required="false" type="" use="">placeholder</arg>
|
20
|
+
</electronic>
|
21
|
+
<physical type="postalAddress" xml:lang="">
|
22
|
+
<addressPart type="country">Austrlia</addressPart>
|
23
|
+
</physical>
|
24
|
+
<physical type="" xml:lang="">
|
25
|
+
<addressPart type="telephoneNumber">+61 2 9123 4567</addressPart>
|
26
|
+
</physical>
|
27
|
+
</address>
|
28
|
+
</location>
|
29
|
+
<coverage>
|
30
|
+
<spatial type="gml" xml:lang=""><gmlPoint gmlid="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"><gmlcoordinates>45.67, 88.56</gmlcoordinates></gmlPoint></spatial>
|
31
|
+
<temporal>
|
32
|
+
<date dateFormat="UTC" type="dateFrom">2012-06-13 14:00:00 UTC</date>
|
33
|
+
<date dateFormat="UTC" type="dateTo">2013-06-13 14:00:00 UTC</date>
|
34
|
+
<text>Self destructs in 1 year</text>
|
35
|
+
</temporal>
|
36
|
+
</coverage>
|
37
|
+
<descriptions type="brief" xmllang="">An activity</descriptions>
|
38
|
+
<descriptions type="full">Not just any activity</descriptions>
|
39
|
+
<existenceDates>
|
40
|
+
<startDate dateFormat="UTC">2012-06-13 14:00:00 UTC</startDate>
|
41
|
+
<endDate dateFormat="UTC">2013-06-13 14:00:00 UTC</endDate>
|
42
|
+
</existenceDates>
|
43
|
+
<relatedObject>
|
44
|
+
<key>b party</key>
|
45
|
+
<relation type="hasAssociationWith">
|
46
|
+
<description>Supervisor</description>
|
47
|
+
</relation>
|
48
|
+
</relatedObject>
|
49
|
+
<relatedObject>
|
50
|
+
<key>some group</key>
|
51
|
+
<relation type="isMemberOf"/>
|
52
|
+
</relatedObject>
|
53
|
+
<rights>
|
54
|
+
<rightsStatement rightsUri="http://www.intersect.org.au/policies">Copyright 2012 Intersect Australia Ltd.</rightsStatement>
|
55
|
+
<licence rightsUri="http://creativecommons.org/licenses/by/3.0">Attribution (CC BY)</licence>
|
56
|
+
<accessRights rightsUri="">Available to all without restriction</accessRights>
|
57
|
+
</rights>
|
58
|
+
<subject termIdentifier="" type="anzsrc-for" xml:lang="">123456</subject>
|
59
|
+
</activity>
|
60
|
+
</registryObject>
|
61
|
+
</registryObjects>
|
data/spec/files/collection.xml
CHANGED
@@ -1,73 +1,75 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
<
|
10
|
-
<namePart type="given">John</namePart>
|
11
|
-
<namePart type="family">Doe</namePart>
|
12
|
-
</name>
|
13
|
-
<location dateFrom="2012-06-13 14:00:00 UTC" dateTo="" type="">
|
14
|
-
<address>
|
15
|
-
<electronic type="email">
|
16
|
-
<value>joe@example.com</value>
|
17
|
-
</electronic>
|
18
|
-
<electronic type="uri">
|
19
|
-
<value>http://example.com/people/a key</value>
|
20
|
-
<arg required="false" type="" use="">placeholder</arg>
|
21
|
-
</electronic>
|
22
|
-
<physical type="postalAddress" xml:lang="">
|
23
|
-
<addressPart type="country">Austrlia</addressPart>
|
24
|
-
</physical>
|
25
|
-
<physical type="" xml:lang="">
|
26
|
-
<addressPart type="telephoneNumber">+61 2 9123 4567</addressPart>
|
27
|
-
</physical>
|
28
|
-
</address>
|
29
|
-
</location>
|
30
|
-
<coverage>
|
31
|
-
<spatial type="gml" xml:lang=""><gmlPoint gmlid="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"><gmlcoordinates>45.67, 88.56</gmlcoordinates></gmlPoint></spatial>
|
32
|
-
<temporal>
|
33
|
-
<date dateFormat="UTC" type="dateFrom">2012-06-13 14:00:00 UTC</date>
|
34
|
-
<date dateFormat="UTC" type="dateTo">2013-06-13 14:00:00 UTC</date>
|
35
|
-
<text>Self destructs in 1 year</text>
|
36
|
-
</temporal>
|
37
|
-
</coverage>
|
38
|
-
<relatedObject>
|
39
|
-
<key>b party</key>
|
40
|
-
<relation type="hasAssociationWith">
|
41
|
-
<description>owner</description>
|
42
|
-
</relation>
|
43
|
-
</relatedObject>
|
44
|
-
<relatedObject>
|
45
|
-
<key>some group</key>
|
46
|
-
<relation type="isMemberOf"/>
|
47
|
-
</relatedObject>
|
48
|
-
<subject termIdentifier="" type="anzsrc-for" xml:lang="">123456</subject>
|
49
|
-
<descriptions type="brief" xmllang="">A researcher</descriptions>
|
50
|
-
<descriptions type="full">Not just any researcher</descriptions>
|
51
|
-
<rights>
|
52
|
-
<rightsStatement rightsUri="http://www.intersect.org.au/policies">Copyright 2012 Intersect Australia Ltd.</rightsStatement>
|
53
|
-
<licence rightsUri="http://creativecommons.org/licenses/by/3.0">Attribution (CC BY)</licence>
|
54
|
-
<accessRights rightsUri="">Available to all without restriction</accessRights>
|
55
|
-
</rights>
|
56
|
-
<fullCitation style="Harvard">Australian Bureau of Agricultural and Resource Economics 2001, Aquaculture development in Australia: a review of key economic issues, ABARE, Canberra.</fullCitation>
|
57
|
-
<citationMetadata>
|
58
|
-
<identifier type="isbn">1234</identifier>
|
59
|
-
<contributor seq="">
|
2
|
+
<registryObjects xsi:schemaLocation="http://ands.org.au/standards/rif-cs/registryObjects http://services.ands.org.au/documentation/rifcs/1.3/schema/registryObjects.xsd">
|
3
|
+
<registryObject group="test group">
|
4
|
+
<key>a key</key>
|
5
|
+
<originatingSource>tomato</originatingSource>
|
6
|
+
<collection dateModified="2012-06-13 14:00:00 UTC" type="dataset" dateAccessioned="2012-06-13 14:00:00 UTC">
|
7
|
+
<identifiers type="uri">http://example.com</identifiers>
|
8
|
+
<identifiers type="local">123</identifiers>
|
9
|
+
<name dateFrom="" dateTo="" type="primary" xml:lang="">
|
60
10
|
<namePart type="title">Dr</namePart>
|
61
|
-
<namePart type="given">
|
11
|
+
<namePart type="given">John</namePart>
|
62
12
|
<namePart type="family">Doe</namePart>
|
63
|
-
</
|
64
|
-
<
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
13
|
+
</name>
|
14
|
+
<location dateFrom="2012-06-13 14:00:00 UTC" dateTo="" type="">
|
15
|
+
<address>
|
16
|
+
<electronic type="email">
|
17
|
+
<value>joe@example.com</value>
|
18
|
+
</electronic>
|
19
|
+
<electronic type="uri">
|
20
|
+
<value>http://example.com/people/a key</value>
|
21
|
+
<arg required="false" type="" use="">placeholder</arg>
|
22
|
+
</electronic>
|
23
|
+
<physical type="postalAddress" xml:lang="">
|
24
|
+
<addressPart type="country">Austrlia</addressPart>
|
25
|
+
</physical>
|
26
|
+
<physical type="" xml:lang="">
|
27
|
+
<addressPart type="telephoneNumber">+61 2 9123 4567</addressPart>
|
28
|
+
</physical>
|
29
|
+
</address>
|
30
|
+
</location>
|
31
|
+
<coverage>
|
32
|
+
<spatial type="gml" xml:lang=""><gmlPoint gmlid="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"><gmlcoordinates>45.67, 88.56</gmlcoordinates></gmlPoint></spatial>
|
33
|
+
<temporal>
|
34
|
+
<date dateFormat="UTC" type="dateFrom">2012-06-13 14:00:00 UTC</date>
|
35
|
+
<date dateFormat="UTC" type="dateTo">2013-06-13 14:00:00 UTC</date>
|
36
|
+
<text>Self destructs in 1 year</text>
|
37
|
+
</temporal>
|
38
|
+
</coverage>
|
39
|
+
<relatedObject>
|
40
|
+
<key>b party</key>
|
41
|
+
<relation type="hasAssociationWith">
|
42
|
+
<description>owner</description>
|
43
|
+
</relation>
|
44
|
+
</relatedObject>
|
45
|
+
<relatedObject>
|
46
|
+
<key>some group</key>
|
47
|
+
<relation type="isMemberOf"/>
|
48
|
+
</relatedObject>
|
49
|
+
<subject termIdentifier="" type="anzsrc-for" xml:lang="">123456</subject>
|
50
|
+
<descriptions type="brief" xmllang="">A researcher</descriptions>
|
51
|
+
<descriptions type="full">Not just any researcher</descriptions>
|
52
|
+
<rights>
|
53
|
+
<rightsStatement rightsUri="http://www.intersect.org.au/policies">Copyright 2012 Intersect Australia Ltd.</rightsStatement>
|
54
|
+
<licence rightsUri="http://creativecommons.org/licenses/by/3.0">Attribution (CC BY)</licence>
|
55
|
+
<accessRights rightsUri="">Available to all without restriction</accessRights>
|
56
|
+
</rights>
|
57
|
+
<fullCitation style="Harvard">Australian Bureau of Agricultural and Resource Economics 2001, Aquaculture development in Australia: a review of key economic issues, ABARE, Canberra.</fullCitation>
|
58
|
+
<citationMetadata>
|
59
|
+
<identifier type="isbn">1234</identifier>
|
60
|
+
<contributor seq="">
|
61
|
+
<namePart type="title">Dr</namePart>
|
62
|
+
<namePart type="given">Jane</namePart>
|
63
|
+
<namePart type="family">Doe</namePart>
|
64
|
+
</contributor>
|
65
|
+
<title>Aquaculture development in Australia: a review of key economic issues</title>
|
66
|
+
<edition>1st</edition>
|
67
|
+
<publisher>ABARE</publisher>
|
68
|
+
<placePublished>Canberra</placePublished>
|
69
|
+
<date type="publicationDate">2012-06-14</date>
|
70
|
+
<url>http://example.com</url>
|
71
|
+
<context>local</context>
|
72
|
+
</citationMetadata>
|
73
|
+
</collection>
|
74
|
+
</registryObject>
|
75
|
+
</registryObjects>
|
data/spec/files/party.xml
CHANGED
@@ -1,61 +1,63 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<
|
15
|
-
<
|
16
|
-
<
|
17
|
-
|
18
|
-
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<
|
24
|
-
|
25
|
-
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
<
|
32
|
-
|
33
|
-
<
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
<
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
<
|
46
|
-
|
47
|
-
<
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
<
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
<
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
</
|
2
|
+
<registryObjects xsi:schemaLocation="http://ands.org.au/standards/rif-cs/registryObjects http://services.ands.org.au/documentation/rifcs/1.3/schema/registryObjects.xsd">
|
3
|
+
<registryObject group="test group">
|
4
|
+
<key>a key</key>
|
5
|
+
<originatingSource>tomato</originatingSource>
|
6
|
+
<party dateModified="2012-06-13 14:00:00 UTC" type="person">
|
7
|
+
<identifiers type="uri">http://example.com</identifiers>
|
8
|
+
<identifiers type="local">123</identifiers>
|
9
|
+
<name dateFrom="" dateTo="" type="primary" xml:lang="">
|
10
|
+
<namePart type="title">Dr</namePart>
|
11
|
+
<namePart type="given">John</namePart>
|
12
|
+
<namePart type="family">Doe</namePart>
|
13
|
+
</name>
|
14
|
+
<location dateFrom="2012-06-13 14:00:00 UTC" dateTo="" type="">
|
15
|
+
<address>
|
16
|
+
<electronic type="email">
|
17
|
+
<value>joe@example.com</value>
|
18
|
+
</electronic>
|
19
|
+
<electronic type="uri">
|
20
|
+
<value>http://example.com/people/a key</value>
|
21
|
+
<arg required="false" type="" use="">placeholder</arg>
|
22
|
+
</electronic>
|
23
|
+
<physical type="postalAddress" xml:lang="">
|
24
|
+
<addressPart type="country">Austrlia</addressPart>
|
25
|
+
</physical>
|
26
|
+
<physical type="" xml:lang="">
|
27
|
+
<addressPart type="telephoneNumber">+61 2 9123 4567</addressPart>
|
28
|
+
</physical>
|
29
|
+
</address>
|
30
|
+
</location>
|
31
|
+
<coverage>
|
32
|
+
<spatial type="gml" xml:lang=""><gmlPoint gmlid="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"><gmlcoordinates>45.67, 88.56</gmlcoordinates></gmlPoint></spatial>
|
33
|
+
<temporal>
|
34
|
+
<date dateFormat="UTC" type="dateFrom">2012-06-13 14:00:00 UTC</date>
|
35
|
+
<date dateFormat="UTC" type="dateTo">2013-06-13 14:00:00 UTC</date>
|
36
|
+
<text>Self destructs in 1 year</text>
|
37
|
+
</temporal>
|
38
|
+
</coverage>
|
39
|
+
<descriptions type="brief" xmllang="">A researcher</descriptions>
|
40
|
+
<descriptions type="full">Not just any researcher</descriptions>
|
41
|
+
<existenceDates>
|
42
|
+
<startDate dateFormat="UTC">2012-06-13 14:00:00 UTC</startDate>
|
43
|
+
<endDate dateFormat="UTC">2013-06-13 14:00:00 UTC</endDate>
|
44
|
+
</existenceDates>
|
45
|
+
<relatedObject>
|
46
|
+
<key>b party</key>
|
47
|
+
<relation type="hasAssociationWith">
|
48
|
+
<description>Supervisor</description>
|
49
|
+
</relation>
|
50
|
+
</relatedObject>
|
51
|
+
<relatedObject>
|
52
|
+
<key>some group</key>
|
53
|
+
<relation type="isMemberOf"/>
|
54
|
+
</relatedObject>
|
55
|
+
<rights>
|
56
|
+
<rightsStatement rightsUri="http://www.intersect.org.au/policies">Copyright 2012 Intersect Australia Ltd.</rightsStatement>
|
57
|
+
<licence rightsUri="http://creativecommons.org/licenses/by/3.0">Attribution (CC BY)</licence>
|
58
|
+
<accessRights rightsUri="">Available to all without restriction</accessRights>
|
59
|
+
</rights>
|
60
|
+
<subject termIdentifier="" type="anzsrc-for" xml:lang="">123456</subject>
|
61
|
+
</party>
|
62
|
+
</registryObject>
|
63
|
+
</registryObjects>
|
data/spec/files/service.xml
CHANGED
@@ -1,63 +1,65 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
<
|
12
|
-
<
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
<
|
17
|
-
|
18
|
-
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<
|
26
|
-
|
27
|
-
<
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
<
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
<
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
<
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
</
|
2
|
+
<registryObjects xsi:schemaLocation="http://ands.org.au/standards/rif-cs/registryObjects http://services.ands.org.au/documentation/rifcs/1.3/schema/registryObjects.xsd">
|
3
|
+
<registryObject group="Intersect Australia">
|
4
|
+
<key>service key</key>
|
5
|
+
<originatingSource>http://www.intersect.org.au</originatingSource>
|
6
|
+
<service dateModified="2012-06-13 14:00:00 UTC" type="create">
|
7
|
+
<identifiers type="local">hdl:1959.4/004_311</identifiers>
|
8
|
+
<name dateFrom="2012-06-14 00:00:00 +1000" dateTo="2013-06-14 00:00:00 +1000" type="create" xml:lang="">
|
9
|
+
<namePart type="">Autolab PGSTAT 12 Potentiostat</namePart>
|
10
|
+
</name>
|
11
|
+
<location dateFrom="" dateTo="" type="">
|
12
|
+
<address>
|
13
|
+
<electronic type="email">
|
14
|
+
<value>joe@example.com</value>
|
15
|
+
</electronic>
|
16
|
+
<physical type="postalAddress" xml:lang="">
|
17
|
+
<addressPart type="country">Austrlia</addressPart>
|
18
|
+
</physical>
|
19
|
+
<physical type="" xml:lang="">
|
20
|
+
<addressPart type="telephoneNumber">+61 2 9123 4567</addressPart>
|
21
|
+
</physical>
|
22
|
+
</address>
|
23
|
+
<spatial type="gml" xml:lang=""><gmlPoint gmlid="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"><gmlcoordinates>45.67, 88.56</gmlcoordinates></gmlPoint></spatial>
|
24
|
+
</location>
|
25
|
+
<coverage>
|
26
|
+
<spatial type="gml" xml:lang=""><gmlPoint gmlid="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"><gmlcoordinates>45.67, 88.56</gmlcoordinates></gmlPoint></spatial>
|
27
|
+
<temporal>
|
28
|
+
<date dateFormat="UTC" type="dateFrom">2012-06-13 14:00:00 UTC</date>
|
29
|
+
<date dateFormat="UTC" type="dateTo">2013-06-13 14:00:00 UTC</date>
|
30
|
+
<text>Self destructs in 1 year</text>
|
31
|
+
</temporal>
|
32
|
+
</coverage>
|
33
|
+
<relatedObject>
|
34
|
+
<key>http://nla.gov.au/nla.party-593921</key>
|
35
|
+
<relation type="hasAssociationWith"/>
|
36
|
+
</relatedObject>
|
37
|
+
<relatedObject>
|
38
|
+
<key>some group</key>
|
39
|
+
<relation type="isPresentedBy"/>
|
40
|
+
</relatedObject>
|
41
|
+
<descriptions type="deliverymethod">offline</descriptions>
|
42
|
+
<descriptions type="full">General-purpose potentiostat.</descriptions>
|
43
|
+
<accessPolicies>http://example.com/policy</accessPolicies>
|
44
|
+
<rights>
|
45
|
+
<rightsStatement rightsUri="http://www.intersect.org.au/policies">Copyright 2012 Intersect Australia Ltd.</rightsStatement>
|
46
|
+
<licence rightsUri="http://creativecommons.org/licenses/by/3.0">Attribution (CC BY)</licence>
|
47
|
+
<accessRights rightsUri="">Available to all without restriction</accessRights>
|
48
|
+
</rights>
|
49
|
+
<existenceDates>
|
50
|
+
<startDate dateFormat="UTC">2012-06-13 14:00:00 UTC</startDate>
|
51
|
+
<endDate dateFormat="UTC">2013-06-13 14:00:00 UTC</endDate>
|
52
|
+
</existenceDates>
|
53
|
+
<relatedInfo type="website">
|
54
|
+
<identifier type="uri">http://example.com/personalsites/foo</identifier>
|
55
|
+
<title>This person's blog</title>
|
56
|
+
<notes>Another blog</notes>
|
57
|
+
</relatedInfo>
|
58
|
+
<relatedInfo type="publication">
|
59
|
+
<identifier type="isbn">111</identifier>
|
60
|
+
<title>The Ordering of Things</title>
|
61
|
+
<notes>Not available</notes>
|
62
|
+
</relatedInfo>
|
63
|
+
</service>
|
64
|
+
</registryObject>
|
65
|
+
</registryObjects>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
def tests(record_type)
|
4
|
+
|
5
|
+
record = Object.const_get("#{record_type}Example").new
|
6
|
+
|
7
|
+
it "should give a RIF-CS XML #{record_type} record for a model" do
|
8
|
+
expected = Nokogiri::XML(IO.read(File.join(File.dirname(__FILE__), 'files', "#{record_type.downcase}.xml"))).at_xpath('//registryObject').to_xml.gsub(/^\s{2}/, '')
|
9
|
+
record = Object.const_get("#{record_type}Example").new
|
10
|
+
record.to_registry_node.doc.root.to_xml(:indent => 2).should eq(expected)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should give a #{record_type} record wrapped in a registryObjects tag" do
|
14
|
+
expected = IO.read(File.join(File.dirname(__FILE__), 'files', "#{record_type.downcase}.xml"))
|
15
|
+
record.to_rif.should == expected
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
%w{Activity Collection Party Service}.each do |record|
|
20
|
+
describe "RIFCS::#{record}" do
|
21
|
+
tests(record)
|
22
|
+
end
|
23
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,6 +2,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
require 'rspec'
|
4
4
|
require 'rif-cs'
|
5
|
+
require 'example_models'
|
5
6
|
|
6
7
|
# Requires supporting files with custom matchers and macros, etc,
|
7
8
|
# in ./support/ and its subdirectories.
|