True or false: the JSON-LD spec doesn't differentiate between a key with a scalar value and a key whose value is a 1-item array?

@cwebber @kaniini

Follow

@cwebber @kaniini

e.g. { "items": "item1" } and { "items": [ "item1" ] } compact to the same representation ( { "items": "item1" } )

@jdormit @kaniini true on expansion, false on compaction

If you set {"@context": {"items": {"@container" : "@set", "@id": "..."}}} your context will *compact* to an array of one element, whereas otherwise it will be a single value, iirc. But on expansion, yes, in both cases it will expand to an array.

@jdormit @cwebber Note that I think the test suite at activitypub.rocks can't handle the array version of items when it expects 1 element. (go-fed has some inconclusive tests I think because of this, the "items" and "orderedItems" are always serialized to array form, even for 1 element.)

@cj
It definitely seems likely to trip up implementers.
@cwebber

@jdormit @cwebber Yep. I'm not sure how many implementations can handle multiple "object" and "target" values either, since they are non-functional

@jdormit Functional property == "can have at most 1 value". Nonfunctional property == "can have any number of values".

It comes from ActivityStreams building off the OWL2 spec.

So either section 4 in:
w3.org/TR/activitystreams-voca

Or section 5.13 in:
w3.org/TR/owl2-rdf-based-seman

@cj
Gah, there are so many layers to this. I guess the answer is, "pass everything through a JSON-LD library and hope it does the right thing"

@jdormit Yeah, I've only been into RDF as long as I've been into ActivityPub (~1 year) so I am still learning everything.

I still haven't fully read the OWL2 spec, I'd have to sit down with a notebook. It's one of those things I've only picked at pieces of.

@cj I have been into ActivityPub for ~3 months and I've never heard of OWL2 haha. I have read the ActivityStreams spec but I kind of skimmed the definition tables... 🙃

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!

We adhere to an adapted version of the TootCat Code of Conduct and follow the Toot Café list of blocked instances. Ash is the admin and is supported by Fuzzface as a moderator.

Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!