RDFLib / rdflib-jsonld

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

Properties with @type:@id do not have namespace prefix while others have it when serializing #61

Closed EmidioStani closed 3 years ago

EmidioStani commented 5 years ago

I have the following code:

context_jsonld = "https://raw.githubusercontent.com/catalogue-of-services-isa/CPSV-AP/master/releases/2.2.1/CPSV-AP_v2.2.1.jsonld" jsonldfile = 'output.jsonld' g.serialize(destination=jsonldfile, format='json-ld', context=context_jsonld, indent=4, encoding='utf-8')

I just noticed that the output file has for example: .... "dct:identifier": "ca/294WVJ", "dct:title": { "@language": "it", "@value": "Provincia Autonoma di Trento - Servizio turismo e sport" }, "skos:prefLabel": { "@language": "it", "@value": "Provincia Autonoma di Trento - Servizio turismo e sport" }, "spatial": "http://publications.europa.eu/resource/authority/place/ITA_TRT"

you can see that spatial (indicated as @type:@id in the context, basically an object relation) does not have the namespace while the other properties have. The output is still correct but I would have expected to see:

"dct:spatial": "http://publications.europa.eu/resource/authority/place/ITA_TRT"

piyush69 commented 4 years ago

Hi, I tried reproducing the issue and it looks like it's happening only in the case when the object is an IRI (and works fine for literals).

nicholascar commented 3 years ago

@EmidioStani could you please supply some data? I'm trying to test PR #88 to see if it really fixes this issue but I need the data you where working with, not just the context.

EmidioStani commented 3 years ago

Hello @nicholascar , I don't work anymore on that project, you can still access the output data at:

https://github.com/catalogue-of-services-isa/Trento_conversionToRDF/blob/master/rdf_output/servizi_famiglia.jsonld

nicholascar commented 3 years ago

Thanks @EmidioStani and this issue has been resolved with PR #88 and I've added a test for it too.

EmidioStani commented 3 years ago

My pleasure, glad to see the project is kicking-out