w3c / hcls-fhir-rdf

Sketching out an RDF representation for FHIR
38 stars 15 forks source link

Loss of ordering from ordered lists? #89

Closed dbooth-boston closed 3 years ago

dbooth-boston commented 4 years ago

I don't know if this will be a problem or not, but I'm recording it to make sure we figure it out. If someone already knows the answer then we can close this issue right away.

JSON-LD processors currently turn an ordered JSON list into an unordered set in RDF unless the @context explicitly declares that thing to be an ordered list, using @list. This results in an unrecoverable loss of information. For ordered lists that are defined in the FHIR standards, we can prevent this loss by using @list at each appropriate place in each @context. But what about FHIR extensions, that we won't know about? Could someone use a JSON ordered list within an extension, such that we would not be able to detect it?

hsolbrig commented 4 years ago

I'm assuming that, by "this results in an unrecoverable loss of information.", you mean without the use of @list, correct? The problem, however, is that no one (???) wants to use RDF collections, which would be the outcome of using @list. This is a general problem -- I propose post on the BP website, as there had been discussion in the working group about supporting other RDF list idioms and it was decided at the time that, until the RDF community settles on an alternative, it would be the proverbial "camel's nose" and JSON-LD would have to support many idioms.

hsolbrig commented 4 years ago

See: https://github.com/w3c/json-ld-bp/issues/20

dbooth-boston commented 4 years ago

You are absolutely right. I was momentarily forgetting that @list produces the dreaded first/rest linked list, which I completely agree we do not want.

I am closing this issue, because it will not be a problem, given that we don't want to use @list anyway.