sparql insert set for 272_monument; test for retrieving collection records for 272_monument, that does not retrieve any records, because of spatial_region data are not found

This commit is contained in:
Enrico Ottonello 2020-09-17 16:32:43 +02:00
parent be31a772a1
commit b4476f6ee7
2 changed files with 241 additions and 3 deletions

View File

@ -0,0 +1,238 @@
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?collection aocat:has_ARIADNE_subject ?archeologicalResourceType .
?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName .
?archeologicalResourceType rdfs:label ?archeologicalResourceTypeName .
}
}
WHERE {
?collection rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
?collection aocat:has_ARIADNE_subject ?archeologicalResourceType .
?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName .
?collection aocat:has_original_id "1000272m" .
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s aocat:has_creator <https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Agent> .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> rdfs:label "Not provided" .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> aocat:has_name "Not provided" .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
MINUS {
?s rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
?s aocat:has_creator ?agent .
}
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s aocat:has_owner <https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Agent> .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> rdfs:label "Not provided" .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> aocat:has_name "Not provided" .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
MINUS {
?s rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
?s aocat:has_owner ?agent .
}
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s aocat:has_responsible <https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Agent> .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> rdfs:label "Not provided" .
<https://ariadne-infrastructure.eu/aocat/Agent/NOTPROVIDED> aocat:has_name "Not provided" .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
MINUS {
?s rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
?s aocat:has_responsible ?agent .
}
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?record aocat:was_issued ?issued .
?record aocat:was_modified ?modified .
?record aocat:has_contributor ?contributor .
?record aocat:has_responsible ?legalResponsible .
?record aocat:has_owner ?owner .
?record aocat:has_publisher ?publisher .
?record aocat:has_access_rights ?accessRights .
?record aocat:has_ARIADNE_subject ?archeologicalResourceType .
}
}
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument>
WHERE {
?record aocat:is_part_of ?collection .
?collection aocat:was_issued ?issued .
?collection aocat:was_modified ?modified .
?collection aocat:has_contributor ?contributor .
?collection aocat:has_responsible ?legalResponsible .
?collection aocat:has_owner ?owner .
?collection aocat:has_publisher ?publisher .
?collection aocat:has_access_rights ?accessRights .
?collection aocat:has_ARIADNE_subject ?archeologicalResourceType .
};
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s aocat:has_native_subject <https://ariadne-infrastructure.eu/aocat/Concept/ADS/NOT_PROVIDED> .
<https://ariadne-infrastructure.eu/aocat/Concept/ADS/NOT_PROVIDED> skos:prefLabel "Not provided" .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s rdf:type aocat:AO_Individual_Data_Resource .
MINUS {
?s rdf:type aocat:AO_Individual_Data_Resource .
?s aocat:has_native_subject ?ns .
}
}
};
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s aocat:has_language <http://lexvo.org/id/iso639-3/und> .
<http://lexvo.org/id/iso639-3/und> skos:prefLabel "und" .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s rdf:type aocat:AO_Individual_Data_Resource .
MINUS {
?s rdf:type aocat:AO_Individual_Data_Resource .
?s aocat:has_language ?ns .
}
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s aocat:has_creator <https://ariadne-infrastructure.eu/aocat/Agent/ADS/NOT_PROVIDED> .
<https://ariadne-infrastructure.eu/aocat/Agent/ADS/NOT_PROVIDED> aocat:has_name "Not provided" .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s rdf:type aocat:AO_Individual_Data_Resource .
MINUS {
?s rdf:type aocat:AO_Individual_Data_Resource .
?s aocat:has_creator ?creator .
}
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s aocat:has_title "Title not provided" .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?s rdf:type aocat:AO_Individual_Data_Resource .
MINUS {
?s rdf:type aocat:AO_Individual_Data_Resource .
?s aocat:has_title ?title .
}
}
};
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::ads::aatplus> {
?record aocat:has_derived_subject ?aat .
}
}
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::aat>
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument>
WHERE {
{
?record aocat:has_native_subject ?native_subject .
?native_subject skos:exactMatch ?aat .
}
union
{
?record aocat:has_native_subject ?native_subject .
?native_subject skos:broadMatch ?aat .
}
union
{
?record aocat:has_native_subject ?native_subject .
?native_subject skos:closeMatch ?aat .
}
union
{
?record aocat:has_native_subject ?native_subject .
?native_subject skos:narrowMatch ?aat .
}
};
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX ariadneplus: <https://ariadne-infrastructure.eu/aocat/>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::ads::periodoplus> {
?temporal aocat:has_period ?periodO .
?temporal aocat:from ?temporalFrom .
?temporal aocat:until ?temporalUntil .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::272_monument> {
?temporal aocat:has_native_period ?native_period .
?native_period skos:prefLabel ?native_label .
optional {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::ads::periodo> {
?periodO skos:altLabel ?native_label .
?periodO skos:inScheme <http://n2t.net/ark:/99152/p0kh9ds> .
?periodO time:intervalStartedBy ?intervalStartedBy .
?intervalStartedBy skos:prefLabel ?temporalFrom .
?periodO time:intervalFinishedBy ?intervalFinishedBy .
?intervalFinishedBy skos:prefLabel ?temporalUntil .
}
}
}
};

View File

@ -56,18 +56,18 @@ public class GraphDbReaderAndESIndexTest {
runSPQRLQuery.setBulkUpload(bulkUpload);
String recordId;
final ClassPathResource queryTemplateResource;
boolean testRecord = true;
boolean testRecord = false;
if (testRecord) {
recordId = "https://ariadne-infrastructure.eu/aocat/Resource/D200902C-A1C2-346E-8F37-E8A429260ADE";
queryTemplateResource = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_record_data_template.sparql");
}
else {
recordId = "https://ariadne-infrastructure.eu/aocat/Collection/ADS/849B1C0F-4C5F-3D8C-9082-CA60DBB4F557";
recordId = "https://ariadne-infrastructure.eu/aocat/Collection/ADS/371CCB1B-A7B6-3CC8-B341-36049515B47E";
queryTemplateResource = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_collection_data_template.sparql");
}
String datasource = "ads";
String collectionId = "398";
String collectionId = "272_monument";
List<String> recordIds = Arrays.asList(recordId);
String queryTemplate = IOUtils.toString(queryTemplateResource.getInputStream(), StandardCharsets.UTF_8.name());
if (testRecord) {