You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jena.apache.org by "SvenPVoigt (via GitHub)" <gi...@apache.org> on 2023/02/13 19:05:33 UTC
[GitHub] [jena] SvenPVoigt opened a new issue, #1756: Base IRI stripped when reading TTL file and base IRI uses tag scheme.
SvenPVoigt opened a new issue, #1756:
URL: https://github.com/apache/jena/issues/1756
### Version
4.7.0 and 4.6.1
### What happened?
Consider the case where `model.read(someFile, base, lang)` should expand urls in the file using base. When using `base = "http://example.org/myField/"` a url like `<process>` in the TTL file gets expanded to `<http://example.org/myField/process>`. However, if I am using the tag schema, most of the tag IRI gets cut off. For instance, my base IRI `tag:svenpvoigt@gmail.com,2023:` gets shortened to `tag:`. Minimal example below.
```java
String modelString = "<process> <produces> \"50\".";
Model model = ModelFactory.createDefaultModel();
model.read( new ByteArrayInputStream(modelString.getBytes()), "tag:svenpvoigt@gmail.com,2023:" , "TTL");
model.write(System.out, "TTL");
```
Current output:
`<tag:process> <tag:produces> "50" .`
Expected output:
`<tag:svenpvoigt@gmail.com,2023:process> <tag:svenpvoigt@gmail.com,2023:produces> "50" .`
### Relevant output and stacktrace
_No response_
### Are you interested in making a pull request?
None
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
[GitHub] [jena] SvenPVoigt closed issue #1756: Base IRI stripped when reading TTL file and base IRI uses tag scheme.
Posted by "SvenPVoigt (via GitHub)" <gi...@apache.org>.
SvenPVoigt closed issue #1756: Base IRI stripped when reading TTL file and base IRI uses tag scheme.
URL: https://github.com/apache/jena/issues/1756
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
[GitHub] [jena] afs commented on issue #1756: Base IRI stripped when reading TTL file and base IRI uses tag scheme.
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1756:
URL: https://github.com/apache/jena/issues/1756#issuecomment-1429629486
The URI standard isn't simple - feels liek is shoudl be, but it's grown evolved over time and the schema-specific rules evolve as well and they introduce new restrictions (e.g. urn's now can't be `urn:x:` - single letter NID (namespace identifier) are no longer formally allowed. file URLs now have a definition that reflects real usage).
There's a new IRI parser subsystem making non-urgent progress that Jena can switch to. A switchable implementation choice are mostly in. Reading RDF?XML is still directly using jena-iri.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
[GitHub] [jena] SvenPVoigt commented on issue #1756: Base IRI stripped when reading TTL file and base IRI uses tag scheme.
Posted by "SvenPVoigt (via GitHub)" <gi...@apache.org>.
SvenPVoigt commented on issue #1756:
URL: https://github.com/apache/jena/issues/1756#issuecomment-1428901501
Hey sorry I deleted my previous comment before your response because I realized I missed an important part of the RFC 3986 referring to the specification of a base URI (sec 5.1) and realized that I had been working on the naive assumption that the base URI was simply another way of specifying a prefix. Sorry for not making that distinction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
[GitHub] [jena] SvenPVoigt commented on issue #1756: Base IRI stripped when reading TTL file and base IRI uses tag scheme.
Posted by "SvenPVoigt (via GitHub)" <gi...@apache.org>.
SvenPVoigt commented on issue #1756:
URL: https://github.com/apache/jena/issues/1756#issuecomment-1428770066
Hierarchy, in the sense of the URI standard, means that parts separated by the general delimiters ":" , "/" , "?" , "#" have decreasing importance when parsing. And they must go in decreasing order from left to right. First : then / then ? then #.
That is why you can have many path delimiters `/` as well. A double `//` is usually used to denote hosts and it following the `:` is not an indication of whether or not a URI is hierarchical.
Not seeing why the URI resolution technique here shouldn't work for tag URIs.
> a path of "[svenpvoigt@gmail.com](mailto:svenpvoigt@gmail.com),2023:"
`svenpvoigt@gmail.com,2023` is not a path, it is an authority name followed by a date.
> The resolution rules of URIs mean anything after the last "/" is removed, taking it back to tag:
> Or use fragments
Is this saying that only the delimiters / and # are used to decide where the base URI starts? Then we just include `:` then, no? And the other general delimiters specified in RFC 3986, as it would make to use any of the URI delimiters as a final part of a base URI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
[GitHub] [jena] afs commented on issue #1756: Base IRI stripped when reading TTL file and base IRI uses tag scheme.
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1756:
URL: https://github.com/apache/jena/issues/1756#issuecomment-1428883535
I see what you want to happen - it's that the RFC that does not support it. `urn:` and `did:` get caught by this as well.
Jena isn't making an opinion nor does Jena does implement different URI schemes differently for parsing - it is implementing the grammar and algorithms in the RFC.
URI syntax is defined in [Appendix A Collected ABNF for URI](https://www.rfc-editor.org/rfc/rfc3986#appendix-A).
> Hierarchy, in the sense of the URI standard, means that parts separated by the general delimiters
Sorry - I used "hierarchical URI scheme is old language from RFC 2396 by mistake.
One of the parts is "path" and that is further decomposed in [5.2.3 Merge Paths](https://www.rfc-editor.org/rfc/rfc3986#section-5.2.3) - see the second bullet which dropt characters after the last "/".
> `svenpvoigt@gmail.com,2023` is not a path, it is an authority name followed by a date.
Both mentions of `authority` in the grammar are preceded by "//".
After the scheme `tag:`, `svenpvoigt@gmail.com,2023` matches `segment-nz` in `path-rootless`.
'tag://svenpvoigt@gmail.com,2023:' is as below (the ":" is the empty port) because `,` can be part of an authority name via the `reg-name` rule.
```
Scheme|tag| Authority|svenpvoigt@gmail.com,2023:| Host|gmail.com,2023| Port|| Path|| Query|null| Fragment|null|
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
[GitHub] [jena] afs commented on issue #1756: Base IRI stripped when reading TTL file and base IRI uses tag scheme.
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1756:
URL: https://github.com/apache/jena/issues/1756#issuecomment-1428701293
Base URI is not simply prepended. It follows URI resolution rules for hierarchical URIs.
Technically, "tag:" is a not hierarchical URI scheme (does not have "//" after the domain name).
c.f. "http:a/b/c".
"tag:svenpvoigt@gmail.com,2023:" is URI scheme "tag:" and a path of "svenpvoigt@gmail.com,2023:".
`:`, nor any of those others characters, are special in a URI. Only "/", the hierarchical path character, is special for paths and path resolution.
The resolution rules of URIs mean anything after the last "/" is removed, taking it back to `tag:`.
c.f. "/folder/abc" is a base of "/folder/". It makes `<a href="fileInSameDirectory">` work.
It also makes `BASE <https:>` and URI `//host/xyz` become `https://host/xyz`.
Prefixes are concatenations:
```
PREFIX tag: <tag:svenpvoigt@gmail.com,2023:>
tag:process tag:produces "50" .
```
Or use fragments:
```
String modelString = "<#process> <#produces> \"50\".";
```
The same happens with URNs and it's use of ":".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org