Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language tags in RDF4j #1292

Closed
MahekHanfi opened this issue Feb 12, 2019 · 4 comments
Closed

Language tags in RDF4j #1292

MahekHanfi opened this issue Feb 12, 2019 · 4 comments
Labels
specification issues related to compliance to standards and external specs website / documentation Website update / Documentation issue

Comments

@MahekHanfi
Copy link

When creating a literal, we can provide any language tag and RDF4J accepts it. It doesn't conform with the standards [https://www.w3.org/TR/rdf11-concepts/#bib-BCP47].

Forexample, RDF4J doesn't report for literal (France@en,en). I can create this literal, although it is not a valid language tag. But when I tried to read the file with this defined literal as Turtle, it complains as it is not a valid turtle file. But rdf-xml serialization works fine with this literal. Also we can define language tags in camel case (France@wrongLanguage).

It is intentional or it is a bug at your side?

Thanks,
Mahek Hanfi
Semantic Web Company

@barthanssens barthanssens added specification issues related to compliance to standards and external specs 🐞 bug issue is a bug and removed 🐞 bug issue is a bug labels Feb 12, 2019
@barthanssens
Copy link
Contributor

Hi,

The (default) SimpleValueFactory does not do much input validation (for performance reasons), have you tried using the org.eclipse.rdf4j.model.impl.ValidatingValueFactory instead ?

The ValidatingValueFactory should check the conformity of the language tag... if that's not the case, then it is a bug...

@MahekHanfi
Copy link
Author

Hi,

I tried with ValidatingValueFactory and it checks the conformity of language tags.

Thanks for pointing out in the right direction.

Best,
Mahek

@barthanssens
Copy link
Contributor

Ok, seems to work like expected, so I'll close the ticket
(although maybe it should be mentioned in the RDF4J documentation, because it is a good question)

@barthanssens
Copy link
Contributor

Might be added to doc/programming/02-model-api.adoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
specification issues related to compliance to standards and external specs website / documentation Website update / Documentation issue
Projects
None yet
Development

No branches or pull requests

2 participants