Dgraph: RDF Parser: Type Mapping for type xs:integer is missing

Created on 21 Dec 2019  路  4Comments  路  Source: dgraph-io/dgraph

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.

aredocumentation aremutations aretypes kinbug prioritP2 statuaccepted

All 4 comments

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.

@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.

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

captain-me0w picture captain-me0w  路  4Comments

protheusfr picture protheusfr  路  4Comments

pjebs picture pjebs  路  4Comments

xhochipe picture xhochipe  路  3Comments

jimanvlad picture jimanvlad  路  5Comments