You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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
namedNode
s andliteral
s intoquad
s to represent triples and then usetermToString
to convert a triple to a string. The function above can be replaced entirely by this. This could make this service much simpler.The text was updated successfully, but these errors were encountered: