fixed concept label case problem and limited to 10 the about list elements retrieved

This commit is contained in:
Enrico Ottonello 2021-09-10 17:15:21 +02:00
parent f4e15dbf89
commit 05b685e0aa
2 changed files with 78 additions and 27 deletions

View File

@ -6,6 +6,7 @@ PREFIX onto: <http://www.ontotext.com/>
PREFIX ariadneplus: <https://ariadne-infrastructure.eu/aocat/> PREFIX ariadneplus: <https://ariadne-infrastructure.eu/aocat/>
PREFIX time: <http://www.w3.org/2006/time#> PREFIX time: <http://www.w3.org/2006/time#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
CONSTRUCT { CONSTRUCT {
%record aoprop:rdfType "Record" . %record aoprop:rdfType "Record" .
%record aoprop:identifier %record . %record aoprop:identifier %record .
@ -101,20 +102,28 @@ where {
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> { graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
%record aocat:has_language / skos:prefLabel ?language . %record aocat:has_language / skos:prefLabel ?language .
%record aocat:has_original_id ?originalId . %record aocat:has_original_id ?originalId .
%record aocat:is_part_of ?partOf . %record aocat:is_part_of ?partOf .
%record aocat:has_creator ?creator . %record aocat:has_creator ?creator .
?creator aocat:has_name ?creatorName . ?creator aocat:has_name ?creatorName .
%record aocat:has_title ?title .
%record aocat:has_title ?title .
%record aocat:has_type / skos:prefLabel ?resourceType . %record aocat:has_type / skos:prefLabel ?resourceType .
%record aocat:has_type ?typeURI . %record aocat:has_type ?typeURI .
?typeURI skos:prefLabel ?typeLabel . ?typeURI skos:prefLabel ?typeLabel .
optional {
%record aocat:is_about ?aboutURI .
?aboutURI rdfs:label ?aboutLabel .
}
optional { optional {
?creator aocat:has_email ?creatorEmail . ?creator aocat:has_email ?creatorEmail .
} }
optional { optional {
%record aocat:has_description ?description . %record aocat:has_description ?description .
} }
@ -130,35 +139,63 @@ where {
optional { optional {
%record aocat:has_visual_component ?visualComponent . %record aocat:has_visual_component ?visualComponent .
} }
} }
optional {
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
select ?aboutURI ?aboutLabel
where {
%record aocat:is_about ?aboutURI .
?aboutURI rdfs:label ?aboutLabel .
}
limit 10
}
}
optional { optional {
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> { graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
%record aocat:has_temporal_coverage ?temporalNative . select distinct ?temporalNative ?nativeLabel ?temporalNativePeriodName ?temporalNativeFrom ?temporalNativeUntil
?temporalNative aocat:has_native_period ?nativeLabel . where {
?nativeLabel skos:prefLabel ?temporalNativePeriodName . %record aocat:has_temporal_coverage ?temporalNative .
optional { ?temporalNative aocat:has_native_period ?nativeLabel .
?temporalNative aocat:from ?temporalNativeFrom . ?nativeLabel skos:prefLabel ?origTemporalNativePeriodName .
?temporalNative aocat:until ?temporalNativeUntil . optional {
?temporalNative aocat:from ?temporalNativeFrom .
?temporalNative aocat:until ?temporalNativeUntil .
}
BIND(lcase(?origTemporalNativePeriodName) as ?temporalNativePeriodName)
} }
} }
} }
optional { optional {
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> { graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
select distinct ?temporal ?temporalPeriodName ?temporalFrom ?temporalUntil
where {
%record aocat:has_temporal_coverage ?temporal . %record aocat:has_temporal_coverage ?temporal .
} graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodoplus> {
graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodoplus> { ?temporal aocat:has_period ?label .
?temporal aocat:has_period ?label . graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodo> {
graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodo> {
?label skos:prefLabel ?temporalPeriodName . ?label skos:prefLabel ?origTemporalPeriodName .
} }
optional { optional {
?temporal aocat:from ?temporalFrom . ?temporal aocat:from ?temporalFrom .
?temporal aocat:until ?temporalUntil . ?temporal aocat:until ?temporalUntil .
} }
} }
BIND(lcase(?origTemporalPeriodName) as ?temporalPeriodName)
}
}
} }
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> { graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
@ -221,7 +258,8 @@ where {
} }
} }
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
{ {
select * select *
where { where {
@ -254,26 +292,29 @@ where {
} }
} }
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> { graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
{ {
select * select distinct ?nativeSubject ?nativeSubjectPrefLabel
where { where {
%record aocat:has_native_subject ?nativeSubject . %record aocat:has_native_subject ?nativeSubject .
?nativeSubject skos:prefLabel ?nativeSubjectPrefLabel . ?nativeSubject skos:prefLabel ?origNativeSubjectPrefLabel .
BIND(lcase(?origNativeSubjectPrefLabel) as ?nativeSubjectPrefLabel)
} }
} }
} }
graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::aatplus> { graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::aatplus> {
{ {
select * select distinct ?derivedSubject ?derivedSubjectPrefLabel
where { where {
optional { optional {
%record aocat:has_derived_subject ?derivedSubject . %record aocat:has_derived_subject ?derivedSubject .
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::aat> { graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::aat> {
?derivedSubject skos:prefLabel ?derivedSubjectPrefLabel . ?derivedSubject skos:prefLabel ?origDerivedSubjectPrefLabel .
} }
} }
BIND(lcase(?origDerivedSubjectPrefLabel) as ?derivedSubjectPrefLabel)
} }
} }
} }

View File

@ -331,6 +331,16 @@ public class GraphDbReaderAndESIndexTest {
readAndIndexTest(isRecord, recordId, datasource, collectionId); readAndIndexTest(isRecord, recordId, datasource, collectionId);
} }
@Test
// @Ignore
public void uploadADSGreyLiteratureOver300TriplesTest() throws Exception {
boolean isRecord = true;
String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/35AEC455-6CB5-31BB-B73E-30959FF3C4FE";
String datasource = "ads";
String collectionId = "1093";
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();