forked from lcnetdev/marc2bibframe2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConvSpec-DLC.xspec
56 lines (48 loc) · 5.54 KB
/
ConvSpec-DLC.xspec
1
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
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:bf="http://id.loc.gov/ontologies/bibframe/"
xmlns:bflc="http://id.loc.gov/ontologies/bflc/"
xmlns:madsrdf="http://www.loc.gov/mads/rdf/v1#"
stylesheet="../xsl/marc2bibframe2.xsl" xslt-version="1.0">
<x:param name="localfields" select="true()"/>
<x:scenario label="LoC-SPECIFIC CONVERSIONS">
<x:scenario label="856/859 (LoC local field parsed like 856)">
<x:context href="data/ConvSpec-841-887/marc.xml"/>
<x:expect label="859 processed same as 856" test="//bf:Instance[@rdf:about='http://example.org/2#Instance']/bf:hasItem[3]/bf:Item/bf:electronicLocator/rdfs:Resource/rdf:value = 'http://loc.gov/fakebook2.html'"/>
<x:expect label="Only process field if URL value in given subset" test="count(//bf:Instance[@rdf:about='http://example.org/2#Instance']/bf:hasItem/bf:Item/bf:electronicLocator)=3"/>
</x:scenario>
<x:scenario label="050 Item creation">
<x:context href="data/ConvSpec-DLC/marc.xml"/>
<x:expect label="050 creates an Item if ind1=0" test="count(//bf:Instance[1]/bf:hasItem/bf:Item[contains(@rdf:about,'http://example.org/1#Item050')])= 2"/>
<x:expect label="...and a heldBy property of the Item" test="//bf:Item[@rdf:about ='http://example.org/1#Item050-2']/bf:heldBy/bf:Agent/@rdf:about = 'http://id.loc.gov/vocabulary/organizations/dlc'"/>
<x:expect label="...with a code for the Agent" test="//bf:Item[@rdf:about ='http://example.org/1#Item050-2']/bf:heldBy/bf:Agent/bf:code = 'DLC'"/>
<x:expect label="050 creates a ShelfMarkLcc object of the shelfMark property" test="//bf:Item[@rdf:about ='http://example.org/1#Item050-2']/bf:shelfMark/bf:ShelfMarkLcc/rdfs:label = 'QE75.P9 subser.'"/>
<x:expect label="...regardless of the form of the $a" test="//bf:Item[@rdf:about ='http://example.org/1#Item050-5']/bf:shelfMark/bf:ShelfMarkLcc/rdfs:label = 'Microform 1234'"/>
<x:expect label="ind2 = '0' creates an assigner property of the ShelfMarcLcc" test="//bf:Item[@rdf:about ='http://example.org/1#Item050-2']/bf:shelfMark/bf:ShelfMarkLcc/bf:assigner/bf:Agent/@rdf:about = 'http://id.loc.gov/vocabulary/organizations/dlc'"/>
</x:scenario>
<x:scenario label="051 Item creation">
<x:context href="data/ConvSpec-DLC/marc.xml"/>
<x:expect label="051 creates an Item" test="count(//bf:Instance[1]/bf:hasItem/bf:Item[contains(@rdf:about,'http://example.org/1#Item051')]) = 2"/>
<x:expect label="051 creates a shelfMark/ShelfMarkLcc property with label $ab" test="//bf:Instance[1]/bf:hasItem/bf:Item[@rdf:about='http://example.org/1#Item051-3']/bf:shelfMark/bf:ShelfMarkLcc/rdfs:label = 'QE75.G4'"/>
<x:expect label="... regardless of the form of the $a" test="//bf:Instance[1]/bf:hasItem/bf:Item[@rdf:about='http://example.org/1#Item051-4']/bf:shelfMark/bf:ShelfMarkLcc/rdfs:label = 'Microfilm 3741 HV'"/>
<x:expect label="$c creates a note/Note property of the Item" test="//bf:Instance[1]/bf:hasItem/bf:Item[@rdf:about='http://example.org/1#Item051-3']/bf:note/bf:Note/rdfs:label = '2d set.'"/>
</x:scenario>
<x:scenario label="$5 special handling">
<x:context href="data/ConvSpec-DLC/marc.xml"/>
<x:expect label="If $5=DLC, link property to first bf:Item generated by 050/051" test="//bf:Instance[1]/bf:hasItem/bf:Item[@rdf:about='http://example.org/1#Item050-2']/bf:title/bf:VariantTitle/bf:mainTitle ='Title of reissue'"/>
<x:expect label="...but not to other Items" test="not(//bf:Instance[1]/bf:hasItem/bf:Item[@rdf:about='http://example.org/1#Item051-3']/bf:title)"/>
<x:expect label="...data field with $5=DLC should not be processed in its normal sequence" test="not(//bf:Instance[1]/bf:title)"/>
<x:expect label="...5XX fields that normally generate Items link properties to 050/051 Item" test="//bf:Instance[1]/bf:hasItem/bf:Item[@rdf:about='http://example.org/1#Item050-2']/bf:immediateAcquisition/bf:ImmediateAcquisition/rdfs:label = '25 reels of microfilm U.S. Department of Transportation; Transfer under schedule; 1980/01/10.'"/>
<x:expect label="...and do not create an additional Item" test="not(//bf:Instance[1]/bf:hasItem/bf:Item[contains(@rdf:about,'http://example.org/1#Item541')])"/>
<x:expect label="...also link properties if no $5" test="//bf:Instance[1]/bf:hasItem/bf:Item[@rdf:about='http://example.org/1#Item050-2']/bf:custodialHistory = 'On permanent loan from the collection of Paul Mellon.'"/>
<x:expect label="...but again, do not create an additional Item" test="not(//bf:Instance[1]/bf:hasItem/bf:Item[contains(@rdf:about,'http://example.org/1#Item561')])"/>
<x:expect label="Do not create additional Item if 050/051 Item" test="not(//bf:Instance[1]/bf:hasItem/bf:Item[@rdf:about='http://example.org/1#Item-DLC'])"/>
<x:expect label="Do not process field if $5 != 'DLC'" test="not(//bf:Instance[1]/bf:systemRequirement)"/>
<x:expect label="If no 050/051, create an Item from the first $5=DLC" test="count(//bf:Instance[2]/bf:hasItem/bf:Item) = 1"/>
<x:expect label="...link properties from all matching data fields with that Item" test="//bf:Instance[2]/bf:hasItem/bf:Item[@rdf:about='http://example.org/2#Item-DLC']/bf:contribution/bf:Contribution/bf:agent/bf:Agent/rdfs:label='Jefferson, Thomas, 1743-1826'"/>
</x:scenario>
</x:scenario>
</x:description>