Project

General

Profile

« Previous | Next » 

Revision 10068

Added by Jing Tao about 8 years ago

Add the prefix "prov_" the solr fields.

View differences:

metacat-index/src/main/resources/application-context-oa.xml
121 121
	</bean>
122 122
	
123 123
	<bean id="prov.wasDerivedFrom" class="org.dataone.cn.indexer.annotation.SparqlField">
124
		<constructor-arg name="name" value="wasDerivedFrom" />
124
		<constructor-arg name="name" value="prov_wasDerivedFrom" />
125 125
		<constructor-arg name="query">
126 126
			<value>
127 127
				<![CDATA[
......
132 132
				PREFIX ore: <http://www.openarchives.org/ore/terms/> 
133 133
				PREFIX dcterms: <http://purl.org/dc/terms/>
134 134

  
135
				SELECT (str(?pidValue) as ?pid) (str(?wasDerivedFromValue) as ?wasDerivedFrom)
135
				SELECT (str(?pidValue) as ?pid) (str(?wasDerivedFromValue) as ?prov_wasDerivedFrom)
136 136
				FROM <$GRAPH_NAME>
137 137
				WHERE { 
138 138
						
......
147 147
	</bean>
148 148
	
149 149
	<bean id="prov.wasGeneratedBy" class="org.dataone.cn.indexer.annotation.SparqlField">
150
		<constructor-arg name="name" value="wasGeneratedBy" />
150
		<constructor-arg name="name" value="prov_wasGeneratedBy" />
151 151
		<constructor-arg name="query">
152 152
			<value>
153 153
				<![CDATA[
......
158 158
				PREFIX ore: <http://www.openarchives.org/ore/terms/> 
159 159
				PREFIX dcterms: <http://purl.org/dc/terms/>
160 160

  
161
				SELECT (str(?pidValue) as ?pid) (str(?wasGeneratedByValue) as ?wasGeneratedBy)
161
				SELECT (str(?pidValue) as ?pid) (str(?wasGeneratedByValue) as ?prov_wasGeneratedBy)
162 162
				FROM <$GRAPH_NAME>
163 163
				WHERE { 
164 164
						
......
173 173
	</bean>
174 174
	
175 175
	<bean id="prov.wasInformedBy" class="org.dataone.cn.indexer.annotation.SparqlField">
176
		<constructor-arg name="name" value="wasInformedBy" />
176
		<constructor-arg name="name" value="prov_wasInformedBy" />
177 177
		<constructor-arg name="query">
178 178
			<value>
179 179
				<![CDATA[
......
184 184
				PREFIX ore: <http://www.openarchives.org/ore/terms/> 
185 185
				PREFIX dcterms: <http://purl.org/dc/terms/>
186 186

  
187
				SELECT (str(?pidValue) as ?pid) (str(?wasInformedByValue) as ?wasInformedBy)
187
				SELECT (str(?pidValue) as ?pid) (str(?wasInformedByValue) as ?prov_wasInformedBy)
188 188
				FROM <$GRAPH_NAME>
189 189
				WHERE { 
190 190
						
......
199 199
	</bean>
200 200
	
201 201
	<bean id="prov.used" class="org.dataone.cn.indexer.annotation.SparqlField">
202
		<constructor-arg name="name" value="used" />
202
		<constructor-arg name="name" value="prov_used" />
203 203
		<constructor-arg name="query">
204 204
			<value>
205 205
				<![CDATA[
......
210 210
				PREFIX ore: <http://www.openarchives.org/ore/terms/> 
211 211
				PREFIX dcterms: <http://purl.org/dc/terms/>
212 212

  
213
				SELECT (str(?pidValue) as ?pid) (str(?usedValue) as ?used)
213
				SELECT (str(?pidValue) as ?pid) (str(?usedValue) as ?prov_used)
214 214
				FROM <$GRAPH_NAME>
215 215
				WHERE { 
216 216
						
metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/annotation/MetacatRdfXmlSubprocessorTest.java
48 48
            for(String newId: ids) {
49 49
                SolrDoc resultSolrDoc = result.get(newId);
50 50
                if(newId.equals("urn:uuid:2c20432e-116a-4085-b8d6-abfc4b2dada2")){
51
                    SolrElementField field1 = resultSolrDoc.getField("wasDerivedFrom");
51
                    SolrElementField field1 = resultSolrDoc.getField("prov_wasDerivedFrom");
52 52
                    assertTrue(" the wasDerivedFrom value should be urn:uuid:621a115f-f1ed-4bef-bca5-f8741793a540. But the real value is "+field1.getValue(), field1.getValue().equals("urn:uuid:621a115f-f1ed-4bef-bca5-f8741793a540"));
53
                    SolrElementField field2 = resultSolrDoc.getField("wasGeneratedBy");
53
                    SolrElementField field2 = resultSolrDoc.getField("prov_wasGeneratedBy");
54 54
                    assertTrue("the wasGeneratedBy value should be urn:uuid:9ceeaeb3-6ef3-4b1e-bc4d-96e299fab3a4. But the real value is"+field2.getValue(), field2.getValue().equals("urn:uuid:9ceeaeb3-6ef3-4b1e-bc4d-96e299fab3a4"));
55 55
                } else if (newId.equals("urn:uuid:9ceeaeb3-6ef3-4b1e-bc4d-96e299fab3a4")) {
56
                    SolrElementField field1 = resultSolrDoc.getField("used");
56
                    SolrElementField field1 = resultSolrDoc.getField("prov_used");
57 57
                    assertTrue(" the used value should be urn:uuid:621a115f-f1ed-4bef-bca5-f8741793a540. But the real value is "+field1.getValue(), field1.getValue().equals("urn:uuid:621a115f-f1ed-4bef-bca5-f8741793a540"));
58 58
                   
59 59
                } else if (newId.equals("urn:uuid:621a115f-f1ed-4bef-bca5-f8741793a540")) {
60
                    List<String>list = resultSolrDoc.getAllFieldValues("wasDerivedFrom");
60
                    List<String>list = resultSolrDoc.getAllFieldValues("prov_wasDerivedFrom");
61 61
                    assertTrue("The list must contain urn:uuid:ee635a61-c930-444d-8214-db65178a1a47", list.contains("urn:uuid:ee635a61-c930-444d-8214-db65178a1a47"));
62 62
                    assertTrue("The list must contain urn:uuid:23495598-d50b-4317-b0e1-05a9d9e52632", list.contains("urn:uuid:23495598-d50b-4317-b0e1-05a9d9e52632"));
63 63
                    assertTrue("The list must contain urn:uuid:urn:uuid:672ba6c5-8812-4c05-a324-246af172c67a", list.contains("urn:uuid:672ba6c5-8812-4c05-a324-246af172c67a"));
64 64
                    assertTrue("The list must contain urn:uuid:e534b2ab-3a1b-44ed-8a99-ce54a0487aea", list.contains("urn:uuid:e534b2ab-3a1b-44ed-8a99-ce54a0487aea"));
65
                    list = resultSolrDoc.getAllFieldValues("wasGeneratedBy");
65
                    list = resultSolrDoc.getAllFieldValues("prov_wasGeneratedBy");
66 66
                    assertTrue("The list must contain urn:uuid:d8e46217-2650-42b2-896f-0f006b1a2d3b", list.contains("urn:uuid:d8e46217-2650-42b2-896f-0f006b1a2d3b"));
67 67
                } else if (newId.equals("urn:uuid:a0e104da-c925-4765-af60-29310de1b99a")) {
68
                    List<String>list = resultSolrDoc.getAllFieldValues("wasGeneratedBy");
68
                    List<String>list = resultSolrDoc.getAllFieldValues("prov_wasGeneratedBy");
69 69
                    assertTrue("The list must contain urn:uuid:9ceeaeb3-6ef3-4b1e-bc4d-96e299fab3a4", list.contains("urn:uuid:9ceeaeb3-6ef3-4b1e-bc4d-96e299fab3a4"));
70 70
                }  else if (newId.equals("urn:uuid:d8e46217-2650-42b2-896f-0f006b1a2d3b")) {
71
                    List<String>list = resultSolrDoc.getAllFieldValues("used");
71
                    List<String>list = resultSolrDoc.getAllFieldValues("prov_used");
72 72
                    assertTrue("The list must contain urn:uuid:ee635a61-c930-444d-8214-db65178a1a47", list.contains("urn:uuid:ee635a61-c930-444d-8214-db65178a1a47"));
73 73
                    assertTrue("The list must contain urn:uuid:23495598-d50b-4317-b0e1-05a9d9e52632", list.contains("urn:uuid:23495598-d50b-4317-b0e1-05a9d9e52632"));
74 74
                    assertTrue("The list must contain urn:uuid:672ba6c5-8812-4c05-a324-246af172c67a", list.contains("urn:uuid:672ba6c5-8812-4c05-a324-246af172c67a"));

Also available in: Unified diff