RDFLib / rdflib-jsonld

JSON-LD parser and serializer plugins for RDFLib
Other
282 stars 71 forks source link

Aliased property serialized with namespace #86

Closed sharpaper closed 4 years ago

sharpaper commented 4 years ago

In ActivityStream the property orderedItems is defined as

"orderedItems": {
    "@id": "as:items",
    "@type": "@id",
    "@container": "@list"
},

when I match a node with rdflib, and then serialize it with rdflib-jsonld using node.serialize(context="https://www.w3.org/ns/activitystreams", format='json-ld'), the property orderedItems is serialized with the namespace like this "as:orderedItems": "". All the other properties seem to be serialized (correctly) without the namespace, for example "totalItems": "". Why is just this property serialized with the namespace? What is special about it? Is it a bug maybe?

sharpaper commented 4 years ago

It's not a bug. I was storing the triple as as:orderedItems instead of as:items. It seems to work if I) I never use as:orderedItems but only as:items and II) the items are blank nodes with the classical rdf:first and rdf:rest properties. Linked lists on RDF suck.