linkml-activitypub
LinkML representation of ActivityStreams and ActivityPub schema
https://pypi.org/projects/linkml-activitypub
Source schema:
linkml_activitypub/activitystreams.yaml- ActivityStreams2 vocabulary schemalinkml_activitypub/activitypub.yaml- ActivityPub Extensions to ActivityStreams2 (imports ActivityStreams2)
Generated models:
generated/- All generated schema for both source schema- Pydantic 2 Models:
linkml_activitypub/activitystreams.pylinkml_activitypub/activitypub.py
- Dataclasses
linkml_activitypub/dataclass/activitystreams.pylinkml_activitypub/dataclass/activitypub.py
ActivityStreams
Process
Intermediate files are in the data directory
activitystreams2.owl- Initially imported from activitystreams2.owl- Removed problematic OrderedCollection definitions
activitystreams2.ofn- Convert to functional notation with robotactivitystreams2.yaml- Then to rough linkml using schema-automator
Then the final schema in linkml_activitypub/activitystreams.yaml:
- Reorder to match ActivityStreams
- Ensure correct
- inheritance
multivalued
- Prune extra properties and classes to match those in ActivityStreams2 normative definition
- Then re-add the ones that declare a class in their domain, even if the class doesn't list that property in its definition
- Except for those types that seem to be metaclasses:
attributedTo(->actor)
- Added LinkML properties (where needed):
- Classes
disjoint_withsee_alsowhen references given
- Properties
descriptiondomainrangeminumum_valuemaximum_value
- Classes
- Added missing slots
closedstartIndex
- Handle special property cases
itemsis marked aslist_elements_ordered: trueonOrderedCollectionand false onCollection
- Made types
- anyURI as
xsd:anyURI, did not try and find a validator pattern. The spec alternatingly uses its own anyURI prop andxsd:anyURI durationas a string that indicates it's axsd:duration, finding a pattern is TODO
- anyURI as
- Made enums
unitEnum- forunit
- Copied Notes to class
descriptionrather thancomments - Added schema prefixes:
schema: https://schema.org/ - for specifying IETF BCP 47 language codes
Errata
OrderedCollectionPageis not a subclass of, and doesn't mix inCollectionPagesince it would then have an ambiguous class definition, sinceOrderedCollectioninherits fromCollectionbut asserts that thelist_items_orderedslot istruerather thanfalse. Instead, the slots fromCollectionPageare just duplicated.- Accordingly, the domain and range of slots that include
CollectionPagealso include `OrderedCollectionPage
- Accordingly, the domain and range of slots that include
- Need to implement some
xsd:durationpattern
TODO
- JSON-LD Serialization: https://www.w3.org/TR/activitystreams-core/#syntaxconventions
- Collection serialization: "In the JSON serialization, the unordered items of a Collection are represented using the items property while ordered items are represented using the orderedItems property."
- Should
itemsandorderedItemsjust be disjoint slots, rather than a slot with a special property modification?
- Should
ActivityPub
Process
Errata
TODO
- Everything!
References
- Status of AS OWL vocabulary and etc. https://github.com/w3c/activitystreams/issues/416
See Also
Release files for linkml-activitypub 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| linkml_activitypub-0.2.0.tar.gz | 229.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| linkml_activitypub-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 286.8 kB
Release files / linkml_activitypub-0.2.0.tar.gz
| Download URL | linkml_activitypub-0.2.0.tar.gz |
|---|---|
| Size | 229.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7272fae27d979fb93300e2d35d52a6e71ec86eb21ab033aca6df9c6aa48b3d21
|
|
BLAKE2b-256 checksum How to use checksums |
48d1e307ade6637a0d86da7df2f3d5950639aaee1f3fbb09a9e98445b852073c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.3 Darwin/21.6.0
|
Release files / linkml_activitypub-0.2.0-py3-none-any.whl
| Download URL | linkml_activitypub-0.2.0-py3-none-any.whl |
|---|---|
| Size | 57.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55ac9be74318d7e503c229d7234311e9ec390731d2f123c51dbf9ce0b5742805
|
|
BLAKE2b-256 checksum How to use checksums |
e51308fb894a3595913619b4122c265109a8525266308ddf64197d72ac13bf5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.3 Darwin/21.6.0
|