76 lines
5.5 KiB

# GeoPub
GeoPub is an XMPP client for geospatial data and RDF developed within the [openEngiadina]( project.
## Open Local Knowledge
GeoPub has been developed to create and manage Open Local Knowledge.
Local knowledge consists of thousand of little pieces of information that describe the social, cultural and natural environment of an area. Examples include geographic information, social, cultural and economic activity or infrastructure status.
The variety of this data is considerable and we need to support them all. To do this GeoPub uses the Resource Description Framework (RDF).
GeoPub is not bound to a fixed set of data types, instead GeoPub works with RDF and any data that can be describes as RDF is supported by GeoPub.
GeoPub contains examples of how to use the [ValueFlows]( vocabulary for simple offers as well, the [OpenHospitalityNetwork]( vocabulary for hospitality requests and offers as well as the [MusicOntology]( for sharing music. Other data types that have been successfully tested include OpenStreetMap data via the [osm2rdf]( project.
## Semantic Social Network
We acknowledge the fact that data creation and curation is a social activity. Pieces of information are created, commented on, shared and revised collectively.
To model this we use the [ActivityStreams]( vocabulary. This is the same vocabulary used by the [ActivityPub]( protocol. Previously the openEngiadina project was using the ActivityPub protocol (see [openEngiadina: From ActivityPub to XMPP](
ActivityStreams provides types that describe social interactions on small pieces of data - activities. For example there is an activity that describes the creation of a resource.
GeoPub uses the ActivityStreams vocabulary as a core vocabulary. Whenever a user does something in GeoPub this corresponds to an ActivityStreams activity.
## Technical Overview
GeoPub is a JavaScript web application. It is written in the [OCaml]( programming language and compiled to JavaScript.
GeoPub works with standard XMPP servers (tested with [Prosody]( and [ejabberd]( GeoPub does not require any specialized server software apart from the web server where the JavaScript application code as well as other resources are hosted. GeoPub can be hosted from a static site.
GeoPub receives and publishes content via XMPP over WebSocket (see [RFC 7395]( The RDF/XML serialization is used and content is by default posted to the `net.openengiadina.xmpp.activitystreams` Personal Eventing Protocol node (see [XEP-0163]( How RDF data is transported over XMPP is described in more detail in the post [ActivityStreams over XMPP](
Data is persistently stored in a local [IndexedDB]( database. GeoPub maintains specialized indices that allows efficient querying for geospatial location, full-text search and usual RDF queries (see also the post [GeoPub: A Multi-Model Database](
In order to query data GeoPub uses Datalog, a database query language based on logic programming. See also the post [GeoPub: Datalog, RDF and IndexedDB](
Everything created via GeoPub is content-addressed via [ERIS]( This de-couples content from the network protocol used (i.e. XMPP) and allows content to be made available robustly.
## History
GeoPub was started as a very simple JavaScript demonstrator to show how geographic information can be used over the ActivityPub protocol (see branch `initial-js-demonstrator`).
A second version was developed in ClojureScript (see branch `cljs`). The ClojureScript version was abandoned due to licensing and reproducability issues (it is hard to use GPL/AGPL for Clojure(Script) projects and Clojure support in Guix/Nix is not so good).
This (the third version) is implemented in OCaml using `js_of_ocaml`.
## Hacking
A development environment can be created with [Guix](
``` sh
guix shell -D -f guix.scm
After this you can run `dune build @install` which will build GeoPub and place all necessary artifacts into `_build/install/default/share/geopub/`.
You may want to start a small webserver for local development (e.g. `python3 -m http.server --directory _build/install/default/share/geopub/`). This works very nicely when running dune in watch mode (`dune build @install --watch`).
Note that this uses dependencies from Guix. You might have to run `guix pull` to get the lastest dependencies from Guix. To use a version of Guix that has been tested use: `guix time-machine -C channels.scm -- shell -D -f guix.scm`.
See also some [notes on the architecture](./doc/
## Contact
See the [openEngiadina project site](
## Acknowledgments
GeoPub is being developed for the [openEngiadina]( project and has been supported by the [NLnet Foundation]( through the [NGI0 Discovery Fund](
## License