LinkML Schema representation of ActivityPub
Go to file
sneakers-the-rat 66dc12e73e
Add activitystreams file
2024-01-14 22:01:15 -08:00
data Before manually adapting to AS 2024-01-12 23:27:16 -08:00
generated v0.2.0 - Rename to activitystreams and activitypub rather than both being activitypub 2024-01-14 22:00:00 -08:00
linkml_activitypub Add activitystreams file 2024-01-14 22:01:15 -08:00
.gitignore v0.2.0 - Rename to activitystreams and activitypub rather than both being activitypub 2024-01-14 22:00:00 -08:00
CHANGELOG.md v0.2.0 - Rename to activitystreams and activitypub rather than both being activitypub 2024-01-14 22:00:00 -08:00
LICENSE Initial commit 2024-01-12 20:11:37 -08:00
Makefile v0.2.0 - Rename to activitystreams and activitypub rather than both being activitypub 2024-01-14 22:00:00 -08:00
README.md v0.2.0 - Rename to activitystreams and activitypub rather than both being activitypub 2024-01-14 22:00:00 -08:00
about.yaml v0.2.0 - Rename to activitystreams and activitypub rather than both being activitypub 2024-01-14 22:00:00 -08:00
config.yaml Before manually adapting to AS 2024-01-12 23:27:16 -08:00
mkdocs.yml Before manually adapting to AS 2024-01-12 23:27:16 -08:00
poetry.lock v0.0.1 - initial working generation 2024-01-13 03:23:50 -08:00
pyproject.toml v0.2.0 - Rename to activitystreams and activitypub rather than both being activitypub 2024-01-14 22:00:00 -08:00

README.md

linkml-activitypub

LinkML representation of ActivityStreams and ActivityPub schema

https://pypi.org/projects/linkml-activitypub

Source schema:

  • linkml_activitypub/activitystreams.yaml - ActivityStreams2 vocabulary schema
  • linkml_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.py
    • linkml_activitypub/activitypub.py
  • Dataclasses
    • linkml_activitypub/dataclass/activitystreams.py
    • linkml_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 robot
  • activitystreams2.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_with
      • see_also when references given
    • Properties
      • description
      • domain
      • range
      • minumum_value
      • maximum_value
  • Added missing slots
    • closed
    • startIndex
  • Handle special property cases
    • items is marked as list_elements_ordered: true on OrderedCollection and false on Collection
  • Made types
    • anyURI as xsd:anyURI, did not try and find a validator pattern. The spec alternatingly uses its own anyURI prop and xsd:anyURI
    • duration as a string that indicates it's a xsd:duration, finding a pattern is TODO
  • Made enums
    • unitEnum - for unit
  • Copied Notes to class description rather than comments
  • Added schema prefixes:

Errata

  • OrderedCollectionPage is not a subclass of, and doesn't mix in CollectionPage since it would then have an ambiguous class definition, since OrderedCollection inherits from Collection but asserts that the list_items_ordered slot is true rather than false. Instead, the slots from CollectionPage are just duplicated.
    • Accordingly, the domain and range of slots that include CollectionPage also include `OrderedCollectionPage
  • Need to implement some xsd:duration pattern

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 items and orderedItems just be disjoint slots, rather than a slot with a special property modification?

ActivityPub

Process

Errata

TODO

  • Everything!

References

See Also