Project

General

Profile

« Previous | Next » 

Revision 10224

Fix problem with prov_hasSources not being indexed

View differences:

metacat-index/src/main/resources/application-context-prov-base.xml
334 334
        </constructor-arg>
335 335
    </bean>
336 336

  
337
    <!--  Find the source pids used by a program -->
338
    <!--  This is the inverse relationship of prov_usedByProgram -->
337 339
    <bean id="prov20150115.hasSources" class="org.dataone.cn.indexer.annotation.SparqlField">
338 340
        <constructor-arg name="name" value="prov_hasSources" />
339 341
        <constructor-arg name="query">
......
351 353
                SELECT (str(?pidValue) as ?pid) (str(?sourceDataPidValue) as ?prov_hasSources)
352 354
                FROM <$GRAPH_NAME>
353 355
                WHERE {
354
                    ?derived_data prov:wasDerivedFrom ?source_data .
355
                    ?derived_data cito:documentedBy ?derived_metadata .
356
                    ?derived_metadata dcterms:identifier ?pidValue .
356
                    ?execution prov:used ?source_data .
357
                    ?execution prov:qualifiedAssociation ?association .
358
                    ?association prov:hadPlan ?program .
359
                    ?program dcterms:identifier ?pidValue .
357 360
                    ?source_data dcterms:identifier ?sourceDataPidValue .
358 361
                }                
359 362
                ]]>
metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/annotation/MetacatRdfXmlSubprocessorTest.java
55 55
                } else if (newId.equals("urn:uuid:9ceeaeb3-6ef3-4b1e-bc4d-96e299fab3a4")) {
56 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
                } else if (newId.equals("urn:uuid:d2fcd5c0-2755-411e-b969-0b5f8eb47d75")) {
59
                    list = resultSolrDoc.getAllFieldValues("prov_hasSources");
60
                    assertTrue("The list must contain urn:uuid:ee635a61-c930-444d-8214-db65178a1a47", list.contains("urn:uuid:ee635a61-c930-444d-8214-db65178a1a47"));
61
                    assertTrue("The list must contain ", list.contains("urn:uuid:23495598-d50b-4317-b0e1-05a9d9e52632"));
62
                    assertTrue("The list must contain ", list.contains("urn:uuid:672ba6c5-8812-4c05-a324-246af172c67a"));
63
                    assertTrue("The list must contain ", list.contains("urn:uuid:e534b2ab-3a1b-44ed-8a99-ce54a0487aea"));
59 64
                } else if (newId.equals("urn:uuid:621a115f-f1ed-4bef-bca5-f8741793a540")) {
60 65
                    List<String>list = resultSolrDoc.getAllFieldValues("prov_wasDerivedFrom");
61 66
                    assertTrue("The list must contain urn:uuid:ee635a61-c930-444d-8214-db65178a1a47", list.contains("urn:uuid:ee635a61-c930-444d-8214-db65178a1a47"));

Also available in: Unified diff