base activitypub object types

This commit is contained in:
sneakers-the-rat 2024-01-14 23:25:05 -08:00
parent 66dc12e73e
commit e4b0a15a24
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
9 changed files with 5611 additions and 5456 deletions

View file

@ -108,6 +108,10 @@ gen-pydantic: $(PYMODEL)
$(RUN) gen-pydantic $(AS_SCHEMA_PATH) --pydantic-version 2 > $(PYMODEL)/activitystreams.py
$(RUN) gen-pydantic $(AP_SCHEMA_PATH) --pydantic-version 2 > $(PYMODEL)/activitypub.py
gen-pydantic-ap: $(PYMODEL)
$(RUN) gen-pydantic $(AP_SCHEMA_PATH) --pydantic-version 2 > $(PYMODEL)/activitypub.py
test: test-schema test-python test-examples
test-schema:

View file

@ -82,9 +82,14 @@ Then the final schema in `linkml_activitypub/activitystreams.yaml`:
## Errata
- Currently we can't override and extend parent classes in LinkML ( https://github.com/linkml/linkml/issues/584#issuecomment-1891374150 ),
so we need to copy the objects wholesale and modify them. this might lead to the activitystreams and activitypub schema getting out of sync.
- and https://github.com/linkml/linkml/issues/1825
## TODO
- Everything!
-
# References

Binary file not shown.

View file

@ -1,7 +1,7 @@
{
"comments": {
"description": "Auto generated by LinkML jsonld context generator",
"generation_date": "2024-01-14T21:50:28",
"generation_date": "2024-01-14T22:21:43",
"source": "activitystreams.yaml"
},
"@context": {

View file

@ -4485,7 +4485,7 @@
"source_file": "activitystreams.yaml",
"source_file_date": "2024-01-14T21:45:03",
"source_file_size": 33568,
"generation_date": "2024-01-14T21:50:28",
"generation_date": "2024-01-14T22:21:44",
"@type": "SchemaDefinition",
"@context": [
"generated/jsonld/activitystreams.context.jsonld",

View file

@ -259,6 +259,12 @@ as:Place a owl:Class,
rdfs:label "Place" ;
rdfs:seeAlso <https://www.w3.org/TR/activitystreams-vocabulary/#places> ;
rdfs:subClassOf [ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:longitude ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:latitude ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:units ],
[ a owl:Restriction ;
@ -266,15 +272,34 @@ as:Place a owl:Class,
owl:onProperty as:latitude ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:altitude ],
owl:onProperty as:accuracy ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:longitude ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:allValuesFrom linkml:Float ;
owl:onProperty as:latitude ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Float ;
owl:onProperty as:altitude ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:radius ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Float ;
owl:onProperty as:longitude ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:unionOf ( as:UnitEnum as:anyURI ) ] ;
owl:onProperty as:units ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:units ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:accuracy ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:altitude ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:longitude ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
@ -284,36 +309,8 @@ as:Place a owl:Class,
owl:onDatatype xsd:integer ;
owl:withRestrictions ( [ xsd:maxInclusive 100 ] ) ] ) ] ;
owl:onProperty as:accuracy ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:unionOf ( as:UnitEnum as:anyURI ) ] ;
owl:onProperty as:units ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:accuracy ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Float ;
owl:onProperty as:latitude ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:altitude ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:accuracy ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:radius ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:longitude ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:units ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Float ;
owl:onProperty as:altitude ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:radius ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
@ -321,6 +318,9 @@ as:Place a owl:Class,
owl:onDatatype xsd:integer ;
owl:withRestrictions ( [ xsd:minInclusive 0 ] ) ] ) ] ;
owl:onProperty as:radius ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:altitude ],
as:Object ;
skos:definition "Represents a logical or physical location. See 5.3 Representing Places for additional information." ;
skos:exactMatch as:Place ;
@ -333,10 +333,10 @@ as:Profile a owl:Class,
owl:allValuesFrom as:Object ;
owl:onProperty as:describes ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:minCardinality 0 ;
owl:onProperty as:describes ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:maxCardinality 1 ;
owl:onProperty as:describes ],
as:Object ;
skos:definition "A Profile is a content object that describes another Object, typically used to describe Actor Type objects. The describes property is used to reference the object being described by the profile." ;
@ -348,16 +348,16 @@ as:Question a owl:Class,
rdfs:label "Question" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:anyOf ],
owl:onProperty as:oneOf ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:oneOf ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:anyOf ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:oneOf ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:anyOf ],
as:IntransitiveActivity ;
skos:definition """Represents a question being asked. Question objects are an extension of IntransitiveActivity. That is, the Question object is an Activity, but the direct object is the question itself and therefore it would not contain an object property.
Either of the anyOf and oneOf properties MAY be used to express possible answers, but a Question object MUST NOT have both properties.
@ -378,23 +378,23 @@ as:Relationship a owl:Class,
rdfs:label "Relationship" ;
rdfs:seeAlso <https://www.w3.org/TR/activitystreams-vocabulary/#connections> ;
rdfs:subClassOf [ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:object ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:relationship ],
[ a owl:Restriction ;
owl:allValuesFrom as:Object ;
owl:onProperty as:relationship ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:subject ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:subject ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:minCardinality 0 ;
owl:onProperty as:object ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:relationship ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:subject ],
owl:onProperty as:object ],
as:Object ;
skos:definition """Describes a relationship between two individuals. The subject and object properties are used to identify the connected individuals.
See 5.2 Representing Relationships Between Entities for additional information.
@ -440,15 +440,15 @@ as:Tombstone a owl:Class,
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:deleted ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:deleted ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:formerType ],
[ a owl:Restriction ;
owl:allValuesFrom as:Object ;
owl:onProperty as:formerType ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:deleted ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:deleted ],
@ -1055,37 +1055,28 @@ as:Collection a owl:Class,
rdfs:label "Collection" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:items ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:totalItems ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:current ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:current ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:last ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:last ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:totalItems ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:current ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:first ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:maxCardinality 1 ;
owl:onProperty as:first ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:items ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:first ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:current ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:totalItems ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:intersectionOf ( as:nonNegativeInteger [ a rdfs:Datatype ;
@ -1094,10 +1085,19 @@ as:Collection a owl:Class,
owl:onProperty as:totalItems ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:totalItems ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:last ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:first ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:items ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:current ],
as:Object ;
skos:definition "A Collection is a subtype of Object that represents ordered or unordered sets of Object or Link instances. Refer to the Activity Streams 2.0 Core specification for a complete description of the Collection type." ;
skos:exactMatch as:Collection ;
@ -1115,29 +1115,29 @@ as:CollectionPage a owl:Class,
linkml:ClassDefinition ;
rdfs:label "CollectionPage" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:next ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Link as:Collection ) ] ;
owl:onProperty as:partOf ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:next ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:prev ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:prev ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:prev ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:prev ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:partOf ],
owl:minCardinality 0 ;
owl:onProperty as:next ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:partOf ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:prev ],
owl:maxCardinality 1 ;
owl:onProperty as:partOf ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:next ],
@ -1150,41 +1150,41 @@ as:OrderedCollectionPage a owl:Class,
linkml:ClassDefinition ;
rdfs:label "OrderedCollectionPage" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:minCardinality 0 ;
owl:maxCardinality 1 ;
owl:onProperty as:startIndex ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:prev ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:next ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:partOf ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:items ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:partOf ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:startIndex ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:intersectionOf ( as:nonNegativeInteger [ a rdfs:Datatype ;
owl:onDatatype xsd:integer ;
owl:withRestrictions ( [ xsd:minInclusive 0 ] ) ] ) ] ;
owl:onProperty as:startIndex ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:startIndex ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:prev ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:next ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:partOf ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:prev ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Link as:Collection ) ] ;
owl:onProperty as:partOf ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:startIndex ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:partOf ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:items ],
owl:onProperty as:prev ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty as:items ],
@ -1192,8 +1192,8 @@ as:OrderedCollectionPage a owl:Class,
owl:maxCardinality 1 ;
owl:onProperty as:next ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:CollectionPage as:OrderedCollectionPage as:Link ) ] ;
owl:onProperty as:next ],
owl:allValuesFrom [ owl:unionOf ( as:Link as:Collection ) ] ;
owl:onProperty as:partOf ],
as:OrderedCollection ;
skos:definition "Used to represent ordered subsets of items from an OrderedCollection. Refer to the Activity Streams 2.0 Core for a complete description of the OrderedCollectionPage object." ;
skos:exactMatch as:OrderedCollectionPage ;
@ -1213,41 +1213,41 @@ as:Activity a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Activity" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:origin ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:result ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:actor ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:target ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:actor ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:object ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:target ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:object ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:actor ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:result ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:instrument ],
owl:onProperty as:origin ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:origin ],
owl:onProperty as:actor ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:object ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:target ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:instrument ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:instrument ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:origin ],
as:Object ;
skos:definition "An Activity is a subtype of Object that describes some form of action that may happen, is currently happening, or has already happened. The Activity type itself serves as an abstract base type for all types of activities. It is important to note that the Activity type itself does not carry any specific semantics about the kind of action being taken." ;
skos:exactMatch as:Activity ;
@ -1259,82 +1259,82 @@ as:Link a owl:Class,
rdfs:seeAlso <https://www.w3.org/TR/activitystreams-vocabulary/#bib-RFC5988> ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty as:hreflang ],
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:width ],
owl:minCardinality 0 ;
owl:onProperty as:height ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty as:mediaType ],
owl:onProperty as:rel ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:href ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:preview ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:unionOf ( linkml:String as:langString ) ] ;
owl:onProperty as:name ],
[ a owl:Restriction ;
owl:allValuesFrom as:anyURI ;
owl:onProperty as:href ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:intersectionOf ( as:nonNegativeInteger [ a rdfs:Datatype ;
owl:onDatatype xsd:integer ;
owl:withRestrictions ( [ xsd:minInclusive 0 ] ) ] ) ] ;
owl:onProperty as:height ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:height ],
[ a owl:Restriction ;
owl:allValuesFrom as:anyURI ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Link as:Object ) ] ;
owl:onProperty as:preview ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:height ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:preview ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:hreflang ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:href ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:rel ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:intersectionOf ( as:nonNegativeInteger [ a rdfs:Datatype ;
owl:onDatatype xsd:integer ;
owl:withRestrictions ( [ xsd:minInclusive 0 ] ) ] ) ] ;
owl:onProperty as:width ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:id ],
owl:onProperty as:height ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:width ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:name ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:hreflang ],
owl:onProperty as:height ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty as:rel ],
owl:onProperty as:hreflang ],
[ a owl:Restriction ;
owl:allValuesFrom as:anyURI ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:hreflang ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:hreflang ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:rel ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Link as:Object ) ] ;
owl:onProperty as:preview ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:name ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:href ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:width ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:intersectionOf ( as:nonNegativeInteger [ a rdfs:Datatype ;
owl:onDatatype xsd:integer ;
owl:withRestrictions ( [ xsd:minInclusive 0 ] ) ] ) ] ;
owl:onProperty as:width ],
[ a owl:Restriction ;
owl:allValuesFrom as:anyURI ;
owl:onProperty as:href ] ;
skos:definition "A Link is an indirect, qualified reference to a resource identified by a URL. The fundamental model for links is established by [ RFC5988]. Many of the properties defined by the Activity Vocabulary allow values that are either instances of Object or Link. When a Link is used, it establishes a qualified relation connecting the subject (the containing object) to the resource identified by the href. Properties of the Link are properties of the reference as opposed to properties of the resource." ;
skos:exactMatch as:Link ;
@ -1344,194 +1344,194 @@ as:Object a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Object" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:published ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:unionOf ( linkml:String as:langString ) ] ;
owl:onProperty as:name ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:published ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:updated ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:endTime ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:generator ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:attachment ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:updated ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:bcc ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:generator ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:image ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Link as:Object ) ] ;
owl:onProperty as:preview ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:attachment ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:unionOf ( linkml:String as:langString ) ] ;
owl:onProperty as:content ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:context ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:bto ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:replies ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:startTime ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:cc ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:updated ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:location ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Link as:Object ) ] ;
owl:onProperty as:attributedTo ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:url ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:startTime ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Image as:Link ) ] ;
owl:onProperty as:icon ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:location ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:context ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:tag ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:duration ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:tag ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:cc ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:endTime ],
[ a owl:Restriction ;
owl:allValuesFrom as:Collection ;
owl:onProperty as:replies ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:icon ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:preview ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:bcc ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:audience ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:to ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:anyURI as:Link ) ] ;
owl:onProperty as:url ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:name ],
[ a owl:Restriction ;
owl:allValuesFrom as:anyURI ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:audience ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:inReplyTo ],
[ a owl:Restriction ;
owl:allValuesFrom as:durationType ;
owl:onProperty as:duration ],
owl:minCardinality 0 ;
owl:onProperty as:location ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:endTime ],
owl:onProperty as:generator ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:context ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Link as:Object ) ] ;
owl:onProperty as:preview ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:bto ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:startTime ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:published ],
owl:onProperty as:updated ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:to ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:duration ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:attributedTo ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:replies ],
owl:onProperty as:image ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:inReplyTo ],
owl:onProperty as:cc ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Image as:Link ) ] ;
owl:onProperty as:image ],
owl:minCardinality 0 ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:unionOf ( linkml:String as:langString ) ] ;
owl:onProperty as:summary ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:generator ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:duration ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:published ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:startTime ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:published ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:name ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:endTime ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:unionOf ( linkml:String as:langString ) ] ;
owl:onProperty as:name ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:bcc ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:bto ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:tag ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Image as:Link ) ] ;
owl:onProperty as:icon ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:inReplyTo ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:startTime ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:attachment ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:replies ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:bcc ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:anyURI as:Link ) ] ;
owl:onProperty as:url ],
[ a owl:Restriction ;
owl:allValuesFrom as:anyURI ;
owl:onProperty as:id ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:summary ],
[ a owl:Restriction ;
owl:allValuesFrom as:Collection ;
owl:onProperty as:replies ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:context ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:startTime ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:audience ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:cc ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Link as:Object ) ] ;
owl:onProperty as:attributedTo ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:tag ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:endTime ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:published ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:to ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:attributedTo ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:url ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:attachment ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:preview ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:location ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:duration ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:content ],
[ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:unionOf ( linkml:String as:langString ) ] ;
owl:onProperty as:content ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:summary ] ;
owl:onProperty as:updated ],
[ a owl:Restriction ;
owl:maxCardinality 1 ;
owl:onProperty as:mediaType ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:audience ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:Datetime ;
owl:onProperty as:updated ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Object as:Link ) ] ;
owl:onProperty as:to ],
[ a owl:Restriction ;
owl:allValuesFrom [ owl:unionOf ( as:Image as:Link ) ] ;
owl:onProperty as:image ],
[ a owl:Restriction ;
owl:allValuesFrom as:durationType ;
owl:onProperty as:duration ],
[ a owl:Restriction ;
owl:minCardinality 0 ;
owl:onProperty as:endTime ] ;
skos:definition "Describes an object of any kind. The Object type serves as the base type for most of the other kinds of objects defined in the Activity Vocabulary, including other Core types such as Activity, IntransitiveActivity, Collection and OrderedCollection." ;
skos:exactMatch as:Object ;
skos:inScheme <https://github.com/p2p_ld/linkml-activitypub> .

File diff suppressed because it is too large Load diff

View file

@ -42,18 +42,6 @@ class UnitEnum(str, Enum):
class Property(ConfiguredBaseModel):
None
class Statement(ConfiguredBaseModel):
None
class Object(ConfiguredBaseModel):
"""
Describes an object of any kind. The Object type serves as the base type for most of the other kinds of objects defined in the Activity Vocabulary, including other Core types such as Activity, IntransitiveActivity, Collection and OrderedCollection.
@ -92,6 +80,27 @@ When used on an Object, identifies the MIME media type of the value of the conte
class Source(ConfiguredBaseModel):
content: Optional[List[str]] = Field(default_factory=list, description="""The content or textual representation of the Object encoded as a JSON string. By default, the value of content is HTML. The mediaType property can be used in the object to indicate a different content type. The content MAY be expressed using multiple language-tagged values.""")
mediaType: Optional[str] = Field(None, description="""When used on a Link, identifies the MIME media type of the referenced resource.
When used on an Object, identifies the MIME media type of the value of the content property. If not specified, the content property is assumed to contain text/html content.
""")
class Property(ConfiguredBaseModel):
None
class Statement(ConfiguredBaseModel):
None
class Link(ConfiguredBaseModel):
"""
A Link is an indirect, qualified reference to a resource identified by a URL. The fundamental model for links is established by [ RFC5988]. Many of the properties defined by the Activity Vocabulary allow values that are either instances of Object or Link. When a Link is used, it establishes a qualified relation connecting the subject (the containing object) to the resource identified by the href. Properties of the Link are properties of the reference as opposed to properties of the resource.
@ -2367,9 +2376,10 @@ class OrderedItems(ConfiguredBaseModel):
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Object.model_rebuild()
Source.model_rebuild()
Property.model_rebuild()
Statement.model_rebuild()
Object.model_rebuild()
Link.model_rebuild()
Activity.model_rebuild()
IntransitiveActivity.model_rebuild()

View file

@ -20,4 +20,140 @@ prefixes:
xml: http://www.w3.org/XML/1998/namespace
xsd: http://www.w3.org/2001/XMLSchema#
rdfs: http://www.w3.org/2000/01/rdf-schema#
default_prefix: ap
default_prefix: ap
classes:
Object:
is_a: as:Object
description: Describes an object of any kind. The Object type serves as the base type for most of the other kinds of objects defined in the Activity Vocabulary, including other Core types such as Activity, IntransitiveActivity, Collection and OrderedCollection.
slots:
- source
- likes
- shares
class_uri: ap:Object
disjoint_with: Link
Actor:
is_a: as:Actor
slots:
- inbox
- outbox
- following
- followers
- liked
- streams
- preferredUsername
- endpoints
Inbox:
description: STUB
Outbox:
description: STUB
Followers:
is_a: Collection
mixins:
- ActorCollectionMixin
Following:
is_a: Collection
mixins:
- ActorCollectionMixin
Likes:
is_a: Collection
slot_usage:
items:
range: as:Like
Shares:
is_a: Collection
slot_usage:
items:
range: as:Announce
Public:
is_a: as:Collection
description: The special "public" collection https://www.w3.org/TR/activitypub/#public-addressing
Source:
slots:
- content
- mediaType
# Static Entities
Endpoint:
slots:
- proxyURL
- oauthAuthorizationEndpoint
- oauthTokenEndpoint
- provideClientKey
- signClientKey
- sharedInbox
# Helper Classes
HTTPMixin:
description: "Mixin for collections that are supposed to behave as HTTP endpoints"
mixin: true
slots:
- http_action # whatever you call "GET/POST/etc."
CollectionMixin:
description: "Additional props that are specified for some of the AP collections"
mixin: true
slots:
- authorization
- deduplication
- filter # mapping between visibility levels and collection of actor
ActorCollectionMixin:
is_a: Collection
mixin: true
slot_usage:
items:
range: as:Actor
slots:
source:
slot_uri: ap:source
range: Source
domain_of:
- Object
inbox:
description: STUB
required: true
outbox:
description: STUB
required: true
endpoints:
description: STUB
multivalued: true
range: Endpoints
liked:
description: STUB
required: false
multivalued: false
domain_of:
- as:Actor
range: Likes
likes:
description: STUB
required: false
multivalued: false
domain_of:
- as:Object
range: Likes
shares:
description: STUB
required: false
domain_of:
- as:Object
range: Shares