qlands / elasticfeeds

A Python library for managing feeds using ElasticSearch
Other
19 stars 4 forks source link

api helpers for introspecting graph - for exploration. #8

Open wweevv-johndpope opened 1 year ago

wweevv-johndpope commented 1 year ago

https://github.com/HorizonAS/activitystreams/blob/314a359cd7a34cc95775500cd2c93ced7323ad4a/README.md?plain=1#L148

I'm not sure if this beyond scope of this - but possibly still ok - I'm wiring up a lambda call - and it currently has a parameter -

https://website.com?q=testuser

but I'm wondering if we could write some smarts to help here

### Activity Service REST API

The API is abstract, and allows for any node in the graph to take the assumed role of actor, object, target, context etc. - This means that the direction in which an activity occured matters. For instance, supposing a youtube video could favorite something, the activity would then be (actor:youtube_video)-FAVORITED->(object:special_something). Asking the API about activities that the youtube video has done means placing the youtube video in the context of an actor. Whereas asking about activities that have been done on the youtube video means placing the youtube video in the context of an object.

#### Actor Context

Get all nodes of type

    'get /api/v1/actor/:actor' --> /api/v1/actor/youtube_user

Get node of specfic id

    'get /api/v1/actor/:actor/:actor_id' --> /api/v1/actor/youtube_user/1

Get all activites of specifc actor

    'get /api/v1/actor/:actor/:actor_id/activities' -> /api/v1/actor/youtube_user/1/activities

Get all specific verbed activites of user 

    'get /api/v1/actor/:actor/:actor_id/:verb' -> /api/v1/actor/youtube_user/1/FAVORITED

Getall activies verb by type of object by user

    'get /api/v1/actor/:actor/:actor_id/:verb/:object' -> api/v1/actor/youtube_user/1/FAVORITED/flickr_photo

Get specific activity with user verbed object

    'get /api/v1/actor/:actor/:actor_id/:verb/:object/:object_id' -> api/v1/actor/youtube_user/FAVORITED/flickr_photo/1212

UPDATE

create / delete

Activity Context

Post an Activity

'post /api/v1/activity':
    {
        actor: {
            aid: <string>,
            type: <appname_model>,
            api: <api url>
        },
        verb: <string>,
        object: {
            aid: <string>,
            type: <appname_model>,
            api: <api url>
        }
    }

Delete an Activity

'delete /api/v1/activity/:actor/:actor_id/:verb/:object/:object_id' -> 
api/v1/youtube_user/1/FAVORITED/flickr_photo/14442