diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/DANS/ordered_sparql_insert_dans_easy.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/DANS/ordered_sparql_insert_dans_easy.sparql index 28a4c11..6072f74 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/DANS/ordered_sparql_insert_dans_easy.sparql +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/DANS/ordered_sparql_insert_dans_easy.sparql @@ -6,7 +6,6 @@ INSERT { ?record aocat:has_responsible ?legalResponsible . ?record aocat:has_owner ?owner . ?record aocat:has_publisher ?publisher . - ?record aocat:has_ARIADNE_subject ?archeologicalResourceType . } } USING @@ -16,7 +15,24 @@ WHERE { ?collection aocat:has_responsible ?legalResponsible . ?collection aocat:has_owner ?owner . ?collection aocat:has_publisher ?publisher . - ?collection aocat:has_ARIADNE_subject ?archeologicalResourceType . +}; + +PREFIX aocat: +PREFIX skos: +PREFIX ariadneplus: +INSERT { + GRAPH { + ?record aocat:has_ARIADNE_subject ?coll_value . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_ARIADNE_subject ?coll_value . + MINUS { + ?record aocat:has_ARIADNE_subject ?rec_value . + } }; PREFIX aocat: diff --git a/dnet-ariadneplus-graphdb-publisher/test/java/eu/dnetlib/ariadneplus/GraphDbReaderAndESIndexTest.java b/dnet-ariadneplus-graphdb-publisher/test/java/eu/dnetlib/ariadneplus/GraphDbReaderAndESIndexTest.java index eb485b1..341792f 100644 --- a/dnet-ariadneplus-graphdb-publisher/test/java/eu/dnetlib/ariadneplus/GraphDbReaderAndESIndexTest.java +++ b/dnet-ariadneplus-graphdb-publisher/test/java/eu/dnetlib/ariadneplus/GraphDbReaderAndESIndexTest.java @@ -32,6 +32,7 @@ public class GraphDbReaderAndESIndexTest { private RunSPARQLQueryService runSPQRLQuery; @Test + @Ignore public void uploadAMCRFieldworkTest() throws Exception { boolean isRecord = true; String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/AMCR/E61E0F4E-268F-39E4-8EDB-A431AFC505AA"; @@ -41,6 +42,7 @@ public class GraphDbReaderAndESIndexTest { } @Test + @Ignore public void uploadAMCRDocumentTest() throws Exception { boolean isRecord = true; String recordId = "https://ariadne-infrastructure.eu/aocat/Collection/AMCR/FC59581D-DC3A-31DA-922A-98DE764F3D76"; @@ -49,6 +51,16 @@ public class GraphDbReaderAndESIndexTest { readAndIndexTest(isRecord, recordId, datasource, collectionId); } + @Test + @Ignore + public void uploadAMCRGenericTest() throws Exception { + boolean isRecord = true; + String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/722A99AA-3218-3772-8884-9086729A67C5"; + String datasource = "amcr"; + String collectionId = "oai"; + readAndIndexTest(isRecord, recordId, datasource, collectionId); + } + @Test @Ignore public void uploadAMCRSiteTest() throws Exception { @@ -143,12 +155,32 @@ public class GraphDbReaderAndESIndexTest { @Ignore public void uploadDansNoSpatialTest() throws Exception { boolean isRecord = true; - String recordId = "https://ariadne-portal-staging.d4science.org/resource/F100A0AD-6A7F-3976-B77F-FFAB4F5B55DD"; + String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/F100A0AD-6A7F-3976-B77F-FFAB4F5B55DD"; String datasource = "dans"; String collectionId = "easy"; readAndIndexTest(isRecord, recordId, datasource, collectionId); } + @Test + @Ignore + public void uploadDansFieldworkReportTest() throws Exception { + boolean isRecord = true; + String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/CA076E46-5CED-322C-B77E-3B90C11B968B"; + String datasource = "dans"; + String collectionId = "easy"; + readAndIndexTest(isRecord, recordId, datasource, collectionId); + } + + @Test +// @Ignore + public void uploadSndRockartTest() throws Exception { + boolean isRecord = true; + String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/SHFA/812BFA6D-29AA-3C52-A842-58E9C2AB3D59"; + String datasource = "snd"; + String collectionId = "rockart"; + readAndIndexTest(isRecord, recordId, datasource, collectionId); + } + private void readAndIndexTest(boolean isRecord, String recordId, String datasource, String collectionId) throws Exception { final ClassPathResource resource = new ClassPathResource("application.properties"); Properties appProps = new Properties();