Mayil-AI-Sandbox / kuzudb_jan15

MIT License
0 stars 0 forks source link

Error on malformed IRIs in Turtle files (hashtag2771) #33

Open vikramsubramanian opened 4 months ago

vikramsubramanian commented 4 months ago

According to Turtle specification, you cannot do the following (you can use the W3 [Validata]( tool to see this error):

 ex: < .

<ex:green-goblin>
    foo:enemyOf ex:spiderman    

That's because the prefix "foo" is not defined. We however interpret this as if foo:enemyOf is written as , which indicates that the string inside the angle brackets is a fullIRI and should be interpreted as such. That is, we interpret it as if the file was as follows:

 ex: < .

<ex:green-goblin>
    <foo:enemyOf> ex:spiderman  

Then if you query the rdfgraph for the triples you get the following:

----------------------------------------------------------------
| s.iri           | p.iri       | o.iri                        |
----------------------------------------------------------------
| ex:green-goblin | foo:enemyOf |  |
----------------------------------------------------------------

I think we should comply with the standard and error on this line (and skip the triple if that's what we do).

)

mayil-ai[bot] commented 4 months ago

Summary: Malformed IRI in Turtle files is not being handled as per the Turtle specification.

Possible Solution

Based on the provided information, the issue is related to the handling of malformed IRIs and undefined prefixes in Turtle files. The relevant code snippets are from the third_party/serd/src/n3.c file, which contains the Turtle file parser logic. To address the issue:

The solution should involve:

Code snippets to check