Double quotes

merge-requests/30/head
Bob Mottram 2022-06-27 21:24:58 +01:00
parent c4d4c02671
commit 535df7c293
1 changed files with 94 additions and 85 deletions

View File

@ -28,78 +28,78 @@ Here's an example of the actor record of our friend Alyssa P. Hacker:
### Example 1 ### Example 1
``` json ``` json
{'aliases': ['https://instancedomain/@Alyssa', {"aliases": ["https://instancedomain/@Alyssa",
'https://instancedomain/users/Alyssa'], "https://instancedomain/users/Alyssa"],
'links': [{'href': 'https://instancedomain/@Alyssa', "links": [{"href": "https://instancedomain/@Alyssa",
'rel': 'http://webfinger.net/rel/profile-page', "rel": "http://webfinger.net/rel/profile-page",
'type': 'text/html'}, "type": "text/html"},
{'href': 'https://instancedomain/users/Alyssa', {"href": "https://instancedomain/users/Alyssa",
'rel': 'self', "rel": "self",
'type': 'application/activity+json'}, "type": "application/activity+json"},
{'rel': 'http://ostatus.org/schema/1.0/subscribe', {"rel": "http://ostatus.org/schema/1.0/subscribe",
'template': 'https://instancedomain/authorize_interaction?uri={uri}'}], "template": "https://instancedomain/authorize_interaction?uri={uri}"}],
'subject': 'acct:Alyssa@instancedomain'} "subject": "acct:Alyssa@instancedomain"}
{'@context': ['https://www.w3.org/ns/activitystreams', {"@context": ["https://www.w3.org/ns/activitystreams",
'https://w3id.org/security/v1', "https://w3id.org/security/v1",
{'Curve25519Key': 'toot:Curve25519Key', {"Curve25519Key": "toot:Curve25519Key",
'Device': 'toot:Device', "Device": "toot:Device",
'Ed25519Key': 'toot:Ed25519Key', "Ed25519Key": "toot:Ed25519Key",
'Ed25519Signature': 'toot:Ed25519Signature', "Ed25519Signature": "toot:Ed25519Signature",
'EncryptedMessage': 'toot:EncryptedMessage', "EncryptedMessage": "toot:EncryptedMessage",
'PropertyValue': 'schema:PropertyValue', "PropertyValue": "schema:PropertyValue",
'alsoKnownAs': {'@id': 'as:alsoKnownAs', '@type': '@id'}, "alsoKnownAs": {"@id": "as:alsoKnownAs", "@type": "@id"},
'cipherText': 'toot:cipherText', "cipherText": "toot:cipherText",
'claim': {'@id': 'toot:claim', '@type': '@id'}, "claim": {"@id": "toot:claim", "@type": "@id"},
'deviceId': 'toot:deviceId', "deviceId": "toot:deviceId",
'devices': {'@id': 'toot:devices', '@type': '@id'}, "devices": {"@id": "toot:devices", "@type": "@id"},
'discoverable': 'toot:discoverable', "discoverable": "toot:discoverable",
'featured': {'@id': 'toot:featured', '@type': '@id'}, "featured": {"@id": "toot:featured", "@type": "@id"},
'featuredTags': {'@id': 'toot:featuredTags', '@type': '@id'}, "featuredTags": {"@id": "toot:featuredTags", "@type": "@id"},
'fingerprintKey': {'@id': 'toot:fingerprintKey', '@type': '@id'}, "fingerprintKey": {"@id": "toot:fingerprintKey", "@type": "@id"},
'focalPoint': {'@container': '@list', '@id': 'toot:focalPoint'}, "focalPoint": {"@container": "@list", "@id": "toot:focalPoint"},
'identityKey': {'@id': 'toot:identityKey', '@type': '@id'}, "identityKey": {"@id": "toot:identityKey", "@type": "@id"},
'manuallyApprovesFollowers': 'as:manuallyApprovesFollowers', "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
'messageFranking': 'toot:messageFranking', "messageFranking": "toot:messageFranking",
'messageType': 'toot:messageType', "messageType": "toot:messageType",
'movedTo': {'@id': 'as:movedTo', '@type': '@id'}, "movedTo": {"@id": "as:movedTo", "@type": "@id"},
'publicKeyBase64': 'toot:publicKeyBase64', "publicKeyBase64": "toot:publicKeyBase64",
'schema': 'http://schema.org#', "schema": "http://schema.org#",
'suspended': 'toot:suspended', "suspended": "toot:suspended",
'toot': 'http://joinmastodon.org/ns#', "toot": "http://joinmastodon.org/ns#",
'value': 'schema:value'}], "value": "schema:value"}],
'alsoKnownAs': ['https://activitypubhackers/users/Alyssa'], "alsoKnownAs": ["https://activitypubhackers/users/Alyssa"],
'attachment': [{'name': 'XMPP', "attachment": [{"name": "XMPP",
'type': 'PropertyValue', "type": "PropertyValue",
'value': 'alyssa@chatdomain'}], "value": "alyssa@chatdomain"}],
'devices': 'https://instancedomain/users/Alyssa/collections/devices', "devices": "https://instancedomain/users/Alyssa/collections/devices",
'discoverable': True, "discoverable": True,
'endpoints': {'sharedInbox': 'https://instancedomain/inbox'}, "endpoints": {"sharedInbox": "https://instancedomain/inbox"},
'featured': 'https://instancedomain/users/Alyssa/collections/featured', "featured": "https://instancedomain/users/Alyssa/collections/featured",
'featuredTags': 'https://instancedomain/users/Alyssa/collections/tags', "featuredTags": "https://instancedomain/users/Alyssa/collections/tags",
'followers': 'https://instancedomain/users/Alyssa/followers', "followers": "https://instancedomain/users/Alyssa/followers",
'following': 'https://instancedomain/users/Alyssa/following', "following": "https://instancedomain/users/Alyssa/following",
'icon': {'mediaType': 'image/png', "icon": {"mediaType": "image/png",
'type': 'Image', "type": "Image",
'url': 'https://instancedomain/accounts/avatars/000/000/001/original/abc.png'}, "url": "https://instancedomain/accounts/avatars/abc.png"},
'id': 'https://instancedomain/users/Alyssa', "id": "https://instancedomain/users/Alyssa",
'image': {'mediaType': 'image/jpeg', "image": {"mediaType": "image/jpeg",
'type': 'Image', "type": "Image",
'url': 'https://instancedomain/accounts/headers/000/000/001/original/def.jpeg'}, "url": "https://instancedomain/accounts/headers/def.jpeg"},
'inbox': 'https://instancedomain/users/Alyssa/inbox', "inbox": "https://instancedomain/users/Alyssa/inbox",
'manuallyApprovesFollowers': False, "manuallyApprovesFollowers": False,
'name': 'Alyssa', "name": "Alyssa",
'outbox': 'https://instancedomain/users/Alyssa/outbox', "outbox": "https://instancedomain/users/Alyssa/outbox",
'preferredUsername': 'Alyssa', "preferredUsername": "Alyssa",
'publicKey': {'id': 'https://instancedomain/users/Alyssa#main-key', "publicKey": {"id": "https://instancedomain/users/Alyssa#main-key",
'owner': 'https://instancedomain/users/Alyssa', "owner": "https://instancedomain/users/Alyssa",
'publicKeyPem': '-----BEGIN PUBLIC KEY-----\n' "publicKeyPem": "-----BEGIN PUBLIC KEY-----\n"
'...' "..."
'-----END PUBLIC KEY-----\n'}, "-----END PUBLIC KEY-----\n"},
'published': '2016-03-16T00:00:00Z', "published": "2016-03-16T00:00:00Z",
'summary': '<p>Hacker in residence</p>', "summary": "<p>Hacker in residence</p>",
'tag': [], "tag": [],
'type': 'Person', "type": "Person",
'url': 'https://instancedomain/@Alyssa'} "url": "https://instancedomain/@Alyssa"}
``` ```
ActivityPub uses [ActivityStreams](https://www.w3.org/TR/activitystreams-core) for its [vocabulary](https://www.w3.org/TR/activitystreams-vocabulary). This is pretty great because ActivityStreams includes all the common terms you need to represent all the activities and content flowing around a social network. It's likely that ActivityStreams already includes all the vocabulary you need, but even if it doesn't, ActivityStreams can be extended via [JSON-LD](https://en.wikipedia.org/wiki/JSON-LD). If you know what JSON-LD is, you can take advantage of the cool linked data approaches provided by JSON-LD. If you don't, don't worry, JSON-LD documents and ActivityStreams can be understood as plain old simple JSON. (If you're going to add extensions, that's the point at which JSON-LD really helps you out). ActivityPub uses [ActivityStreams](https://www.w3.org/TR/activitystreams-core) for its [vocabulary](https://www.w3.org/TR/activitystreams-vocabulary). This is pretty great because ActivityStreams includes all the common terms you need to represent all the activities and content flowing around a social network. It's likely that ActivityStreams already includes all the vocabulary you need, but even if it doesn't, ActivityStreams can be extended via [JSON-LD](https://en.wikipedia.org/wiki/JSON-LD). If you know what JSON-LD is, you can take advantage of the cool linked data approaches provided by JSON-LD. If you don't, don't worry, JSON-LD documents and ActivityStreams can be understood as plain old simple JSON. (If you're going to add extensions, that's the point at which JSON-LD really helps you out).
@ -321,7 +321,7 @@ Servers *MAY* require authorization as specified in section B.1 Authentication a
### 3.3 The source property ### 3.3 The source property
In addition to all the properties defined by the Activity-Vocabulary, ActivityPub extends the `Object` by supplying the `source` property. The `source` property is intended to convey some sort of source from which the `content` markup was derived, as a form of provenance, or to support future editing by clients. In general, clients do the conversion from `source` to `content`, not the other way around. In addition to all the properties defined by the [Activity Vocabulary](https://www.w3.org/TR/activitystreams-vocabulary), ActivityPub extends the `Object` by supplying the `source` property. The `source` property is intended to convey some sort of source from which the `content` markup was derived, as a form of provenance, or to support future editing by clients. In general, clients do the conversion from `source` to `content`, not the other way around.
The value of `source` is itself an object which uses its own `content` and `mediaType` fields to supply source information. The value of `source` is itself an object which uses its own `content` and `mediaType` fields to supply source information.
@ -331,11 +331,13 @@ The value of `source` is itself an object which uses its own `content` and `medi
"@context": ["https://www.w3.org/ns/activitystreams", "@context": ["https://www.w3.org/ns/activitystreams",
{"@language": "en"}], {"@language": "en"}],
"type": "Note", "type": "Note",
"id": "http://postparty.example/statuses/2415", "id": "http://postparty.example/users/username/statuses/2415",
"mediaType": "text/html"
"content": "<p>I <em>really</em> like strawberries!</p>", "content": "<p>I <em>really</em> like strawberries!</p>",
"source": { "source": {
"content": "I *really* like strawberries!", "content": "<p>I *really* like strawberries!</p>",
"mediaType": "text/markdown"} "mediaType": "text/html"
}
} }
``` ```
@ -388,18 +390,25 @@ A link to an ActivityStreams collection of objects this actor has liked; see sec
"@context": ["https://www.w3.org/ns/activitystreams", "@context": ["https://www.w3.org/ns/activitystreams",
{"@language": "ja"}], {"@language": "ja"}],
"type": "Person", "type": "Person",
"id": "https://kenzoishii.example.com/", "id": "https://kenzoishii.example.com/users/kenzoishii",
"following": "https://kenzoishii.example.com/following.json", "following": "https://kenzoishii.example.com/users/kenzoishii/following",
"followers": "https://kenzoishii.example.com/followers.json", "followers": "https://kenzoishii.example.com/users/kenzoishii/followers",
"liked": "https://kenzoishii.example.com/liked.json", "liked": "https://kenzoishii.example.com/users/kenzoishii/liked",
"inbox": "https://kenzoishii.example.com/inbox.json", "inbox": "https://kenzoishii.example.com/users/kenzoishii/inbox",
"outbox": "https://kenzoishii.example.com/feed.json", "outbox": "https://kenzoishii.example.com/users/kenzoishii/outbox",
"preferredUsername": "kenzoishii", "preferredUsername": "kenzoishii",
"name": "石井健蔵", "name": "石井健蔵",
"summary": "この方はただの例です", "summary": "この方はただの例です",
"icon": [ "icon": {
"https://kenzoishii.example.com/image/165987aklre4" "mediaType": "image/png",
] "type": "Image",
"url": "https://kenzoishii.example.com/accounts/avatars/730.png"
},
"image": {
"mediaType": "image/jpeg",
"type": "Image",
"url": "https://kenzoishii.example.com/accounts/headers/zhw.jpg"
}
} }
``` ```