You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently no way for a library user to change this value.
For my use-case (an RDF Linter), it is very useful to set this to true.
I did so in code, installing the library from source locally, and then using it in the linter. That allows me to find issues with lang-tags in Turtle files, for example.
Would it be an option to set this field to public, so that I don't have to maintain a separate version of the library and keeping it up to date, just for this functionality?
Are you interested in contributing a solution yourself?
Yes
The text was updated successfully, but these errors were encountered:
There should be no problem exposing this for Eyeball-NG.
But it affects the whole system, unless you mean setting true, parsing then resetting. When run as a command line tool, that could be acceptable; run as a library, then it is not.
The rest of the system assumes language tags are unique.
A better way that should work:
There is a way to tap into exactly what is coming out of a parser before NodeFactory.
A parser run has a FactoryRDF object. It is settable with RDFParserBuilder factory. All nodes creation should be via this route.
ParserProfile is the interface of events coming out of the parser including node creation - it includes line/column in the parser.It calls an FactoryRDF
One method of FactoryRDF is createLangLiteral(String lexical, String langTag) so it is seeing the language tag before going to NodeFactory that canoicalizes it.
By inheriting or wrapping, you could test the language tag, and pass it on to usual FactoryRDF method having noted any issues.
It is only at NodeFactory.createLiteralLang/createLiteralDirLang that the language tag is manipulated. The equals and hashCode of Node_Literal are case sensitive so they don't get in the way.
Constructors for Node_Literal are package-scoped to prevent apps creating such bad literals.
To get the line/col number needs a ParserProfile but it is harder to set a custom one (possible, but it may need to be per language).
Version
5.4.0-SNAPSHOT (a1ca2b7)
Feature
In jena-core/src/main/java/org/apache/jena/graph/NodeFactory.java,
There is a line:
There is currently no way for a library user to change this value.
For my use-case (an RDF Linter), it is very useful to set this to true.
I did so in code, installing the library from source locally, and then using it in the linter. That allows me to find issues with lang-tags in Turtle files, for example.
Would it be an option to set this field to public, so that I don't have to maintain a separate version of the library and keeping it up to date, just for this functionality?
Are you interested in contributing a solution yourself?
Yes
The text was updated successfully, but these errors were encountered: