Skip to content
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

[feature] Add interactionPolicy and approvedBy #23

Merged
merged 2 commits into from
Jul 6, 2024

Conversation

tsmethurst
Copy link

This PR adds the interactionPolicy property to statusable representations, and adds the approvedBy property to Creates, Announces, and Likes.

"isDefinedBy": "rdfs:isDefinedBy",
"mainEntity": "schema:mainEntity",
"members": "owl:members",
"name": "schema:name",
Copy link

@trwnh trwnh Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like this is copied from the examples provided by astool but it raises a weirdness flag for me because normally this would be handled by rdfs:label and not schema:name. also it wouldn't really need to be defined as a shorthand term because using the prefixed "rdfs:label" would be simpler. but i'm guessing that this would possibly break the code generation of astool...

{
"@context": [
{
"as": "https://www.w3.org/ns/activitystreams",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing the #, this is an invalid prefix

"type": "owl:Class",
"notes": "InteractionPolicy for an ActivityStreams Object.",
"name": "InteractionPolicy",
"url": "https://gotosocial.org/ns#InteractionPolicy",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk why there's both id and url -- is this an astool idiosyncracy?

"id": "https://gotosocial.org/ns#",
"type": "owl:Ontology",
"name": "GoToSocial",
"members": [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom

i have no idea why this is being used here or what it even means (semantically it's nonsense) but i am once again assuming astool fuckery

"owl:ObjectProperty"
],
"example": {},
"notes": "InteractionPolicy for an ActivityStreams Object.",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this a different definition? i am assuming that the InteractionPolicy above is the type/class, and this one is interactionPolicy the property that points to an InteractionPolicy object, right? if so, then the comments/notes should make this distinction clear.

"notes": "InteractionPolicy for an ActivityStreams Object.",
"domain": {
"type": "owl:Class",
"unionOf": [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why

or more precisely, why not just make this as:Object

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also more general comment on the nodes expressed below, assuming that you want the unionOf:

  • why are there urls and not ids? (astool?)

}
]
},
"isDefinedBy": "https://gotosocial.org/ns#dfn-interactionPolicy",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a circular reference -- surely it should be just defined by gotosocial.org/ns# instead?

]
},
"isDefinedBy": "https://gotosocial.org/ns#dfn-interactionPolicy",
"range": {
Copy link

@trwnh trwnh Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't this just be "https://gotosocial.org/ns#InteractionPolicy" instead of a union of one class? or is this astool again

}
]
},
"name": "interactionPolicy",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think the keys have to be in any specific order, do they? because this (and the next line?) would be useful at the top of the definition instead

{
"id": "https://gotosocial.org/ns#CanLike",
"type": "owl:Class",
"notes": "",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing text description

Copy link

@trwnh trwnh Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also does this even need to be defined as a class? like, what does it do

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, can't this be unified between CanLike/CanAnnounce/CanReply because they're all going to be the same shape?

"@wtf_typeless": true
},
{
"id": "https://gotosocial.org/ns#dfn-canLike",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also it's hitting me just now that there's dfn- before all the terms and that's not really needed? that's just respec markup for when a term is defined

"owl:ObjectProperty"
],
"notes": "Defines who can Like with an object property set to the URI/ID of the Object to which this interactionPolicy is attached.",
"domain": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't this just be "https://gotosocial.org/ns#InteractionPolicy" instead of a union of one class? or is this astool again

}
]
},
"isDefinedBy": "https://gotosocial.org/ns#dfn-canLike",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

circular reference

]
},
"isDefinedBy": "https://gotosocial.org/ns#dfn-canLike",
"range": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you combine CanLike/CanAnnounce/CanReply into one thing then make it the range here

"url": "https://gotosocial.org/ns#dfn-canLike"
},
{
"id": "https://gotosocial.org/ns#CanAnnounce",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't this be unified between CanLike/CanAnnounce/CanReply because they're all going to be the same shape?

"url": "https://gotosocial.org/ns#dfn-canAnnounce"
},
{
"id": "https://gotosocial.org/ns#CanReply",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be unified between CanLike/CanAnnounce/CanReply because they're all going to be the same shape?

"owl:ObjectProperty"
],
"notes": "Defines who can Announce with an object property set to the URI/ID of the Object to which this interactionPolicy is attached.",
"domain": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collapse domain into IRI reference if astool allows

]
},
"isDefinedBy": "https://gotosocial.org/ns#dfn-canAnnounce",
"range": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change range if you combine CanLike/CanAnnounce/CanReply

"url": "https://gotosocial.org/ns#CanReply",
"@wtf_typeless": true
},
{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as before on canLike and canAnnounce

"owl:ObjectProperty"
],
"notes": "Defines who can Create a new Object with an inReplyTo property set to the URI/ID of the Object to which this interactionPolicy is attached.",
"domain": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collapse domain etc

]
},
"isDefinedBy": "https://gotosocial.org/ns#dfn-canReply",
"range": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collapse range and also unify

}
]
},
"isDefinedBy": "https://gotosocial.org/ns#dfn-canReply",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

circular reference

"id": "https://gotosocial.org/ns#always",
"type": "rdf:Property",
"notes": "Indicates zero or more URI/IDs that can perform an interaction without requiring approval by the Object AttributedTo Actor.",
"domain": {
Copy link

@trwnh trwnh Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domain can be collapsed after unifying CanLike/CanAnnounce/CanReply (if astool allows collapsing)

}
]
},
"isDefinedBy": "https://gotosocial.org/ns#always",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

circular reference

"isDefinedBy": "https://gotosocial.org/ns#always",
"range": {
"type": "owl:Class",
"unionOf": "xsd:anyURI"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks wrong, shouldn't it point to actors? idk how to fix this rn though

"isDefinedBy": "https://gotosocial.org/ns#approvalRequired",
"range": {
"type": "owl:Class",
"unionOf": "xsd:anyURI"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks wrong, shouldn't it point to actors? idk how to fix this rn though

}
]
},
"isDefinedBy": "https://gotosocial.org/ns#approvalRequired",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

circular reference

"id": "https://gotosocial.org/ns#approvalRequired",
"type": "rdf:Property",
"notes": "Indicates zero or more URI/IDs that require approval by the Object AttributedTo Actor in order to perform an interaction.",
"domain": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unify then maybe collapse

"rdf:Property",
"owl:FunctionalProperty"
],
"notes": "URI/ID of an Approve Activity, which itself points towards the ID of the Activity or Object to which this property is attached. The presence of this property on an Activity or Object indicates that an interaction has been Approve'd by the Actor whose Object this Activity or Object interacts with.",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"indicates that an interaction has been Approved" but only if the activity is valid by some other criteria, right? otherwise you could just set the property and it would look indistinguishable from any other properly approved activity

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the idea is that the "approvedBy" should be validated by dereferencing the URI it points to and ensuring that it's a valid Accept for the Object or Activity that its URI is attached to :)

"owl:FunctionalProperty"
],
"notes": "URI/ID of an Approve Activity, which itself points towards the ID of the Activity or Object to which this property is attached. The presence of this property on an Activity or Object indicates that an interaction has been Approve'd by the Actor whose Object this Activity or Object interacts with.",
"domain": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could just be as:Object

}
]
},
"isDefinedBy": "https://gotosocial.org/ns#approvedBy",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

circular reference

"isDefinedBy": "https://gotosocial.org/ns#approvedBy",
"range": {
"type": "owl:Class",
"unionOf": "xsd:anyURI"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks wrong, shouldn't it point to actors? idk how to fix this rn though

@trwnh
Copy link

trwnh commented Jun 27, 2024

I left comments wherever stuff looked wrong to me, which is in a lot of places, but I'm not sure how much of this is just astool idiosyncracies.

Separately, I would also invite you to look at / review https://w3id.org/fep/0391 and the discussion at https://socialhub.activitypub.rocks/t/fep-0391-special-collection-proofs/4165 for something that tries to signal the approvedBy stuff in a more generic way. It builds upon the use of replies (as https://w3id.org/fep/7458 describes) and context (as https://w3id.org/fep/7888 describes) -- there's a bit of work left to do, such as more explicitly linking an object to its related activity, and more explicitly linking a stamp's target collection to its related object, but I would appreciate feedback and consideration on this!

@tsmethurst
Copy link
Author

Thanks for the detailed review @trwnh. Given how many issues there apparently are with using an astool-compatible document as an ontology, I think I'll drop the idea of using the former as the latter, keep the former as a code-generation document, and just write the ontology by hand once the PR that necessitates it is merged into GoToSocial.

Thanks for the links also, but to be totally honest these days I generally avoid discussion on socialhome and in fep-related issues because I've found that after a certain point in time it feels as though things become too granular, and I can no longer follow the thread of discussion. I don't mean any insult by this, I just find that my eyes glaze over and I can't focus on what I'm reading anymore, I don't have the stamina for it, and it prevents me from doing work that I wanna do. That said, if something concrete comes out of the discussion you linked, i'm happy to look at implementing it in GtS as an alternate way to signal "approvedBy".

@tsmethurst
Copy link
Author

Since this PR successfully implements generation for the code we need in GtS, I'm gonna squerge this now, but we can always change it later if necessary.

@tsmethurst tsmethurst merged commit f71751e into main Jul 6, 2024
@tsmethurst tsmethurst deleted the interaction_policy branch July 6, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants