-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
relationship
in JSON-LD context document should use @type: @vocab
#593
Comments
I like the idea in general, but weren't these terms dropped from the AS2 Recommendation a long time ago (and just not cleaned up in the context)? See also: #406 (and related) If so, it seems like |
type:vocab would still be best, to allow compaction of vocab terms used as the value of |
i don't particularly mind either way if the four terms are removed from context document or not, but they indicate the intent for compacting values as vocab terms. |
Maybe... for compacting AS2 normative values. I think that compacting extension relationship predicate IRIs, like in your example, could lead to issues with plain JSON processing. Unlike with AS2 terms, there's no requirement to prevent plain JSON clashes of compacted extension predicates (e.g., |
this just makes me think that this is why we need "best practices for extensibility" as in fep-e229 -- particularly the guidance to consider compacting ONLY against as2 (to generate consistent output for ld-unaware plain json consumers), or otherwise mandating that consumers MUST use the same context as you (which is more fragile) for an ld-aware consumer supplying their own context, use of |
In discussion in issue triage, @trwnh explained that we can only use unprefixed or compacted terms if the However, it is technically a breaking change from the current context document, although the breaking condition (you're using "rel:isInfluencedBy" as a literal string, and don't want it expanded) seems pretty rare and unusual. I suggest that we mark this as "Next Version", document the fact that you can't currently use bare or compacted terms in relationship, and upgrade it in a future version of AS2. |
Continuing from #289
Summary
We have the following term definitions in the context document:
These are used with modeling Relationship entities as described in https://www.w3.org/TR/activitystreams-vocabulary/#connections
Problem
The normative text of AS2-Vocab Section 5.2 reads:
So, if
relationship
identifies the predicate, then shouldn't it have its own URI just like any other RDF predicate?Proposal
Luckily there's a mechanism in JSON-LD to express just this, and it's
@type: @vocab
.From JSON-LD 1.1, Section 5.2.1 "Shortening IRIs": https://www.w3.org/TR/json-ld11/#shortening-iris
Section 4.2.3 "Type Coercion": https://www.w3.org/TR/json-ld11/#type-coercion (emphasis mine)
So basically,
@type: @id
will not work because it is not vocabulary-relative. But@type: @vocab
will work, because it defines the property's value(s) as vocabulary-relative.A similar issue occurs in ActivityPub with
Public
being defined asas:Public
as described in w3c/activitypub#404 -- in that issue, we can see that the term definition ofPublic
actually does nothing, because the propertiesto
/cc
/bto
/bcc
/audience
are all defined as@type: @id
, which is not vocabulary-relative, and thus will not expand any IRIs according to term definitions.Actionable items:
Change the term definition for
relationship
so that its@type
is@vocab
instead of@id
This is probably less contentious than redefining
to
/cc
/bto
/bcc
/audience
, because those are more properly defined in terms of@id
, since their values are expected to be graph nodes. It makes no difference for expansion, since they will both expand to{"@id": "value"}
, but it does make a difference for compaction, which matters more for AS2 because of the requirement to be consistent with the compacted form. It's also less contentious becauserelationship
is probably far less commonly used thanto
/cc
/bto
/bcc
/audience
.But yeah, in summary, if nothing is done, then the following term definitions are currently doing nothing:
I see this as a bug in the JSON-LD context document, not as a normative spec change.
The text was updated successfully, but these errors were encountered: