Skip to main content

LinkML representation of ActivityStreams Schema

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkml_activitypub-0.2.0.tar.gz (229.2 kB view details)

Uploaded Source

Built Distribution

linkml_activitypub-0.2.0-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

Details for the file linkml_activitypub-0.2.0.tar.gz.

File metadata

  • Download URL: linkml_activitypub-0.2.0.tar.gz
  • Upload date:
  • Size: 229.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.3 Darwin/21.6.0

File hashes

Hashes for linkml_activitypub-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7272fae27d979fb93300e2d35d52a6e71ec86eb21ab033aca6df9c6aa48b3d21
MD5 3c965c9f39a825610696da56c8125a42
BLAKE2b-256 48d1e307ade6637a0d86da7df2f3d5950639aaee1f3fbb09a9e98445b852073c

See more details on using hashes here.

File details

Details for the file linkml_activitypub-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for linkml_activitypub-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55ac9be74318d7e503c229d7234311e9ec390731d2f123c51dbf9ce0b5742805
MD5 13b0ba2930bec4869246e25594cc96ec
BLAKE2b-256 e51308fb894a3595913619b4122c265109a8525266308ddf64197d72ac13bf5c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page