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

Don't always put datatype in SPARQL #10

Open
benjay10 opened this issue Jan 27, 2023 · 0 comments
Open

Don't always put datatype in SPARQL #10

benjay10 opened this issue Jan 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@benjay10
Copy link

benjay10 commented Jan 27, 2023

Setting a datatype is not always necessary. This can even cause annoying results when blindly inserted in Virtuoso because a typed string is not the same as an untyped string. Also, incorrectly typed term (e.g. langString with a missing language) produce incorrect data.

This function is partially to blame, because it repeats explicit datatypes if they already exists in the incoming delta files.

The rest of the blame falls on this expression where the termobjects are just concatenated into a string without attention to its datatype.

Suggestion: USE RDFJS LIBRARIES! They provide a standard for representing RDF data in JavaScript applications and there are many libraries for conversion between data formats. These libraries are well-tested, simple to use and provide consistency. Don't reinvent the wheel by making our own functions that only cover a fraction of the cases. E.g. construct namedNodes and literals into quads to represent triples and then use termToString to convert a triple to a string. The function above can be replaced entirely by this. This could make this service much simpler.

@benjay10 benjay10 added the bug Something isn't working label Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant