SwissDataScienceCenter / calamus

A JSON-LD Serialization Libary for Python
Apache License 2.0
28 stars 12 forks source link

Add code to parse flat list #4

Closed Panaetius closed 4 years ago

Panaetius commented 4 years ago

Ideally we'd pass the id of the root object to deserialize and it goes from there, picking the correct schema and deserializing. Alternatively we could maybe unflatten it with pyld and then take it from there.

rokroskar commented 4 years ago

Together with SHACL this should be possible I guess (with open questions like what to do with open shapes) - but what happens if the graph is large? Maybe at that point you would actually want to query it instead of just reading the json-ld serialization?

Panaetius commented 4 years ago

Added this yesterday. If you deserialize a flat list with e.g. a PersonSchema then everything with type http://schema.org/person would be deserialized as a top-level entity (either there has to be a single one or you need to pass the many=True parameter).

Nesting is done with custom code, not pyld, for performance reasons.