Skip to content

Commit 64c8647

Browse files
authored
Merge main into develop (#5501)
2 parents 5ab846a + 0a5d5e3 commit 64c8647

8 files changed

Lines changed: 75 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,12 @@ rdf4j: root project
718718
* Don’t commit or push unless explicitly asked.
719719
* Don’t add new dependencies without explicit approval.
720720
721+
### Version Control Conventions
722+
723+
* Branch names must always start with the GitHub issue identifier in the form `GH-XXXX`, where `XXXX` is the numeric issue number.
724+
* Every commit message must be prefixed with the corresponding `GH-XXXX` label.
725+
* Exception: if no GitHub issue number is available for the task, clearly note this in your handoff and align with the requester on an appropriate branch/commit prefix before proceeding.
726+
721727
It is illegal to `-am` when running tests!
722728
It is illegal to `-q` when running tests!
723729
You must follow these rules and instructions exactly as stated.

core/model-api/src/main/java/org/eclipse/rdf4j/model/base/AbstractLiteral.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
import java.math.BigDecimal;
3333
import java.math.BigInteger;
3434
import java.time.DateTimeException;
35+
import java.time.Instant;
36+
import java.time.OffsetDateTime;
37+
import java.time.ZoneOffset;
3538
import java.time.format.DateTimeFormatter;
3639
import java.time.format.DateTimeFormatterBuilder;
3740
import java.time.format.DateTimeParseException;
@@ -704,15 +707,24 @@ private static int key(Predicate<ChronoField> include, ChronoField... fields) {
704707

705708
this.value = value;
706709

707-
datatype = DATATYPES.get(key(value));
710+
TemporalAccessor lexicalValue = value;
708711

709-
if (datatype == null) {
712+
CoreDatatype.XSD detectedDatatype = DATATYPES.get(key(lexicalValue));
713+
714+
if (detectedDatatype == null && value.isSupported(ChronoField.INSTANT_SECONDS)) {
715+
Instant instant = Instant.from(value);
716+
lexicalValue = OffsetDateTime.ofInstant(instant, ZoneOffset.UTC);
717+
detectedDatatype = DATATYPES.get(key(lexicalValue));
718+
}
719+
720+
if (detectedDatatype == null) {
710721
throw new IllegalArgumentException(String.format(
711722
"value <%s> cannot be represented by an XML Schema date/time datatype", value
712723
));
713724
}
714725

715-
this.label = FORMATTERS.get(datatype).format(value);
726+
datatype = detectedDatatype;
727+
this.label = FORMATTERS.get(datatype).format(lexicalValue);
716728
}
717729

718730
@Override

core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
package org.eclipse.rdf4j.model.util;
1212

1313
import static org.assertj.core.api.Assertions.assertThat;
14+
import static org.assertj.core.api.Assertions.assertThatCode;
1415
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
1516
import static org.junit.jupiter.api.Assertions.assertEquals;
1617
import static org.junit.jupiter.api.Assertions.assertFalse;
1718
import static org.junit.jupiter.api.Assertions.assertNotNull;
1819
import static org.junit.jupiter.api.Assertions.assertTrue;
1920
import static org.junit.jupiter.api.Assertions.fail;
2021

22+
import java.time.Instant;
2123
import java.util.Date;
2224
import java.util.GregorianCalendar;
2325
import java.util.IllformedLocaleException;
@@ -107,6 +109,17 @@ public void testNormaliseBCP47Tag() {
107109
.isThrownBy(() -> Literals.normalizeLanguageTag("ru-ua-latn"));
108110
}
109111

112+
@Test
113+
public void valuesLiteralSupportsInstant() {
114+
Instant instant = Instant.parse("2022-08-01T21:14:38.470534100Z");
115+
116+
Literal literal = Values.literal(instant);
117+
118+
assertThat(Instant.parse(literal.getLabel())).isEqualTo(instant);
119+
assertThat(literal.getDatatype()).isEqualTo(XSD.DATETIME);
120+
assertThat(literal.temporalAccessorValue()).isEqualTo(instant);
121+
}
122+
110123
/**
111124
* Test method for
112125
* {@link org.eclipse.rdf4j.model.util.Literals#getLabel(org.eclipse.rdf4j.model.Literal, java.lang.String)} .

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbStore.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ public LmdbStore(LmdbStoreConfig config) {
133133
IsolationLevels.SNAPSHOT, IsolationLevels.SERIALIZABLE);
134134
setDefaultIsolationLevel(IsolationLevels.SNAPSHOT_READ);
135135
config.getDefaultQueryEvaluationMode().ifPresent(this::setDefaultQueryEvaluationMode);
136+
if (config.getIterationCacheSyncThreshold() > 0) {
137+
setIterationCacheSyncThreshold(config.getIterationCacheSyncThreshold());
138+
}
136139
EvaluationStrategyFactory evalStrategyFactory = config.getEvaluationStrategyFactory();
137140
if (evalStrategyFactory != null) {
138141
setEvaluationStrategyFactory(evalStrategyFactory);

core/sail/lmdb/src/test/java/org/eclipse/rdf4j/sail/lmdb/config/LmdbStoreConfigTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import org.eclipse.rdf4j.model.impl.LinkedHashModel;
2323
import org.eclipse.rdf4j.model.util.ModelBuilder;
2424
import org.eclipse.rdf4j.model.util.Values;
25+
import org.eclipse.rdf4j.sail.lmdb.LmdbStore;
26+
import org.junit.jupiter.api.Test;
2527
import org.junit.jupiter.params.ParameterizedTest;
2628
import org.junit.jupiter.params.provider.ValueSource;
2729

@@ -65,6 +67,17 @@ void testThatLmdbStoreConfigParseAndExportValueCacheSize(final int valueCacheSiz
6567

6668
// TODO: Add more tests for other properties
6769

70+
@Test
71+
void setIterationCacheSyncThresholdShouldApplyToCreatedStore() {
72+
final long threshold = 42;
73+
final LmdbStoreConfig config = new LmdbStoreConfig();
74+
config.setIterationCacheSyncThreshold(threshold);
75+
76+
final LmdbStore store = new LmdbStore(config);
77+
78+
assertThat(store.getIterationCacheSyncThreshold()).isEqualTo(threshold);
79+
}
80+
6881
/**
6982
* Generic method to test parsing and exporting of config properties.
7083
*

site/content/about.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ This is useful if you are already using Elasticsearch for other things in your p
3131
A good usecase is if you need reference data or an ontology for your application. The built-in read cache makes it a good choice for data that updates infrequently,
3232
though for most usecases the NativeStore will be considerably faster.
3333

34+
{{< alert title="Licensing note" color="warning" >}}
35+
Elasticsearch itself is distributed under the Elastic License (with SSPL as an alternative). If you intend to use the optional Elasticsearch-backed features in RDF4J, please make sure to evaluate whether the licensing terms of Elasticsearch align with the needs of your project before adopting it.
36+
{{< /alert >}}
37+
3438
On top of these core databases, RDF4J offers a number of functional extensions. These extensions add functionality such as improved full-text search, RDFS inferencing, rule-based reasoning and validation using SHACL/SPIN, and geospatial querying support. For more information see the [RDF4J documentation](/documentation).
3539

3640
### Third party database solutions

site/content/documentation/programming/repository.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ The ElasticsearchStore stores RDF data in Elasticsearch. Not to be confused with
113113
The ElasticsearchStore is experimental and future releases may be incompatible with the current version. Write-ahead-logging is not supported.
114114
This means that a write operation can appear to have partially succeeded if the ElasticsearchStore looses its connection to Elasticsearch during a commit.
115115

116-
Note that, while RDF4J is licensed under the EDL, several ElasticSearch dependencies are licensed under the Elastic License or the SSPL,
117-
which may have implications for some projects.
116+
Note that, while RDF4J is licensed under the EDL, Elasticsearch itself is distributed under the Elastic License (with SSPL as an alternative).
117+
The Elasticsearch-backed functionality in RDF4J is optional, and adopters should carefully evaluate the Elasticsearch licensing terms to ensure they meet the needs of their projects before enabling it.
118118
Please consult the ElasticSearch website and [license FAQ](https://www.elastic.co/licensing/elastic-license/faq) for more information.
119119

120120
Transaction isolation is not as strong as for the other stores. The highest supported level is READ_COMMITTED, and even this

site/layouts/shortcodes/alert.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- $type := lower (default "info" (.Get "type")) -}}
2+
{{- $title := .Get "title" -}}
3+
{{- $icons := dict "info" "fa-info-circle" "warning" "fa-exclamation-triangle" "danger" "fa-exclamation-circle" "success" "fa-check-circle" -}}
4+
{{- $backgrounds := dict "info" "#e0f4ff" "warning" "#fff4e0" "danger" "#ffe3e3" "success" "#e7f5e7" -}}
5+
{{- $borders := dict "info" "#228be6" "warning" "#f08c00" "danger" "#c92a2a" "success" "#2f9e44" -}}
6+
{{- $icon := index $icons $type | default (index $icons "info") -}}
7+
{{- $background := index $backgrounds $type | default (index $backgrounds "info") -}}
8+
{{- $border := index $borders $type | default (index $borders "info") -}}
9+
<div class="alert-box alert-box-{{$type}}" role="alert" style="border-left:4px solid {{$border}}; background-color: {{$background}}; padding:1rem; margin:1rem 0; border-radius:0.5rem;">
10+
<div style="display:flex; align-items:flex-start; gap:0.75rem;">
11+
<i class="fa {{$icon}}" aria-hidden="true" style="font-size:1.75rem; line-height:1;"></i>
12+
<div class="alert-box-content">
13+
{{- if $title -}}
14+
<p style="font-weight:600; margin:0 0 0.25rem 0;">{{$title}}</p>
15+
{{- end -}}
16+
<div>{{ .Inner | markdownify }}</div>
17+
</div>
18+
</div>
19+
</div>

0 commit comments

Comments
 (0)