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

prefixes with '.' break loading triples #173

Closed
lalewis1 opened this issue Oct 17, 2024 · 7 comments
Closed

prefixes with '.' break loading triples #173

lalewis1 opened this issue Oct 17, 2024 · 7 comments
Assignees

Comments

@lalewis1
Copy link
Collaborator

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
Copy link
Collaborator

recalcitrantsupplant commented Oct 17, 2024

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
Copy link
Collaborator Author

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
Copy link
Collaborator

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

@recalcitrantsupplant
Copy link
Collaborator

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.

RDFLib/prez#284 (comment)

@nicholascar
Copy link
Member

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
Copy link
Collaborator

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:

  • the n3 parser should ultimately be fixed
  • users should specify the prefixes they want; prefix generation isn't deterministic. Clashes in auto generated prefixes are likely where the dataset has similar namespaces. If further data is added to the triplestore, the order in which namespaces are read in for prefix generation may change, meaning the prefix previously generated for a namespace may change.

@lalewis1
Copy link
Collaborator Author

validation implemented in RDFLib/prez#284. Tested locally and it fixes this issue. closing as resolved.

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

4 participants