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

banana-sesame should do some basic semantic validation when creating literals #309

Open
betehess opened this issue Mar 16, 2016 · 0 comments

Comments

@betehess
Copy link
Member

The problem was exposed in banana-rdf/banana-ldpatch#1.

In SesameOps, LiteralImpl is being used. But that class doesn't do any validation:

scala> import org.openrdf.model.impl._
import org.openrdf.model.impl._

scala> new LiteralImpl("foo", new URIImpl("http://www.w3.org/2001/XMLSchema#boolean"))
res3: org.openrdf.model.impl.LiteralImpl = "foo"^^<http://www.w3.org/2001/XMLSchema#boolean>

There is an easy way to fix that: makeLiteral should look at the datatype being used, and for those that make sense, we should do some simple validation, and even use the most specialized classes for those types.

For example, in the case above, we should be using BooleanLiteral instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant