Skip to content

Commit

Permalink
fix: Decimals without decimal point lead to inconsistent data (DEV-3927
Browse files Browse the repository at this point in the history
…) (#3329)
  • Loading branch information
BalduinLandolt authored Jul 29, 2024
1 parent 106c8ea commit 3eb5973
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ object ResourcesRepoLive {
case IntegerValueInfo(valueHasInteger) =>
List(iri(valueIri).has(KB.valueHasInteger, literalOf(valueHasInteger)))
case DecimalValueInfo(valueHasDecimal) =>
List(iri(valueIri).has(KB.valueHasDecimal, literalOf(valueHasDecimal)))
List(iri(valueIri).has(KB.valueHasDecimal, literalOfType(valueHasDecimal.toString(), XSD.DECIMAL)))
case BooleanValueInfo(valueHasBoolean) =>
List(iri(valueIri).has(KB.valueHasBoolean, literalOf(valueHasBoolean)))
case UriValueInfo(valueHasUri) =>
Expand All @@ -202,8 +202,8 @@ object ResourcesRepoLive {
case IntervalValueInfo(valueHasIntervalStart, valueHasIntervalEnd) =>
List(
iri(valueIri)
.has(KB.valueHasIntervalStart, literalOf(valueHasIntervalStart))
.andHas(KB.valueHasIntervalEnd, literalOf(valueHasIntervalEnd)),
.has(KB.valueHasIntervalStart, literalOfType(valueHasIntervalStart.toString(), XSD.DECIMAL))
.andHas(KB.valueHasIntervalEnd, literalOfType(valueHasIntervalEnd.toString(), XSD.DECIMAL)),
)
case TimeValueInfo(valueHasTimeStamp) =>
List(iri(valueIri).has(KB.valueHasTimeStamp, literalOfType(valueHasTimeStamp.toString(), XSD.DATETIME)))
Expand Down Expand Up @@ -254,7 +254,7 @@ object ResourcesRepoLive {
case StandoffAttributeValue.InternalReferenceAttribute(value) => iri(value.value)
case StandoffAttributeValue.StringAttribute(value) => literalOf(value)
case StandoffAttributeValue.IntegerAttribute(value) => literalOf(value)
case StandoffAttributeValue.DecimalAttribute(value) => literalOf(value)
case StandoffAttributeValue.DecimalAttribute(value) => literalOfType(value.toString(), XSD.DECIMAL)
case StandoffAttributeValue.BooleanAttribute(value) => literalOf(value)
case StandoffAttributeValue.TimeAttribute(value) => literalOfType(value.toString(), XSD.DATETIME)
val p = iri(attribute.propertyIri.value)
Expand Down

0 comments on commit 3eb5973

Please sign in to comment.