IRI resolution against a same-scheme base rewrites absolute info: IRIs (info:a/b -> info:a/a/b) since jena-iri removal

オープン
#4,388 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@afs がすでに取り組んでいます。

2026年11月6日 から。

評価

この issue はまだ評価されていません。

説明

Version

6.2.0

What happened?

When the base IRI and the reference share a scheme and the scheme uses a rootless path with no authority (e.g. info:), an absolute reference is resolved as if it were relative:

var m = ModelFactory.createDefaultModel();
m.read(new ByteArrayInputStream(
    "<info:fedora/resource1> <http://x/p> <info:fedora/resource2> .".getBytes()),
    "info:fedora/resource1", "TURTLE");
m.write(System.out, "N-TRIPLES");

Jena 5.5.0 (default provider IRIProviderJenaIRI):

<info:fedora/resource1> <http://x/p> <info:fedora/resource2> .

Jena 6.2.0 (default provider IRIProvider3986):

<info:fedora/fedora/resource1> <http://x/p> <info:fedora/fedora/resource2> .

The same happens with UpdateFactory.create(sparql, base).

The cause is in IRI3986.resolve, which already behaves this way in 5.5.0:

IRI3986.create("info:fedora/resource1").resolve(IRI3986.create("info:fedora/resource2"))
// -> info:fedora/fedora/resource2

This matches the non-strict branch of RFC 3986 §5.2.2 (if (!strict) and R.scheme == Base.scheme then undefine R.scheme). RFC 3986 calls this a loophole from earlier specifications whose use "should be avoided" and keeps it only for backward compatibility. A reference with a scheme is expected to be returned unchanged, apart from dot-segment removal.

In 5.x this did not matter because IRIProviderJenaIRI was the default. 6.x removes jena-iri, so IRIProvider3986 is the only provider and there is no way to get strict resolution.

Impact: Fedora Commons (fcrepo) parses internal RDF and SPARQL Update with an info:fedora/... base. With 6.x, every absolute info:fedora/... IRI is rewritten to info:fedora/fedora/..., which corrupts stored triples. Found while evaluating the upgrade in https://github.com/fcrepo/fcrepo/pull/2338.

Expected: an absolute reference whose scheme equals the base's scheme resolves to itself (strict RFC 3986 resolution), or strict mode can at least be configured.

主要言語
Java
スター
1.5k
フォーク
733
平均マージ
1日 8時間
マージ済み PR(30日)
56

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/jena のほかの issue

apache/jena の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。