Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assembly-descriptors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-assembly-descriptors</artifactId>
<name>RDF4J: Assembly Descriptors</name>
Expand Down
2 changes: 1 addition & 1 deletion assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-assembly</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-bom</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion compliance/elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-compliance</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-elasticsearch-compliance</artifactId>
<name>RDF4J: Elasticsearch Sail Tests</name>
Expand Down
2 changes: 1 addition & 1 deletion compliance/geosparql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-compliance</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-geosparql-compliance</artifactId>
<name>RDF4J: GeoSPARQL compliance tests</name>
Expand Down
2 changes: 1 addition & 1 deletion compliance/lucene/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-compliance</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-lucene-compliance</artifactId>
<name>RDF4J: Lucene Sail Tests</name>
Expand Down
2 changes: 1 addition & 1 deletion compliance/model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>rdf4j-compliance</artifactId>
<groupId>org.eclipse.rdf4j</groupId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>rdf4j-model-compliance</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion compliance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-compliance</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion compliance/repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-compliance</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-repository-compliance</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion compliance/rio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-compliance</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-rio-compliance</artifactId>
<name>RDF4J: Rio compliance tests</name>
Expand Down
2 changes: 1 addition & 1 deletion compliance/solr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-compliance</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-solr-compliance</artifactId>
<name>RDF4J: Solr Sail Tests</name>
Expand Down
2 changes: 1 addition & 1 deletion compliance/sparql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-compliance</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-sparql-compliance</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion core/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-core</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-client</artifactId>
<name>RDF4J: Client Libraries</name>
Expand Down
2 changes: 1 addition & 1 deletion core/collection-factory/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-collection-factory</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-collection-factory-api</artifactId>
<name>RDF4J: Collection Factory - API</name>
Expand Down
2 changes: 1 addition & 1 deletion core/collection-factory/mapdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-collection-factory</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-collection-factory-mapdb</artifactId>
<name>RDF4J: Collection Factory - Map DB backed</name>
Expand Down
2 changes: 1 addition & 1 deletion core/collection-factory/mapdb3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-collection-factory</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-collection-factory-mapdb3</artifactId>
<name>RDF4J: Collection Factory - Map DB v3 backed</name>
Expand Down
2 changes: 1 addition & 1 deletion core/collection-factory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-core</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-collection-factory</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion core/common/annotation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-common</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common-annotation</artifactId>
<name>RDF4J: common annotation</name>
Expand Down
2 changes: 1 addition & 1 deletion core/common/exception/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-common</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common-exception</artifactId>
<name>RDF4J: common exception</name>
Expand Down
2 changes: 1 addition & 1 deletion core/common/io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-common</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common-io</artifactId>
<name>RDF4J: common IO</name>
Expand Down
2 changes: 1 addition & 1 deletion core/common/iterator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-common</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common-iterator</artifactId>
<name>RDF4J: common iterators</name>
Expand Down
2 changes: 1 addition & 1 deletion core/common/order/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-common</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common-order</artifactId>
<name>RDF4J: common order</name>
Expand Down
2 changes: 1 addition & 1 deletion core/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-core</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion core/common/text/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-common</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common-text</artifactId>
<name>RDF4J: common text</name>
Expand Down
2 changes: 1 addition & 1 deletion core/common/transaction/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-common</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common-transaction</artifactId>
<name>RDF4J: common transaction</name>
Expand Down
2 changes: 1 addition & 1 deletion core/common/xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-common</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-common-xml</artifactId>
<name>RDF4J: common XML</name>
Expand Down
2 changes: 1 addition & 1 deletion core/http/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-http</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-http-client</artifactId>
<name>RDF4J: HTTP client</name>
Expand Down
2 changes: 1 addition & 1 deletion core/http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-core</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-http</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion core/http/protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-http</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-http-protocol</artifactId>
<name>RDF4J: HTTP protocol</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.eclipse.rdf4j.query.Binding;
import org.eclipse.rdf4j.query.impl.SimpleBinding;
import org.eclipse.rdf4j.query.impl.SimpleDataset;
import org.eclipse.rdf4j.rio.helpers.RDFStarUtil;
import org.eclipse.rdf4j.rio.helpers.TripleTermUtil;
import org.xml.sax.SAXException;

/**
Expand Down Expand Up @@ -83,7 +83,7 @@ public void startDocument() throws SAXException {
public void startTag(String tagName, Map<String, String> atts, String text) throws SAXException {
if (TransactionXMLConstants.TRIPLE_TAG.equals(tagName)) {
// fixes GH-3048
parsedValues.add(RDFStarUtil.fromRDFEncodedValue(valueFactory.createIRI(text)));
parsedValues.add(TripleTermUtil.fromRDFEncodedValue(valueFactory.createIRI(text)));
} else if (TransactionXMLConstants.URI_TAG.equals(tagName)) {
parsedValues.add(valueFactory.createIRI(text));
} else if (TransactionXMLConstants.BNODE_TAG.equals(tagName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.eclipse.rdf4j.model.util.Literals;
import org.eclipse.rdf4j.query.Binding;
import org.eclipse.rdf4j.query.Dataset;
import org.eclipse.rdf4j.rio.helpers.RDFStarUtil;
import org.eclipse.rdf4j.rio.helpers.TripleTermUtil;

/**
* Serializes of an RDF transaction.
Expand Down Expand Up @@ -242,6 +242,8 @@ protected void serialize(Value value, XMLWriter xmlWriter) throws IOException {
serialize((Resource) value, xmlWriter);
} else if (value instanceof Literal) {
serialize((Literal) value, xmlWriter);
} else if (value instanceof Triple) {
serialize((Triple) value, xmlWriter);
} else if (value == null) {
serializeNull(xmlWriter);
} else {
Expand All @@ -254,8 +256,6 @@ protected void serialize(Resource resource, XMLWriter xmlWriter) throws IOExcept
serialize((IRI) resource, xmlWriter);
} else if (resource instanceof BNode) {
serialize((BNode) resource, xmlWriter);
} else if (resource instanceof Triple) {
serialize((Triple) resource, xmlWriter);
} else if (resource == null) {
serializeNull(xmlWriter);
} else {
Expand Down Expand Up @@ -313,7 +313,7 @@ protected void serializeNull(XMLWriter xmlWriter) throws IOException {

protected void serialize(Triple triple, XMLWriter xmlWriter) throws IOException {
if (triple != null) {
Value convertBase64 = RDFStarUtil.toRDFEncodedValue(triple);
Value convertBase64 = TripleTermUtil.toRDFEncodedValue(triple);
xmlWriter.textElement(TransactionXMLConstants.TRIPLE_TAG, convertBase64.stringValue());
} else {
serializeNull(xmlWriter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void testDecodeContext() {
assertEquals(vf.createBNode("bnode1"), Protocol.decodeContext("_:bnode1", vf));
assertEquals(vf.createIRI("urn:test"), Protocol.decodeContext("<urn:test>", vf));

// RDF-star triples are resources but they can't be used as context values
// triples can't be used as context values
try {
Protocol.decodeContext("<<<urn:a> <urn:b> <urn:c>>>", SimpleValueFactory.getInstance());
fail("Must fail with exception");
Expand Down
2 changes: 1 addition & 1 deletion core/model-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-core</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>6.0.0</version>
</parent>
<artifactId>rdf4j-model-api</artifactId>
<name>RDF4J: Model API</name>
Expand Down
34 changes: 34 additions & 0 deletions core/model-api/src/main/java/org/eclipse/rdf4j/model/Literal.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,36 @@
* @see <a href="https://www.w3.org/TR/xmlschema11-2">XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes</a>
*/
public interface Literal extends Value {
String LTR_SUFFIX = "--ltr";
String RTL_SUFFIX = "--rtl";
String BASE_DIR_SEPARATOR = "--";

enum BaseDirection {
NONE(""),
LTR(LTR_SUFFIX),
RTL(RTL_SUFFIX);

private final String suffix;

BaseDirection(final String suffix) {
this.suffix = suffix;
}

@Override
public String toString() {
return suffix;
}

public static BaseDirection fromString(final String dir) {
if (dir == null || dir.isEmpty())
return NONE;
if (dir.equals(LTR_SUFFIX))
return LTR;
if (dir.equals(RTL_SUFFIX))
return RTL;
throw new IllegalArgumentException("Unknown BaseDirection: " + dir);
}
}

@Override
default boolean isLiteral() {
Expand All @@ -61,6 +91,10 @@ default boolean isLiteral() {
*/
Optional<String> getLanguage();

default BaseDirection getBaseDirection() {
return BaseDirection.NONE;
}

/**
* Gets the datatype for this literal.
* <p>
Expand Down
Loading
Loading