proycon / codemetapy

A Python package for generating and working with codemeta
https://codemeta.github.io/
GNU General Public License v3.0
24 stars 5 forks source link

Dealing with ordered lists #22

Closed proycon closed 1 year ago

proycon commented 1 year ago

People express authors as lists in JSON-LD but if this is done without the @list semantics (or without schema:position), the order remains undefined in RDF (unlike in JSON itself). We currently support schema:position in codemetapy but we may want actual support for@list so people can express for instance authorship like:

"author": [ "First Author", "Second Author" ]

This is in line with discussions in codemeta/codemeta#272 . The codemeta context indeed has "@container": "@list" for things like properties like author, as discussed in that issue. In our current implementation, however, we explicitly load (and even forcibly inject) the whole schema.org context as well, after the codemeta one, and the regular schema.org context does not use "@container": "@list".

proycon commented 1 year ago

I implemented this, we force "@container": "@list" in the context internally for schema:author and schema:contributor, so these will always be interpreter as ordered lists. We do not explicitly output this deviant context in the serialisation, however (but the json-ld output will be serialised in the proper order).