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

RDFLiteral validation in LDPatch parser #1

Open
natashabakh opened this issue Mar 8, 2016 · 2 comments
Open

RDFLiteral validation in LDPatch parser #1

natashabakh opened this issue Mar 8, 2016 · 2 comments

Comments

@natashabakh
Copy link

PEGPatchParser doesn’t spot invalid value for a given datatype. For instance Add { <#> schema:test "x"^^xsd:boolean . }. is parsed with no issues and creates invalid RDF. Turtle parser would chock on it

@betehess
Copy link
Member

I think I understand what's going on. If you look at https://github.com/banana-rdf/banana-ldpatch/blob/master/ldpatch/src/main/scala/org/w3/ldpatch/Grammar.scala#L295, you'll see that the creation of the literal is deferred to the underlying RDF library.

So for example, if you use banana-sesame, you'll see that LiteralImpl is used.

So I tried this:

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>

So that class doesn't make any semantic validation. I believe this should be fixed in banana-sesame.

@betehess
Copy link
Member

I just opened an issue in banana-rdf banana-rdf/banana-rdf#309.

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

2 participants