Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add time value type #1403

Merged
merged 62 commits into from Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
dded34c
feat: Add time value type (ongoing).
Aug 28, 2019
e6699e4
feat: Add time value type (ongoing).
Aug 28, 2019
259f1e8
feat: Support time values (ongoing).
Aug 28, 2019
a921a67
Merge branch 'develop' into wip/1397-time-value
Aug 29, 2019
d6bfea7
feat(knora-ontologies): Add StandoffTimeTag.
Aug 29, 2019
52825e3
test(ontology-responder): Fix OntologyResponderV2Spec.
Aug 29, 2019
0284cb9
Merge branch 'develop' into wip/1397-time-value
Aug 30, 2019
cf7d1f1
Merge branch 'develop' into wip/1397-time-value
Aug 30, 2019
79afa38
fix(store): Replace deprecated class.
Aug 30, 2019
212cae1
test: Add anything:Thing resources with time values for testing.
Aug 30, 2019
58729be
feat(api-v1): Support time values in extended search.
Aug 30, 2019
4b7a01f
feat(api-v2): Support time values in Gravsearch.
Aug 30, 2019
74ad464
Merge branch 'develop' into wip/1397-time-value
Aug 30, 2019
6d32e2d
feat(upgrade): Add upgrade plugin.
Aug 30, 2019
4adfa93
Merge branch 'develop' into wip/1397-time-value
Aug 30, 2019
abd0c47
docs: Add docs.
Sep 3, 2019
55aa565
Merge branch 'develop' into wip/1397-time-value
Sep 9, 2019
c4709fb
Merge branch 'develop' into wip/1397-time-value
Sep 12, 2019
f84f1c3
Merge branch 'develop' into wip/1397-time-value
tobiasschweizer Sep 24, 2019
1d8f096
test (ontology v2): fix test data
Sep 24, 2019
8b28209
Merge branch 'develop' into wip/1397-time-value
Sep 25, 2019
e43b428
Merge branch 'develop' into wip/1397-time-value
Sep 26, 2019
c892d8b
Merge remote-tracking branch 'origin/wip/1397-time-value' into wip/13…
Sep 26, 2019
9a0ec55
Merge branch 'develop' into wip/1397-time-value
Oct 8, 2019
fad003a
Merge branch 'develop' into wip/1397-time-value
Oct 18, 2019
a40806f
Merge branch 'develop' into wip/1397-time-value
Oct 21, 2019
07c9746
Merge branch 'develop' into wip/1397-time-value
Oct 21, 2019
3bf4f27
Merge branch 'develop' into wip/1397-time-value
Oct 22, 2019
cd79480
Merge branch 'develop' into wip/1397-time-value
Oct 23, 2019
9a06a03
Merge branch 'develop' into wip/1397-time-value
tobiasschweizer Oct 28, 2019
0d869b4
Merge branch 'develop' into wip/1397-time-value
Nov 5, 2019
f0e03f1
Merge branch 'develop' into wip/1397-time-value
Nov 14, 2019
8462beb
Merge branch 'develop' into wip/1397-time-value
Nov 15, 2019
bcf8efd
fix(build): Fix compile error.
Nov 15, 2019
99d3635
Merge branch 'develop' into wip/1397-time-value
Nov 15, 2019
63a14a7
Merge branch 'develop' into wip/1397-time-value
Nov 19, 2019
e083253
Merge branch 'develop' into wip/1397-time-value
Nov 19, 2019
ef51dd9
fix(build): Increase GraphDB query timeout for knora-test-unit.
Nov 19, 2019
54510a5
Merge branch 'develop' into wip/1397-time-value
Nov 27, 2019
75c009c
Merge branch 'develop' into wip/1397-time-value
Nov 28, 2019
2b97dee
Merge branch 'develop' into wip/1397-time-value
Nov 28, 2019
29f8ada
Merge branch 'develop' into wip/1397-time-value
Dec 2, 2019
8d033ca
Merge branch 'develop' into wip/1397-time-value
Dec 3, 2019
e4c472d
Merge branch 'develop' into wip/1397-time-value
Dec 5, 2019
44037d9
Merge branch 'develop' into wip/1397-time-value
Dec 10, 2019
d88a610
Merge branch 'develop' into wip/1397-time-value
Dec 12, 2019
c207cf9
test: Add e2e tests and client API test data for time values.
Dec 16, 2019
dae188e
Merge branch 'develop' into wip/1397-time-value
Jan 2, 2020
27e94e3
test(api-v1): Fix test.
Jan 2, 2020
07e2d6d
Merge branch 'develop' into wip/1397-time-value
Jan 16, 2020
4cadfbb
test: Fix tests.
Jan 17, 2020
33fea14
test: Update test data.
Jan 17, 2020
a8232df
test: Fix test.
Jan 17, 2020
995f459
Merge branch 'develop' into wip/1397-time-value
Jan 21, 2020
22d6ac4
build: Remove files added by mistake.
Jan 21, 2020
ca06cef
test(api-v2): Add time value test responses.
Jan 22, 2020
27a6807
test(clientapi): Add time value when testing resource creation.
Jan 24, 2020
1961a4d
test: Try unsuccessfully to add timestamp mapping.
Jan 27, 2020
f70fe6c
test(standoff): Test a standoff mapping with a timestamp tag.
Jan 27, 2020
df4ae70
Merge branch 'develop' into wip/1397-time-value
Jan 28, 2020
68ab4d5
feat(salsah1): Support time values in SALSAH 1.
Jan 28, 2020
e40c2cb
Merge branch 'develop' into wip/1397-time-value
Feb 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/src/paradox/02-knora-ontologies/knora-base.md
Expand Up @@ -428,6 +428,17 @@ regardless of the calendar in which they were entered. Properties:

: The precision of the end of the period.

##### TimeValue

A Knora time value represents a precise moment in time in the Gregorian
calendar. Since nanosecond precision can be included, it is suitable
for use as a timestamp. Properties:

`valueHasTimeStamp` (1)

: An `xsd:dateTimeStamp`, stored as an `xsd:dateTime` (because SPARQL
does not support `xsd:dateTimeStamp`).

##### IntValue

Represents an integer. Property:
Expand Down Expand Up @@ -933,6 +944,8 @@ Standoff data type tags are subclasses of `ValueBase` classes.
is stored in the same form that is used for `kb:IntervalValue`. See @ref:[IntervalValue](#intervalvalue).
* `StandoffBooleanTag` Indicates that a substring represents a Boolean, which is stored
in the same form that is used for `kb:BooleanValue`. See @ref:[BooleanValue](#booleanvalue).
* `StandoffTimeTag` Indicates that a substring represents a timestamp, which is stored
in the same form that is used for `kb:TimeValue`. See @ref:[TimeValue](#timevalue).

##### StandoffLinkTag

Expand Down
2 changes: 2 additions & 0 deletions docs/src/paradox/03-apis/api-v1/xml-to-standoff-mapping.md
Expand Up @@ -280,6 +280,8 @@ Knora allows the use of all its value types as standoff data types
type attribute, e.g. `1.1,2.2`).
- `knora-base:StandoffBooleanTag`: Represents a Boolean value (`true`
or `false` must be submitted in the data type attribute).
- `knora-base:StandoffTimeTag`: Represents a timestamp value (an `xsd:dateTimeStamp`
must be submitted in the data type attribute).

The basic idea is that parts of a text can be marked up in a way that
allows using Knora's built-in data types. In order to do so, the typed
Expand Down
Expand Up @@ -37,6 +37,9 @@ with existing data, the following must happen:
existing repositories so that they are compatible with the code changes
introduced in the pull request.

The order of version numbers must correspond to the order in which the pull requests
are merged.

## Adding an Upgrade Plugin

An upgrade plugin is a Scala class that extends `UpgradePlugin`. The name of the plugin
Expand Down
43 changes: 41 additions & 2 deletions knora-ontologies/knora-base.ttl
Expand Up @@ -33,7 +33,7 @@

:attachedToProject knora-admin:SystemProject ;

:ontologyVersion "knora-base v6" .
:ontologyVersion "knora-base v7" .



Expand Down Expand Up @@ -1535,6 +1535,18 @@



### http://www.knora.org/ontology/knora-base#valueHasTimeStamp

:valueHasTimeStamp rdf:type owl:DatatypeProperty ;

rdfs:subPropertyOf :valueHas ;

:subjectClassConstraint :TimeBase ;

:objectDatatypeConstraint xsd:dateTime .



### http://www.knora.org/ontology/knora-base#valueHasListNode

:valueHasListNode rdf:type owl:ObjectProperty ;
Expand All @@ -1546,7 +1558,6 @@
:objectClassConstraint :ListNode .



### http://www.knora.org/ontology/knora-base#valueHasOrder

:valueHasOrder rdf:type owl:DatatypeProperty ;
Expand Down Expand Up @@ -2008,6 +2019,24 @@
rdfs:comment "Represents a time interval, e.g. in an audio recording"@en .


:TimeBase rdf:type owl:Class ;

rdfs:subClassOf :ValueBase ,
[ rdf:type owl:Restriction ;
owl:onProperty :valueHasTimeStamp ;
owl:cardinality "1"^^xsd:nonNegativeInteger
] .


### http://www.knora.org/ontology/knora-base#IntervalValue

:TimeValue rdf:type owl:Class ;

rdfs:subClassOf :Value ,
:TimeBase ;

rdfs:comment "Represents a timestamp"@en .


### http://www.knora.org/ontology/knora-base#LinkObj

Expand Down Expand Up @@ -2431,6 +2460,16 @@
rdfs:comment "Represents an interval in a TextValue"@en .


### http://www.knora.org/ontology/knora-base#StandoffTimeTag

:StandoffTimeTag rdf:type owl:Class ;

rdfs:subClassOf :StandoffDataTypeTag,
:TimeBase ;

rdfs:comment "Represents a timestamp in a TextValue"@en .


### http://www.knora.org/ontology/knora-base#StandoffBooleanTag

:StandoffBooleanTag rdf:type owl:Class ;
Expand Down
7 changes: 7 additions & 0 deletions knora-ontologies/salsah-gui.ttl
Expand Up @@ -141,6 +141,13 @@



### http://www.knora.org/ontology/salsah-gui#TimeStamp

:TimeStamp rdf:type :Guielement ,
owl:NamedIndividual .



### http://www.knora.org/ontology/salsah-gui#List

:List rdf:type :Guielement ,
Expand Down
2 changes: 1 addition & 1 deletion salsah1/src/public/js/00_init_javascript.js
Expand Up @@ -70,7 +70,6 @@ var VALTYPE_FLOAT = "http://www.knora.org/ontology/knora-base#DecimalValue";
var VALTYPE_DATE = "http://www.knora.org/ontology/knora-base#DateValue";
var VALTYPE_PERIOD = 5;
var VALTYPE_RESPTR = "http://www.knora.org/ontology/knora-base#LinkValue";
var VALTYPE_TIME = "http://www.knora.org/ontology/knora-base#TimeValue";
var VALTYPE_INTERVAL = "http://www.knora.org/ontology/knora-base#IntervalValue";
var VALTYPE_GEOMETRY = "http://www.knora.org/ontology/knora-base#GeomValue";
var VALTYPE_COLOR = "http://www.knora.org/ontology/knora-base#ColorValue";
Expand All @@ -81,6 +80,7 @@ var VALTYPE_RICHTEXT = "http://www.knora.org/ontology/knora-base#TextValue";
var VALTYPE_GEONAME = 15;
var VALTYPE_URI = "http://www.knora.org/ontology/knora-base#UriValue";
var VALTYPE_BOOLEAN = "http://www.knora.org/ontology/knora-base#BooleanValue";
var VALTYPE_TIME = "http://www.knora.org/ontology/knora-base#TimeValue";

var RESOURCE_TYPE_REGION = "http://www.knora.org/ontology/knora-base#Region";

Expand Down
11 changes: 5 additions & 6 deletions salsah1/src/public/js/03_showval.js
Expand Up @@ -20,7 +20,7 @@
SALSAH.showval = function(value_container, prop, value_index, options)
{

//console.log("in showval: valtype is " + prop.valuetype_id);
// console.log("in showval: valtype is " + prop.valuetype_id);
switch (prop.valuetype_id) {
// this value type is mot used anymore: every text is a richtext now
/*case VALTYPE_TEXT: {
Expand All @@ -41,6 +41,10 @@ SALSAH.showval = function(value_container, prop, value_index, options)
value_container.append(prop.values[value_index]);
break;
}
case VALTYPE_TIME: {
value_container.append(prop.values[value_index]);
break;
}
case VALTYPE_BOOLEAN: {
var checkbox = $('<input>', {
type: "checkbox"
Expand Down Expand Up @@ -166,11 +170,6 @@ SALSAH.showval = function(value_container, prop, value_index, options)
}
break;
}
case VALTYPE_TIME: {
value_container.timeobj('init', prop.values[value_index]);
//value_container.append(prop.values[value_index]);
break;
}
case VALTYPE_INTERVAL: {
//value_container.append(prop.values[value_index]);
value_container.timeobj('init', prop.values[value_index]);
Expand Down
10 changes: 5 additions & 5 deletions salsah1/src/public/js/jquery.editvalue.js
Expand Up @@ -101,6 +101,10 @@
ele.append(settings.property.values[value_index]);
break;
}
case VALTYPE_TIME: {
ele.append(settings.property.values[value_index]);
break;
}
case VALTYPE_DATE: {
ele.dateobj('init', settings.property.values[value_index]);
break;
Expand Down Expand Up @@ -189,11 +193,6 @@
}
break;
}
case VALTYPE_TIME: {
ele.timeobj('init', settings.property.values[value_index]);
//ele.append(settings.property.values[value_index]);
break;
}
case VALTYPE_INTERVAL: {
//ele.append(settings.property.values[value_index]);
ele.append('VALTYPE_INTERVAL: NOT YET IMPLEMENTED!');
Expand Down Expand Up @@ -510,6 +509,7 @@

postdata[VALTYPE_INTEGER] = postdata[VALTYPE_TEXT];
postdata[VALTYPE_FLOAT] = postdata[VALTYPE_TEXT];
postdata[VALTYPE_TIME] = postdata[VALTYPE_TEXT];

postdata[VALTYPE_RICHTEXT] = function(value, is_new_value) {
var data = {};
Expand Down
22 changes: 11 additions & 11 deletions salsah1/src/public/js/jquery.extsearch.js
Expand Up @@ -268,6 +268,17 @@
valfield.append($('<input>', {'type': 'text', name: 'searchval', size: 16, maxlength: 32}).addClass('propval').data('gui_element', 'text'));
break;
}
case VALTYPE_TIME: { // we use gui_element = "text"
compop.append($('<option>', {'value': 'EQ', 'title': 'equal'}).append('='));
compop.append($('<option>', {'value': 'GT', 'title': 'greater than'}).append('&gt;'));
compop.append($('<option>', {'value': 'GT_EQ', 'title': 'greater equal than'}).append('&ge;'));
compop.append($('<option>', {'value': 'LT', 'title': 'less than'}).append('&lt;'));
compop.append($('<option>', {'value': 'LT_EQ', 'title': 'less equal than'}).append('&le;'));
compop.append($('<option>', {'value': '!EQ', 'title': 'not equal'}).append('&ne;'));
compop.append($('<option>', {'value': 'EXISTS', 'title': 'exists'}).append('&exist;'));
valfield.append($('<input>', {'type': 'text', name: 'searchval', size: 16, maxlength: 32}).addClass('propval').data('gui_element', 'text'));
break;
}
case VALTYPE_DATE: { // we use gui_element = "date"
compop.append($('<option>', {'value': 'EQ', 'title': 'equal'}).append('='));
compop.append($('<option>', {'value': 'GT', 'title': 'greater than'}).append('&gt;'));
Expand Down Expand Up @@ -370,17 +381,6 @@
.appendTo(valfield);
break;
}*/
case VALTYPE_TIME: { // we use gui_element = "text"
compop.append($('<option>', {'value': 'EQ'}).append('='));
compop.append($('<option>', {'value': 'GT', 'title': 'greater than'}).append('&gt;'));
compop.append($('<option>', {'value': 'GT_EQ', 'title': 'greater equal than'}).append('&ge;'));
compop.append($('<option>', {'value': 'LT', 'title': 'less than'}).append('&lt;'));
compop.append($('<option>', {'value': 'LT_EQ', 'title': 'less equal than'}).append('&le;'));
compop.append($('<option>', {'value': 'IN'}).append('in'));
compop.append($('<option>', {'value': 'EXISTS', 'title': 'Exists'}).append('&exist;'));
valfield.append($('<input>', {'type': 'text', name: 'searchval'}).addClass('propval').data('gui_element', 'text'));
break;
}
case VALTYPE_INTERVAL: {
compop.append($('<option>', {'value': 'EXISTS', 'title': 'exists'}).append('&exist;'));
compop.append('NOT YET IMPLEMENTED!');
Expand Down