Skip to content

Commit 44dbbd2

Browse files
authored
Revert "Better support for Unicode paths (#1123)" (#1126)
This reverts commit a2f5b48.
1 parent 6feb82b commit 44dbbd2

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

components/jena/src/main/java/org/trellisldp/jena/JenaIOService.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
import org.apache.jena.sparql.core.DatasetGraph;
7575
import org.apache.jena.sparql.core.DatasetGraphFactory;
7676
import org.apache.jena.update.UpdateException;
77-
import org.apache.jena.util.URIref;
7877
import org.eclipse.microprofile.config.Config;
7978
import org.slf4j.Logger;
8079
import org.trellisldp.api.CacheService;
@@ -235,7 +234,7 @@ public void write(final Stream<Triple> triples, final OutputStream output, final
235234

236235
try {
237236
if (RDFA.equals(syntax)) {
238-
writeHTML(triples, output, encodeURI(baseUrl));
237+
writeHTML(triples, output, baseUrl);
239238
} else {
240239
final Lang lang = JenaCommonsRDF.toJena(syntax).orElseThrow(() ->
241240
new TrellisRuntimeException("Invalid content type: " + syntax.mediaType()));
@@ -248,7 +247,7 @@ public void write(final Stream<Triple> triples, final OutputStream output, final
248247
stream.start();
249248
nsService.getNamespaces().forEach(stream::prefix);
250249
if (shouldUseRelativeIRIs(relativeIRIs, profiles)) {
251-
stream.base(encodeURI(baseUrl));
250+
stream.base(baseUrl);
252251
}
253252
triples.map(JenaCommonsRDF::toJena).forEachOrdered(stream::triple);
254253
stream.finish();
@@ -330,7 +329,7 @@ public Stream<Triple> read(final InputStream input, final RDFSyntax syntax, fina
330329
final Lang lang = JenaCommonsRDF.toJena(syntax).orElseThrow(() ->
331330
new TrellisRuntimeException("Unsupported RDF Syntax: " + syntax.mediaType()));
332331

333-
RDFParser.source(input).lang(lang).base(encodeURI(base)).parse(graph);
332+
RDFParser.source(input).lang(lang).base(base).parse(graph);
334333

335334
// Check the graph for any new namespace definitions
336335
final Set<String> namespaces = new HashSet<>(nsService.getNamespaces().values());
@@ -357,19 +356,12 @@ public void update(final Graph graph, final String update, final RDFSyntax synta
357356

358357
try {
359358
final org.apache.jena.graph.Graph g = JenaCommonsRDF.toJena(graph);
360-
execute(create(update, encodeURI(base)), g);
359+
execute(create(update, base), g);
361360
} catch (final UpdateException | QueryParseException ex) {
362361
throw new TrellisRuntimeException(ex);
363362
}
364363
}
365364

366-
static String encodeURI(final String uri) {
367-
if (uri != null) {
368-
return URIref.encode(uri);
369-
}
370-
return uri;
371-
}
372-
373365
static Set<String> intoSet(final String property) {
374366
return stream(property.split(",")).map(String::trim).filter(x -> !x.isEmpty()).collect(toSet());
375367
}

0 commit comments

Comments
 (0)