Skip to content

Commit

Permalink
Harvest and index creative work date time interval with precision
Browse files Browse the repository at this point in the history
  • Loading branch information
William Welling committed Feb 21, 2023
1 parent d82c369 commit 4649d4b
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,28 @@ public class Process extends Common {
@PropertySource(template = "process/offeredBy", predicate = "http://www.w3.org/2000/01/rdf-schema#label")
private List<String> offeredBy;

@Indexed(type = "pdate")
@Indexed(type = "nested_whole_string")
@NestedObject(properties = { @Reference(value = "dateTimeIntervalStart", key = "start"), @Reference(value = "dateTimeIntervalEnd", key = "end") })
@PropertySource(template = "process/dateTimeInterval", predicate = "http://vivoweb.org/ontology/core#dateTimeInterval")
private String dateTimeInterval;

@Indexed(type = "nested_date")
@NestedObject(properties = { @Reference(value = "dateTimePrecisionStart", key = "precision") }, root = false)
@PropertySource(template = "process/dateTimeIntervalStart", predicate = "http://vivoweb.org/ontology/core#dateTime")
private String dateTimeIntervalStart;

@Indexed(type = "pdate")
@Indexed(type = "nested_date")
@NestedObject(properties = { @Reference(value = "dateTimePrecisionEnd", key = "precision") }, root = false)
@PropertySource(template = "process/dateTimeIntervalEnd", predicate = "http://vivoweb.org/ontology/core#dateTime")
private String dateTimeIntervalEnd;

@Indexed(type = "whole_string")
@PropertySource(template = "process/dateTimePrecision", predicate = "http://vivoweb.org/ontology/core#dateTimePrecision")
private String dateTimePrecision;
@Indexed(type = "nested_whole_string")
@PropertySource(template = "process/dateTimePrecisionStart", predicate = "http://vivoweb.org/ontology/core#dateTimePrecision", parse = true)
private String dateTimePrecisionStart;

@Indexed(type = "nested_whole_strings")
@PropertySource(template = "process/dateTimePrecisionEnd", predicate = "http://vivoweb.org/ontology/core#dateTimePrecision", parse = true)
private String dateTimePrecisionEnd;

@Indexed(type = "whole_string")
@PropertySource(template = "process/subtype", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#subtype")
Expand Down Expand Up @@ -237,6 +248,14 @@ public void setOfferedBy(List<String> offeredBy) {
this.offeredBy = offeredBy;
}

public String getDateTimeInterval() {
return dateTimeInterval;
}

public void setDateTimeInterval(String dateTimeInterval) {
this.dateTimeInterval = dateTimeInterval;
}

public String getDateTimeIntervalStart() {
return dateTimeIntervalStart;
}
Expand All @@ -253,12 +272,20 @@ public void setDateTimeIntervalEnd(String dateTimeIntervalEnd) {
this.dateTimeIntervalEnd = dateTimeIntervalEnd;
}

public String getDateTimePrecision() {
return dateTimePrecision;
public String getDateTimePrecisionStart() {
return dateTimePrecisionStart;
}

public void setDateTimePrecisionStart(String dateTimePrecisionStart) {
this.dateTimePrecisionStart = dateTimePrecisionStart;
}

public String getDateTimePrecisionEnd() {
return dateTimePrecisionEnd;
}

public void setDateTimePrecision(String dateTimePrecision) {
this.dateTimePrecision = dateTimePrecision;
public void setDateTimePrecisionEnd(String dateTimePrecisionEnd) {
this.dateTimePrecisionEnd = dateTimePrecisionEnd;
}

public String getSubtype() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/defaults/displayViews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@
order: 4
- name: date/time interval
template: "defaults/displayViews/processes/overview/dateTimeInterval.html"
field: dateTimeIntervalStart
field: dateTimeInterval
order: 5
- name: type
template: "defaults/displayViews/processes/overview/type.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div>
<span>{{authorList}} </span>
{{#if dateTimeIntervalStart}}
<span>({{toYear dateTimeIntervalStart}}{{#if dateTimeIntervalEnd}} - {{toYear dateTimeIntervalEnd}}{{/if}}).</span>
{{#if dateTimeInterval}}
<span>({{toDefinedPrecision dateTimeInterval}})</span>
{{/if}}
<span>
<a href="display/{{id}}"><i>{{{title}}}</i>.</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<div>
{{#if dateTimeIntervalStart}}
{{#if dateTimeIntervalEnd}}
<span>{{toYear dateTimeIntervalStart}}</span>
<span>-</span>
<span>{{toYear dateTimeIntervalEnd}}</span>
{{else}}
<span>{{toYear dateTimeIntervalStart}}</span>
{{#if dateTimeInterval}}
<span>{{toDefinedPrecision dateTimeInterval}}</span>
{{/if}}
{{else}}
{{#if dateTimeIntervalEnd}}
<span>{{toYear dateTimeIntervalEnd}}</span>
{{/if}}
{{/if}}
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PREFIX vivo: <http://vivoweb.org/ontology/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

CONSTRUCT {
<{{uri}}> vivo:dateTimeInterval ?dateTimeIntervalWithId .
} WHERE {
<{{uri}}> vivo:dateTimeInterval ?dateTimeInterval .
BIND(CONCAT(STR(?dateTimeInterval), REPLACE(STR(?dateTimeInterval), "(^.*/)", "::") ) AS ?dateTimeIntervalWithId) .
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
PREFIX vivo: <http://vivoweb.org/ontology/core#>

CONSTRUCT {
?dateTimeEnd vivo:dateTime ?dateTime .
?endDate vivo:dateTime ?dateTimeWithId .
} WHERE {
<{{uri}}> vivo:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval vivo:end ?dateTimeEnd .
?dateTimeEnd vivo:dateTime ?dateTime .
?dateTimeInterval vivo:end ?endDate .
?endDate vivo:dateTime ?dateTime .
BIND( CONCAT( CONCAT( STR(?dateTime), REPLACE(STR(?dateTimeInterval), "(^.*/)", "::"), REPLACE(STR(?endDate), "(^.*/)", "::") ) ) AS ?dateTimeWithId) .
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
PREFIX vivo: <http://vivoweb.org/ontology/core#>

CONSTRUCT {
?dateTimeStart vivo:dateTime ?dateTime .
?startDate vivo:dateTime ?dateTimeWithId .
} WHERE {
<{{uri}}> vivo:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval vivo:start ?dateTimeStart .
?dateTimeStart vivo:dateTime ?dateTime .
?dateTimeInterval vivo:start ?startDate .
?startDate vivo:dateTime ?dateTime .
BIND( CONCAT( CONCAT( STR(?dateTime), REPLACE(STR(?dateTimeInterval), "(^.*/)", "::"), REPLACE(STR(?startDate), "(^.*/)", "::" ) ) ) AS ?dateTimeWithId) .
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PREFIX vivo: <http://vivoweb.org/ontology/core#>

CONSTRUCT {
?endDate vivo:dateTimePrecision ?dateTimePrecisionWithId .
} WHERE {
<{{uri}}> vivo:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval vivo:end ?endDate .
?endDate vivo:dateTimePrecision ?dateTimePrecision .
BIND( CONCAT( CONCAT( STR(?dateTimePrecision), REPLACE(STR(?dateTimeInterval), "(^.*/)", "::"), REPLACE(STR(?endDate), "(^.*/)", "::") ) ) AS ?dateTimePrecisionWithId) .
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PREFIX vivo: <http://vivoweb.org/ontology/core#>

CONSTRUCT {
?startDate vivo:dateTimePrecision ?dateTimePrecisionId .
} WHERE {
<{{uri}}> vivo:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval vivo:start ?startDate .
?startDate vivo:dateTimePrecision ?dateTimePrecision .
BIND( CONCAT( CONCAT( STR(?dateTimePrecision), REPLACE(STR(?dateTimeInterval), "(^.*/)", "::"), REPLACE(STR(?startDate), "(^.*/)", "::") ) ) AS ?dateTimePrecisionId) .
}

0 comments on commit 4649d4b

Please sign in to comment.