has_ARIADNE_subject inherited from collection only if missing

This commit is contained in:
Enrico Ottonello 2021-04-12 16:07:51 +02:00
parent 5682cc4bd2
commit 86d2b8d7a0
2 changed files with 51 additions and 3 deletions

View File

@ -6,7 +6,6 @@ INSERT {
?record aocat:has_responsible ?legalResponsible . ?record aocat:has_responsible ?legalResponsible .
?record aocat:has_owner ?owner . ?record aocat:has_owner ?owner .
?record aocat:has_publisher ?publisher . ?record aocat:has_publisher ?publisher .
?record aocat:has_ARIADNE_subject ?archeologicalResourceType .
} }
} }
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::dans::easy> USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::dans::easy>
@ -16,7 +15,24 @@ WHERE {
?collection aocat:has_responsible ?legalResponsible . ?collection aocat:has_responsible ?legalResponsible .
?collection aocat:has_owner ?owner . ?collection aocat:has_owner ?owner .
?collection aocat:has_publisher ?publisher . ?collection aocat:has_publisher ?publisher .
?collection aocat:has_ARIADNE_subject ?archeologicalResourceType . };
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX ariadneplus: <https://ariadne-infrastructure.eu/aocat/>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::dans::easy> {
?record aocat:has_ARIADNE_subject ?coll_value .
}
}
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::dans::easy>
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::dans::CollectionInfo>
WHERE {
?record aocat:is_part_of ?collection .
?collection aocat:has_ARIADNE_subject ?coll_value .
MINUS {
?record aocat:has_ARIADNE_subject ?rec_value .
}
}; };
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/> PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>

View File

@ -32,6 +32,7 @@ public class GraphDbReaderAndESIndexTest {
private RunSPARQLQueryService runSPQRLQuery; private RunSPARQLQueryService runSPQRLQuery;
@Test @Test
@Ignore
public void uploadAMCRFieldworkTest() throws Exception { public void uploadAMCRFieldworkTest() throws Exception {
boolean isRecord = true; boolean isRecord = true;
String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/AMCR/E61E0F4E-268F-39E4-8EDB-A431AFC505AA"; String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/AMCR/E61E0F4E-268F-39E4-8EDB-A431AFC505AA";
@ -41,6 +42,7 @@ public class GraphDbReaderAndESIndexTest {
} }
@Test @Test
@Ignore
public void uploadAMCRDocumentTest() throws Exception { public void uploadAMCRDocumentTest() throws Exception {
boolean isRecord = true; boolean isRecord = true;
String recordId = "https://ariadne-infrastructure.eu/aocat/Collection/AMCR/FC59581D-DC3A-31DA-922A-98DE764F3D76"; 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); 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 @Test
@Ignore @Ignore
public void uploadAMCRSiteTest() throws Exception { public void uploadAMCRSiteTest() throws Exception {
@ -143,12 +155,32 @@ public class GraphDbReaderAndESIndexTest {
@Ignore @Ignore
public void uploadDansNoSpatialTest() throws Exception { public void uploadDansNoSpatialTest() throws Exception {
boolean isRecord = true; 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 datasource = "dans";
String collectionId = "easy"; String collectionId = "easy";
readAndIndexTest(isRecord, recordId, datasource, collectionId); 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 { private void readAndIndexTest(boolean isRecord, String recordId, String datasource, String collectionId) throws Exception {
final ClassPathResource resource = new ClassPathResource("application.properties"); final ClassPathResource resource = new ClassPathResource("application.properties");
Properties appProps = new Properties(); Properties appProps = new Properties();