Open so-dewy opened 1 year ago
The JSON-LD provider for 4.4.0 is Github project jsonld-java which supports JSON-LD 1.0.
In 4.9.0, the default JSON is [titanium-json-ld}(https://github.com/filip26/titanium-json-ld) which provides JSON-LD 1.1. RDFFormat.JSONLD_COMPACT_PRETTY
is deprecated because it is backed by jsonld-java.
In Jena5, the JSON-LD 1.0 support is bring removed.
Does Titanium have the features you are looking for?
A contribution for passing the @context
to the write (using the RIOT Java Context) would be appreciated.
The writer is JsonLD11Writer
.
The writer setup for JSON-LD 1.0 was a contribution.
A bunch of logic in in my application depends on the properties of JSON-LD being compacted so I would appreciate any help with this :D
The primary goal of writing RDF in JSON-LD has been to get legal and correct JSON-LD written. Appearance has been secondary because creating idiomatic JSON often is usage dependent - i.e JSON-LD framing. It might be better getting basic JSON-LD out then running it through a toolchain that does framing to give more control in an easier to use fashion.
Version
4.4.0
What happened?
Hi, right now I'm using Jena version
4.4.0
and experiencing a bug in serializingDataset
withRDFFormat.JSONLD
where@context
is populated only with properties from default graph. The test.trig file from whichDataset
is initialized contains this:To serialize the
Dataset
I use the following code:This results in the following JSONLD where
compacted.property
from default graph is in the@context
anduncompacted.property
is not :I took a look around the code and it seems like the problem is in the method
JsonLDWriter.getJsonldContext
, particularly this line:The context is being created only for default graph. This method seems to also check for user provided context a little bit higher up but I for the life of me couldn't figure out how to provide it :(
I upgraded to the latest version (4.9.0) but it seems like the
@context
is not being initialized at all, so all the properties are in full form:I took a look around and it seems that in version
4.4.0
theRDFFormat.JSONLD
is set toRDFFormat.JSONLD_COMPACT_PRETTY
variant but in the version4.4.9
it is set toRDFFormat.JSONLD_PRETTY
and theRDFFormat.JSONLD_COMPACT_PRETTY
is marked as deprecated in favor of JSONLD11. But JSONLD11 seems to not offer compact pretty variant, if I'm blind please point me to the right direction.Btw, in version
4.9.0
if serializing with deprecatedRDFFormat.JSONLD_COMPACT_PRETTY
the bug still reproduces the same as in4.4.0
, context is formed only for the default graph.A bunch of logic in in my application depends on the properties of JSONLD being compacted so I would appreciate any help with this :D
@context
auto-populated in version4.9.0
?@context
myselfI could probably figure out a way to fix the
JsonLDWriter.getJsonldContext
method and do a pull request. But I don't know if compacted JSONLD is deprecated and it is pointlessI attached a reproducer project archive: jena-reproducer.tar.gz
Are you interested in making a pull request?
Yes