Commit 864d84a7 authored by mbrodhu's avatar mbrodhu
Browse files

Merge branch 'release/1.1.24'

parents 7703944f 812a2b9d
......@@ -5,7 +5,7 @@
<groupId>org.classicmayan.tools</groupId>
<artifactId>metsModsMapping</artifactId>
<packaging>jar</packaging>
<version>1.1.23-SNAPSHOT</version>
<version>1.1.24</version>
<name>metsModsMapping</name>
<url>http://maven.apache.org</url>
......
......@@ -118,11 +118,15 @@ public class ClassicMayanMetsMods {
try {
physicalLocationList.add(new ModsPhysicalLocation("provenance", "Provenance", locationDataObject.getDiscoveryPlace()));
if(locationDataObject.getCurrentCustody()!=null) {
if(locationDataObject.getCurrentCustody()!=null) {
physicalLocationList.add(new ModsPhysicalLocation("current", locationDataObject.getCurrentCustody()));
}else {
}
if(locationDataObject.isInSitu()){
physicalLocationList.add(new ModsPhysicalLocation("current", "in situ"));
}
/*else {
physicalLocationList.add(new ModsPhysicalLocation("current", "in situ"));
}*/
}catch(NullPointerException n) {
}
......@@ -142,7 +146,6 @@ public class ClassicMayanMetsMods {
modsOriginInfo.addDateCreated(new ModsDateCreated("Longcount", artefactCreationDateData.getLongcount()));
modsOriginInfo.addDateCreated(new ModsDateCreated("Calendar Round", artefactCreationDateData.getCalendarRound()));
modsOriginInfo.addDateCreated(new ModsDateCreated("Gregorian", artefactCreationDateData.getGregorianDate(), artefactCreationDateData.getQualifier()));
System.out.println(modsOriginInfo.getModsOriginInfoXML());
mods.addModsOriginInfo(modsOriginInfo);
}
......
......@@ -215,15 +215,27 @@ public class Queries {
"SELECT * WHERE { GRAPH <" + textGridURI + "> {\n" +
" ?tgObject rdf:type idiom:Artefact.\n" +
" OPTIONAL{?tgObject idiom:inSitu ?inSitu.}\n" +
" OPTIONAL {?tgObject idiom:currentCustody ?custodyPlaceRef\n" +
" BIND(IRI(CONCAT(' + \"<\" + ',?custodyPlaceRef,' + \">\" + ')) AS ?custodyPlaceRefUri)\n" +
" GRAPH ?custodyPlaceRefUri {\n" +
" ?custodyPlaceRef crm:P87_is_identified_by ?custodyPlaceNameRef.\n" +
" ?custodyPlaceNameRef idiom:placeNameType \"preferred\".\n" +
" ?custodyPlaceNameRef idiom:placeName ?custodyPlaceName.\n" +
" }\n" +
" }\n" +
" ?tgObject idiom:wasFoundAt ?discoveryRef.\n" +
"OPTIONAL{?tgObject idiom:currentCustody ?custodyRef."+
" BIND(IRI(CONCAT(' + \"<\" + ',?custodyRef,' + \">\" + ')) AS ?custodyRefUri)" +
" GRAPH ?custodyRefUri {" +
"?custodyRef idiom:custodian ?custodianRef. " +
"BIND(IRI(CONCAT(' + \"< \" + ',?custodianRef,' + \">\" + ')) AS ?custodianRefUri) " +
"GRAPH ?custodianRefUri{ " +
"?custodianRef schema:name ?custodianName." +
"}" +
" OPTIONAL{" +
"?custodyRef crm:P7_took_place_at ?custodyPlaceRef." +
"BIND(IRI(CONCAT(' + \"<\" + ',?custodyPlaceRef,' + \">\" + ')) AS ?custodyPlaceRefUri)" +
"GRAPH ?custodyPlaceRefUri {" +
"?custodyPlaceRef crm:P87_is_identified_by ?custodyPlaceNameRef. " +
"BIND(IRI(CONCAT(' + \"<\" + ',?custodyPlaceNameRef,' + \">\" + ')) AS ?custodyPlaceNameRefUri) " +
"GRAPH ?custodyPlaceNameRefUri{" +
"?custodyPlaceNameRef idiom:placeName ?custodyPlaceName." +
"}" +
"}" +
"}" +
"}}"+
" OPTIONAL{?tgObject idiom:wasFoundAt ?discoveryRef.\n" +
" BIND(IRI(CONCAT(' + \"<\" + ',?discoveryRef,' + \">\" + ')) AS ?discoveryRefUri)\n" +
" GRAPH ?discoveryRefUri{\n" +
" ?discoveryRef crm:P7_took_place_at ?discoveryPlaceRef.\n" +
......@@ -247,9 +259,8 @@ public class Queries {
" }\n" +
" }\n" +
" }\n" +
"}}\n" +
"}}}\n" +
"";
QueryExecution q = QueryExecutionFactory.sparqlService(queryURL, query);
ResultSet results = q.execSelect();
......@@ -262,7 +273,21 @@ public class Queries {
locationDataObject.setInSitu(false);
}
locationDataObject.setDiscoveryPlace(hierarichalPlaceQuery(soln.get("discoveryPlaceRef").toString()));
if(soln.get("inSitu")==null && soln.get("custodianName")!=null){
String locationValue = soln.get("custodianName").toString();
if(soln.get("custodyPlaceName")!=null){
locationValue = locationValue.concat(", " + soln.get("custodyPlaceName").toString());
}
locationDataObject.setCurrentCustody(locationValue);
}else{
locationDataObject.setCurrentCustody("unknown");
}
if(soln.get("discoveryPlaceRef")!=null){
locationDataObject.setDiscoveryPlace(hierarichalPlaceQuery(soln.get("discoveryPlaceRef").toString()));
}else{
locationDataObject.setDiscoveryPlace("unknown");
}
if(soln.get("archaeologicalCoordinates")!=null) {
locationDataObject.setFindingSpot(soln.get("archaeologicalCoordinates").toString());
......@@ -280,9 +305,8 @@ public class Queries {
" ?discoveryPlaceRef rdf:type crm:E53_Place.\n" +
" OPTIONAL {\n" +
" ?discoveryPlaceRef idiom:placeType ?placeType.\n" +
" #FILTER (regex (str(?placeType), \"<http://idiom-projekt.de/voc/placetype/concept000011>\")) \n" +
" }\n" +
" ?discoveryPlaceRef crm:P89_falls_within ?nextPlace.\n" +
" ?discoveryPlaceRef crm:P89_falls_within ?nextPlace.\n" +
" ?discoveryPlaceRef crm:P87_is_identified_by ?placeNameRef. \n" +
" BIND(IRI(CONCAT(' + \"<\" + ',?placeNameRef,' + \">\" + ')) AS ?placeNameUrl)\n" +
" GRAPH ?placeNameUrl {\n" +
......@@ -291,6 +315,7 @@ public class Queries {
" }\n" +
" }\n" +
"}";
QueryExecution q = QueryExecutionFactory.sparqlService(queryURL, query);
ResultSet results = q.execSelect();
......@@ -302,11 +327,10 @@ public class Queries {
if(soln.get("placeType")!= null) {
placeTypes.add(soln.get("placeType").toString());
}
solnNext = soln;
}
if(solnNext!= null && solnNext.get("placeType")!= null && placeTypes.contains("http://idiom-projekt.de/voc/placetype/concept000011")) {
if(solnNext!= null && solnNext.get("placeType")!= null && (placeTypes.contains("http://idiom-projekt.de/voc/placetype/concept000010") || placeTypes.contains("http://idiom-projekt.de/voc/placetype/concept000011"))) {
return solnNext.get("placeName").toString();
}else if (solnNext!= null && !solnNext.get("nextPlace").toString().replace("http://textgridrep.de/", "textgrid:").equals(textgridURI.replace("http://textgridrep.de/", "textgrid:"))){
return hierarichalPlaceQuery(solnNext.get("nextPlace").toString());
......@@ -432,7 +456,7 @@ public class Queries {
add(new FormDataObject("en", "material", artefactURI.toString(), materialAssignment));
}
String queryForTechnique = AllSparqlPrefixes + "SELECT * WHERE { GRAPH <textgrid:254w6> {\n" +
String queryForTechnique = AllSparqlPrefixes + "SELECT * WHERE { GRAPH <" + textGridUri +"> {\n" +
" ?tgObject idiom:hasTechniqueAssignment ?techniqueAssignmentRef.\n" +
" BIND(IRI(CONCAT(' + \"<\" + ',?techniqueAssignmentRef,' + \">\" + ')) AS ?techniqueAssignmentUri)\n" +
" GRAPH ?techniqueAssignmentUri{\n" +
......
......@@ -274,7 +274,9 @@ public class MetsTest {
@Test
public void testCompleteMetsMods() throws JSONException, ParseException, IOException {
System.out.println(new ClassicMayanMetsMods("textgrid:2tgnp", "2016-02-18T11:15:19.899+01:00", "2018-02-02T12:12:34.113+01:00").getMets());
System.out.println(new ClassicMayanMetsMods("textgrid:3whkp", "2016-02-18T11:15:19.899+01:00", "2018-02-02T12:12:34.113+01:00").getMets());
//System.out.println(new ClassicMayanMetsMods("textgrid:3cxrn", "2016-02-18T11:15:19.899+01:00", "2018-02-02T12:12:34.113+01:00").getMets());
}
@Test
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment