-
Notifications
You must be signed in to change notification settings - Fork 60
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
orderedAttachment (and orderedTag?) #537
Comments
As with email, technically the attachments for an AS2 object are not ordered, but most clients seem to treat them as ordered. It might be a best practice to treat these objects as ordered, even if not well defined in the spec. However, it may make sense to have a more precise definition of when attachments are specifically ordered and when they can be treated more loosely. The current option, that works without a change to the AS2 context or an extension, is to use the "@list" technique mentioned JSON-LD: {
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Note",
"content": "This is the content",
"attachments": {
"@list": [
{
"type": "Image",
"name": "Image 1"
},
{
"type": "Image",
"name": "Image 2"
}
]
}
} The downside of this technique is that it's not (to be confirmed) widely used, so may confuse consumers of the document. Adding an extension property that has Creating this extension is probably a good FEP project. |
The current option you propose would add more complexity for "plain JSON" implementations that don't understand LD. These implementations have no way to signal to each other that attachments, tags, etc. are ordered. If orderedItems can exist, and it does exist for this very reason, then I think it is worth considering which other properties might be explicitly defined as ordered. It feels very inelegant to say "just pretend they're ordered" without making them actually ordered. You may as well do a breaking change and redefine them in the context document to be The one thing I do have to ask about, though: with FEPs, there is not a clear authority to propose terms within the activitystreams namespace. It would probably be a good idea to clearly establish the conditions and process for amending the context document to add or change terms. Otherwise, we might proceed with putting such |
it has come to my attention (mastodon/mastodon#25588 (comment)) that some implementations such as mastodon already author as2 documents where |
Are there any use cases where unordered set might be desirable? |
Unordered sets are often semantically more accurate, but that's about it, I think. It matters for RDF and RDF canonicalization but not much else off the top of my head. |
Hi @trwnh, this isn't mainly about RDF or canonicalization. It's about merging data from different sources, representing the web's data model. This is an overhead to the web of data model, but it provides utility by contributing a relatively federated, interoperable, and decentralized aspect to the architecture - tho that is perhaps underused currently. Should the fediverse interact with other web systems, merging various data becomes a cheaper operation with Linked Data. The end goal is a vast social graph spanning the web where a user's footprint is distributed across multiple domains without singular control. |
@melvincarvalho i meant using an ordered basically: what are the consequences of saying that "order matters" when it actually doesn't? in several cases, it does matter; in other cases, it doesn't. |
Generally, this question extends to the following properties in popular practice:
Per SocialHub discussion, our options are, from least messy migration to most messy migration:
For example, given the following: {
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"orderedAttachment": {
"@id": "as:attachment",
"@type": "@id",
"@container": "@list"
}
}
],
"orderedAttachment": ["one", "two"],
"attachment": ["one", "two"]
} It expands into the following: [
{
"https://www.w3.org/ns/activitystreams#attachment": [
{
"@id": "one"
},
{
"@id": "two"
},
{
"@list": [
{
"@id": "one"
},
{
"@id": "two"
}
]
}
]
}
] Compacting against only AS2 without the {
"@context": "https://www.w3.org/ns/activitystreams",
"attachment": [
"one",
"two",
{
"@list": [
"one",
"two"
]
}
]
}
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Question",
"name": "What is the answer?",
"oneOf": {
"type": "Collection",
"orderedItems": [
{
"type": "Note",
"name": "Option A"
},
{
"type": "Note",
"name": "Option B"
}
]
}
}
Proposed solution: A single-item
Caveat as mentioned by Evan above: this is probably not expected, and it's a bit weird, but otherwise "technically valid".
|
interestingly, another example comes to mind of when sometimes you do want unordered -- unordered poll options may be presented in random order, i.e. if the producer wishes them to be randomized (to reduce first-option bias) |
This issue has been labelled as potentially needing a FEP, and contributors are welcome to submit a FEP on the topic. |
https://w3id.org/fep/a070 exists, but needs to be updated to take into account recent comments as alternative resolutions |
Based on review, this would make a good FEP. I'm closing, but this will stay in the list of needs-fep issues. I'd say the best way to adopt this structure into AS2 is:
|
Please Indicate One:
Please Describe the Issue:
pitch
problem: sometimes you want to have attachments in a certain order, but
attachment
is an unordered set by defaultsolution: define
orderedAttachment
similar toorderedItems
i am unsure if
orderedTag
makes sense astag
is not used purely for "tags" in the categorization sense, but doubtless if tumblr or some tumblr-like implementation wanted to order their tags, they would have no way of doing so.The text was updated successfully, but these errors were encountered: