RDFLib / prez-ui

BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

prefixes with '.' break loading triples #173

Closed lalewis1 closed 1 month ago

lalewis1 commented 1 month ago

If Prez returns turtle with any Prefix declarations like

PREFIX my.pre: <http://my.prefix.com/>

Then an error is shown

likely this is an n3 issue?

recalcitrantsupplant commented 1 month ago

I think it is n3, the spec is pretty permissive. There's a few open parse issues: https://github.com/rdfjs/N3.js/issues?q=is%3Aissue+is%3Aopen+parse+

Perhaps we're better to send ntriples from the API or attempt to generate nicer prefixes - I suspect the problematic ones are mostly auto generated. Thoughts?

lalewis1 commented 1 month ago

Whatever is easier. However, would we be concerned about the extra package size from ntriples? Assuming that it would be larger as the syntax is more verbose.

recalcitrantsupplant commented 1 month ago

I think it's automatically compressed/decompressed and the payload sizes are pretty trivial

recalcitrantsupplant commented 1 month ago

I've added code to prevent inclusion of "special" characters in generated curies in Prez, it may prevent the issue. Would still recommend specifying nice prefixes.

https://github.com/RDFLib/prez/pull/284#issue-2593659515

nicholascar commented 1 month ago

Please send Turtle, not n-triples, from the API. It is nice to be able, very occasionally, to look at the data as a human and n-triples basically makes this impossible

recalcitrantsupplant commented 1 month ago

no worries - I'm making changes to "clean up" i.e. valid not not nice, and also ensure the auto generated prefixes are valid (Lawson pointed out they shouldn't start with [0-9]).

Normal disclaimers:

lalewis1 commented 1 month ago

validation implemented in https://github.com/RDFLib/prez/pull/284. Tested locally and it fixes this issue. closing as resolved.