This is an experiment to implement an ActivityPub server that stores data (activities and actor profiles) as linked data.
The ActivityPub is a protocol is a decentralized social networking protocol based on ActivityStreams. ActivityStreams specifies the representation of activities and actors in social networks. Activities and actors are represented as Linked data, serialized as JSON-LD.
Existing ActivityPub servers (known to the author) store data in relational databases, making use of well-known database technology. However much of the flexibility of linked data is lost and servers are usually restricted to specific types of data (e.g. Pleroma and Mastodon to notes, PeerTube to videos, etc.). A data-type-independent ActivityPub Server, that can handle any kind of data, needs to use linked data as the underlying data model.
A database that can store linked data is called a triplestore. This experiment uses Datalog to store and query data. Datalog is a logic programming language/deductive database system that can be used as a hacked-together triplestore.
Data is stored in a triplestore. Endpoints get (or put) data into triplestore with suitable queries. Data validation is also done with queries on linked data.
Data that is stored in an ActivityPub server (e.g. a published note) may be accessible to a user if it is placed in the users inbox or when addressed to the public. This requires certain access control to ensure that users can only see data they are allowed to.
Access control can not be directly modeled in linked data/RDF.
Annotated RDF is an extension to RDF that adds annotations, that can be used to implement access control. This experiment aims to implement such a system for access control.
In order to test the ideas it would be nice to have a large data set of real (publicly available) ActivityPub data. This can be obtained by scraping public ActivityPub servers.
Currently this experiment is conducted using the Racket programming language, maybe it would be easier to do it in Prolog, which has a nice Semantic Web Library. However, the Prolog Semantic Web Library does not yet have JSON-LD support.
See ~main.rkt~.
- The Spritely project and it’s demonstrators (such as golem)
- An excellent introduction to Datalog
- CommonsPub: a project to build an ActivityPub server which supports any type of activity, object and property.
This experiment is conducted as part of the openEngiadina project.
For questions, feedback and comments, contact pukkamustard (pukkamustard [at] posteo [dot] net).