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

RDF Parser: Type Mapping for type xs:integer is missing #4460

Closed
bytefish opened this issue Dec 21, 2019 · 4 comments · Fixed by #4465
Closed

RDF Parser: Type Mapping for type xs:integer is missing #4460

bytefish opened this issue Dec 21, 2019 · 4 comments · Fixed by #4465
Labels
area/documentation Documentation related issues. area/mutations Related to mutations JSON or RDF. area/types Issues related to the type system. kind/bug Something is broken. priority/P2 Somehow important but would not block a release. status/accepted We accept to investigate/work on it.

Comments

@bytefish
Copy link

What version of Dgraph are you using?

Dgraph 1.1.1

Have you tried reproducing the issue with the latest release?

Yes.

What is the hardware spec (RAM, OS)?

Windows 10, 16 GB RAM

Steps to reproduce the issue (command/config used to run Dgraph).

I am importing a RDF dataset, that contains integer values. The library I am using (dotNetRDF) is using the RDF Type http://www.w3.org/2001/XMLSchema#integer to represent integers and I can see, the RDF Parser has a type mapping for the URI:

https://github.com/dgraph-io/dgraph/blob/de8ef8baf6a7d4b0761e7d2f4c05854fc0de946c/chunker/rdf_parser.go#L364

But there is no equivalent mapping for the prefixed version xs:integer. I can only see xs:int in the Type Mapping:

https://github.com/dgraph-io/dgraph/blob/de8ef8baf6a7d4b0761e7d2f4c05854fc0de946c/chunker/rdf_parser.go#L352

If I am using a prefix and use it as xs:integer, an error will be thrown here:

https://github.com/dgraph-io/dgraph/blob/de8ef8baf6a7d4b0761e7d2f4c05854fc0de946c/chunker/rdf_parser.go#L155

Expected behaviour and actual result.

The typeMap in the RDF Parser contains an entry for xs:integer and the import is successful.

@danielmai
Copy link
Contributor

Dgraph supports the RDF N-Quad format as input and a subset of RDF types. You can see the list of supported RDF types and their corresponding Dgraph schema types here: https://docs.dgraph.io/mutations/#rdf-types. In this case, I recommend modifying the dataset to use xs:int to import it into Dgraph.

@bytefish
Copy link
Author

@danielmai Thanks for the fast reply! Yes, I am using the complete URI for the type, so it's not a problem. But why support the full URI http://www.w3.org/2001/XMLSchema#integer in the typeMapping and not a prefixed one as xs:integer? I was just surprised it is missing, that's why I filed the bug.

If you don't think it is a bug, then please feel free to close.

@bytefish
Copy link
Author

http://www.w3.org/2001/XMLSchema#integer is supported by the RDF parser, but it is missing in the documentation as far as I can see. Maybe it's sufficient to update the documentation. But still dotNetRDF for example formats an integer the way above and prefixes it as xs:integer.

@danielmai
Copy link
Contributor

Sounds like xs:integer valid addition to both the type map and the docs.

@danielmai danielmai added area/documentation Documentation related issues. area/mutations Related to mutations JSON or RDF. area/types Issues related to the type system. kind/bug Something is broken. priority/P2 Somehow important but would not block a release. status/accepted We accept to investigate/work on it. labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Documentation related issues. area/mutations Related to mutations JSON or RDF. area/types Issues related to the type system. kind/bug Something is broken. priority/P2 Somehow important but would not block a release. status/accepted We accept to investigate/work on it.
Development

Successfully merging a pull request may close this issue.

2 participants