You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jena.apache.org by "larisa1995 (via GitHub)" <gi...@apache.org> on 2023/07/10 11:36:46 UTC
[GitHub] [jena] larisa1995 opened a new issue, #1954: riot.ttl changes encoding of the file
larisa1995 opened a new issue, #1954:
URL: https://github.com/apache/jena/issues/1954
### Version
apache-jena-4.8.0
### What happened?
When using riot.bat to convert serializations (ttl to nt) with the below command, the UTF-8 encoding of an input file changes to UTF-16 LE BOM. I check encoding with Notepad++.
riot --strict --output=ntriples simpleExample.ttl > simpleExample.nt
### 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] larisa1995 commented on issue #1954: riot.bat changes encoding of the file
Posted by "larisa1995 (via GitHub)" <gi...@apache.org>.
larisa1995 commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1631185811
">" redirection changes encoding
--
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] rvesse commented on issue #1954: riot.bat changes encoding of the file
Posted by "rvesse (via GitHub)" <gi...@apache.org>.
rvesse commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1630991668
What JVM are you using?
The fact that you see the same effect across multiple Java based tools would tend to imply a JVM effect from usage of some core Java IO APIs rather than a specific bug in any one tool.
Presumably the 3rd tool reads files in a different way to the others
--
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 #1954: riot.bat changes encoding of the file
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1631201146
Thanks for letting us know. If any Windows users have suggestions here, please let us know.
--
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] larisa1995 commented on issue #1954: riot.ttl changes encoding of the file
Posted by "larisa1995 (via GitHub)" <gi...@apache.org>.
larisa1995 commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1630436213
Dear @afs
Please see the input and output attached as a zip file and the characteristics of a sole Windows below. Unfortunately, I'm nothing like a programmer so I do not use any IDE.
PS C:\Users\lzhuchiy> [System.Text.Encoding]::Default
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 1252
[simpleExample.zip](https://github.com/apache/jena/files/12012720/simpleExample.zip)
Minor: I made a typo in the title of the GitHub issue and there seems to be no way for me to fix it. Please fix it on your own if possible.
--
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] larisa1995 commented on issue #1954: riot.bat changes encoding of the file
Posted by "larisa1995 (via GitHub)" <gi...@apache.org>.
larisa1995 commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1631185024
Dear @afs
I run RMLMapper as follows
java -jar rmlmapper.jar -m map.rml.ttl -o simpleExample.ttl -s turtle
Thank you for the ">" redirection hint and sorry for bothering you.
--
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] larisa1995 commented on issue #1954: riot.bat changes encoding of the file
Posted by "larisa1995 (via GitHub)" <gi...@apache.org>.
larisa1995 commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1631000271
Dear @rvesse
SHACL API and Blaber are both based on Jena. Please see the Java characteristics below.
`
C:\Users\lzhuchiy>java -version
java version "17.0.5" 2022-10-18 LTS
Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing)
`
--
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] larisa1995 commented on issue #1954: riot.bat changes encoding of the file
Posted by "larisa1995 (via GitHub)" <gi...@apache.org>.
larisa1995 commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1630856603
Dear @afs
Thank you for your prompt reply.
No, I did not apply Notepad++ to the provided examples. This is a riot.bat output. I just open them in Notepad++ to check encoding.
Regular Notepad of Windows (not Notepad++) shows UTF-16 LE encoding.
I noticed problems when using riot.bat repeatedly for the same file to change serialization. My specific case was "ntriples (in UTF-8) -> turtle -> XML/RDF".
The first iteration produces UTF-16 output, but the second one expects UTF-8 file as input.
As a result, the second iteration (turtle to XML/RDF) produces an error file because the first one changed encoding.
But if manually change the encoding of the result of the first iteration from UTF-16 to UTF-8 in Notepad++, then it works fine (actually probably just Powershell without the Notepad++ could have helped).
This also happens without using Notepad++ at all. The first iteration produces UTF-16 output, but the second one expects UTF-8 file as input.
Please see "no Notepad++, not even to check encoding" files just riot.bat attached (file with error included).
[simpleExample1.zip](https://github.com/apache/jena/files/12015310/simpleExample1.zip)
--
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] rvesse commented on issue #1954: riot.bat changes encoding of the file
Posted by "rvesse (via GitHub)" <gi...@apache.org>.
rvesse commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1631964096
> SHACL API and Blabel are both based on Jena.
Blabel uses https://github.com/nxparser/nxparser AFAICT
--
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 #1954: riot.ttl changes encoding of the file
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1629491484
Could you please attach the input and output files to this issue? (as a zip file if that helps avoiding any translation).
Jena should write UTF-8 which is the defined out the N-Triples standard. No BOM is written.
What character set is set in your windows environment?
--
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 #1954: riot.bat changes encoding of the file
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1630640670
When I run riot (on Linux) `riot --strict --output=ntriples simpleExample.ttl > simpleExample.nt` I get:
```
<http://www.example.com/SK002> <http://www.example.com/friend> <http://www.example.com/SK00c> .
```
and it starts in hex: `3c 68 74 74 70 3a` which is `< h t t p :` -- no BOM.
Same with output to RDF/XML. It starts `<` as XML does.
Your `simpleExample.rdf` is some 16 bit unicode. Is that the output from riot directly or did you use Notepad++ on the file at any time? If so, maybe it's the notepad++ settings.
`riot` can read your `simpleExample.rdf` because it uses the Java XML parser and that handles the BOM setup. this onyl applies to XML-based formats.
--
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] larisa1995 commented on issue #1954: riot.bat changes encoding of the file
Posted by "larisa1995 (via GitHub)" <gi...@apache.org>.
larisa1995 commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1630942640
If it is of any help, I use SHACL API [1] and RMLMapper [2] in parallel with Jena and the first one also changes encoding while the second one stays with UTF-8.
[1] https://github.com/TopQuadrant/shacl
[2] https://github.com/RMLio/rmlmapper-java
--
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 #1954: riot.bat changes encoding of the file
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1954:
URL: https://github.com/apache/jena/issues/1954#issuecomment-1631110169
It could be the bat script execution or the ">" redirection.
The bat scripts got rebuilt for v 4.8.0 (issue #1911) and another small change, otherwise they have been stable for quite sometime.
Are you running [/RMLio/rmlmapper-java](https://github.com/RMLio/rmlmapper-java) as "java -jar rmlmapper.jar"?
--
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] larisa1995 closed issue #1954: riot.bat changes encoding of the file
Posted by "larisa1995 (via GitHub)" <gi...@apache.org>.
larisa1995 closed issue #1954: riot.bat changes encoding of the file
URL: https://github.com/apache/jena/issues/1954
--
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