Datasets:

License:
Dataset Viewer
Full Screen
The dataset viewer is not available for this split.
Cannot extract the features (columns) for the split 'train' of the config 'default' of the dataset.
Error code:   FeaturesError
Exception:    ArrowInvalid
Message:      JSON parse error: Column(/pst/usr/nms) changed from string to array in row 1030
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 160, in _generate_tables
                  df = pandas_read_json(f)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 38, in pandas_read_json
                  return pd.read_json(path_or_buf, **kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 815, in read_json
                  return json_reader.read()
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1025, in read
                  obj = self._get_object_parser(self.data)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1051, in _get_object_parser
                  obj = FrameParser(json, **kwargs).parse()
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1187, in parse
                  self._parse()
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1403, in _parse
                  ujson_loads(json, precise_float=self.precise_float), dtype=None
              ValueError: Trailing data
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 233, in compute_first_rows_from_streaming_response
                  iterable_dataset = iterable_dataset._resolve_features()
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2998, in _resolve_features
                  features = _infer_features_from_batch(self.with_format(None)._head())
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1918, in _head
                  return _examples_to_batch(list(self.take(n)))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2093, in __iter__
                  for key, example in ex_iterable:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1576, in __iter__
                  for key_example in islice(self.ex_iterable, self.n - ex_iterable_num_taken):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 279, in __iter__
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 163, in _generate_tables
                  raise e
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 137, in _generate_tables
                  pa_table = paj.read_json(
                File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
                File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: JSON parse error: Column(/pst/usr/nms) changed from string to array in row 1030

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Bluesky Aozora Dive

image/png

... Is an archive of atproto's firehose (and relatedly bluesky) streams.

This dataset name is inspired from a song.

Data Formats

We present data as is with minimum enrichment.

  • Any cryptographic CIDs are stripped as they do not possess any useful textual data.

Streams

The firehose is split into 2 jsonl file for your usage:

  • ..._atproto_interactions.jsonl: Contains interaction events, such as likes, follows, reposts and blocks
  • ..._atproto_general.jsonl: Contains accounts, identities, posts and replies

Common Fields

  • typ: Represents the data type.
  • usr: Which User is it from. Represented in the Usernames format below.
  • rid: Record Key. Use this to access data from bsky api.

The most basic root construct will typically contain:

{
    "typ": "<Type>",
    "usr": {
        "did": "did:plc:ssd5xwqvrdrxyu2br7sfjwzy",
    },
}

Usernames are constructed in the following format:

{
    "did": "did:plc:4hqjfn7m6n5hno3doamuhgef",
}

did: Decentralized ID. Consider this as ID for most cases and it points to a unique ID.
nms: [DEPRECATED!] Usernames. Either can be a string or a list of strings. Do not blindly assume this is going to be only a string! Though generally, it should just be a string.

  • nms will not be provided in future firehose archives. Turns out PLC directory didn't like me.

For most cases, expect the did to describe a user.

Blobs

Blobs represent media content. Typically you can tell it's a blob if it has a mime field and a cid.

{
    "mime": "image/jpeg",
    "size": 891965,
    "cid": "bafkreifu35fvx45eyldhpoyb3zgtb5dobvjfpw5kkeexwxefrfpzye2pji"
}

Given the user account is this:

{
    "typ": "account",
    "usr": {
        "did": "did:plc:lri5xcv6ogaldxkigm32wa57",
        "avy": {
            "mime": "image/jpeg",
            "size": 226086,
            "cid": "bafkreif3z2y2rfrfcjt4rwwps4ib7q7qywrdt76bw6dmj5ebqefgllpima"
        },
        "bnr": null,
        "crt": 1723726663.57,
        "dsc": "――あなたの日常に、AIの籠った音色を。\n\n▼思い出や日常、希望をお聞かせください。その想いを曲にいたします。\nhttps://forms.gle/rF2iqwXxabfVEifd7",
        "dsp": "雪白ゆっち feat.AI Creator"
    }
}

Construct the avy url like so:

Template: https://bsky.social/xrpc/com.atproto.sync.getBlob?did=<usr.did>&cid=<usr.avy.cid>

A full link looks like this: https://bsky.social/xrpc/com.atproto.sync.getBlob?did=did:plc:lri5xcv6ogaldxkigm32wa57&cid=bafkreif3z2y2rfrfcjt4rwwps4ib7q7qywrdt76bw6dmj5ebqefgllpima

Yes I did spend a while trying to lookup to see why it is not working.

Posts (Simple)

Posts can get rather complicated. Here's a sample of a simple post.

{
    "typ": "post",
    "usr": {
        "did": "did:plc:ssd5xwqvrdrxyu2br7sfjwzy",
    },
    "rid": "3kzyon77od52v",
    "chg": "create",
    "tst": 1723987630.494,
    "pst": {
        "txt": "✔✔✔On Aug 18, 2024, 11:59 AM(UTC). According to Binance Market Data, Bitcoin has crossed the 60,000 USDT benchmark and is now trading at 60,006.578125 USDT, with a narrowed 1.49% increase in 24 hours.👀👀",
        "emb": null,
        "fct": [],
        "lbl": [],
        "lng": [],
        "tgs": [],
        "rpl": null
    }
}
  • tst: Contains the timestamp in unix float time.
  • chg: Change type. Typically either create or delete for posts. change for allowing Direct Messages.
  • rid: Record Key. Use this to access data from bsky api.
  • pst: Contains the actual posted data.

Posts (Complex)

As for replies and other fields, here's a more complex example.

{
    "typ": "reply",
    "usr": {
        "did": "did:plc:4hqjfn7m6n5hno3doamuhgef",
        "nms": "yui.syui.ai"
    },
    "rid": "3kzyotm2hzq2d",
    "chg": "create",
    "tst": 1723987844.937,
    "pst": {
        "txt": "https://card.syui.ai/baiser \nbaiser\njoin : baiser.blue [IIT]\nten : 1000\naiten : 21037247\n---\n[1-7]\nten d : shuffle[IIT☑]\nten p : post\n---\n",
        "emb": null,
        "fct": [
            {
                "typ": "@",
                "val": "https://card.syui.ai/baiser",
                "rng": [
                    0,
                    27
                ]
            }
        ],
        "lbl": [],
        "lng": [],
        "tgs": [],
        "rpl": {
            "typ": "post",
            "usr": {
                "did": "did:plc:vok247eewjmbmo3kxaizct2i",
                "nms": "baiser.blue"
            },
            "rid": "3kzyotbooo22c",
            "rrt": {
                "typ": "post",
                "usr": {
                    "did": "did:plc:vok247eewjmbmo3kxaizct2i",
                    "nms": "baiser.blue"
                },
                "rid": "3kzyosf6atg2v"
            }
        }
    }
}
  • fct: Stands for Facets:
    • typ: The facet type. (tag,link,mention)
    • val: The facet value. Note that this can be a Username dict when typ == mention
    • rng: Byte range. AFAIK this is in UTF-16 but I can be wrong. Follow atproto's docs for this.
  • lbl: Labels. A list of strings. Though typically empty list for firehose streams. Labels are sent seperately firehose stream-wise.
  • lng: Languages. Either an list (Can be empty) or a string.
  • tgs: "Additional hashtags, in addition to any included in post text and facets."
  • rpl: The post that the current post is replying to.
    • Note: The reply post is not enriched with the actual post.
    • typ/usr/rid: Refer to the simple posts section.
    • rrt: Root post. Can be null if root post is the same as the rpl post rid.
  • emb: Any rich embed.
    • Embed primarily has around 5 types
      1. Images
      • A list of images.
      • Each image contains: img (BlobRef), alt (Alt Text), isz (Size)
      1. Video
      • A Video
      • Contains the following fields: vid, alt (Alt Text), isz (Size), cpt (Captions, Dictionary with of key for languages and a BlobRef for value)
      1. External (Outside bluesky)
      • Typically webpages and the like
      1. w/ Record (A post that has a link to another person)
      2. Same as 5 but with Images.
    • TL;DR: Embeds are complicated.

Accounts

{
    "typ": "account",
    "usr": {
        "did": "did:plc:cj3ngde5wbljf5sh33g7zsdz",
        "avy": {
            "mime": "image/jpeg",
            "size": 79776,
            "cid": "bafkreiczz2spptgturm43r33impbkcar4tmdmnh34pqkp2tynlztbxmw7a"
        },
        "bnr": {
            "mime": "image/jpeg",
            "size": 748930,
            "cid": "bafkreigb5l3u32quxzhpbca6bnrunfdau3m4bp6fdntmj2lwec3erkssty"
        },
        "crt": null,
        "dsc": "こっちでは、主に練習中の下手なイラスト・ゲーム関系とかを投稿していきたいな〜\n\n最推しのねくろさんの配信を見るといやされる( ◠‿◠ )",
        "dsp": "しろっつ🖤🐐👑"
    }
}

For Accounts, the usr field is more filled. In addition to did, there are other fields like:

  • avy/bnr: either a Blob or null. Refer to Blobs section above.
  • crt: Account Creation time. Can be null!
  • dsc: Profile Bio / Blurb Section.
  • dsp: Display name.

Reconstructing to a AtUri

For post and reply types, Take the following values and combine them into the following url:

at://<usr.did>/app.bsky.feed.post/<rid>

Replies are just posts.

For repost and like types, it's similar but a bit different:

  • Reposts: at://<usr.did>/app.bsky.feed.repost/<rid>
  • likes: at://<usr.did>/app.bsky.feed.like/<rid>

Enrichment of replies

curl -L -X GET 'https://public.api.bsky.app/xrpc/app.bsky.feed.getPosts?uris=at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.post/3kzyotm2hzq2d' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'

"Miracle Spec"

Recently, some creative folks have started adding their own data to the atproto stream. Some notable examples I saw are:

As of 01/10/24, I've added support for those.. They are labeled as "MiracleRoad!" for typ and only contain the raw record data.

Illegal Spec Followers

In other words, we also capture content that failed to follow specs. Like this:

{
    "typ": "IllegalSpecFollowerAkaFixYourShit",
    "record": {
        "text": "任某(男,31歲),被行拘! ",
        "$type": "app.bsky.feed.post",
        "embed": {
            "uri": "https://www.headline01.com/a/Xio3zSUuGvX7J1jCSG_F5g-51479340.html",
            "$type": "app.bsky.embed.external#main",
            "external": {
                "uri": "https://www.headline01.com/a/Xio3zSUuGvX7J1jCSG_F5g-51479340.html",
                "thumb": {
                    "ref": "bafkreidrfrfluqo26yy4pemkcpgug2p5sea3xrwh3schfnns5owa7gbwvm",
                    "size": 86924,
                    "$type": "blob",
                    "mimeType": "image/jpeg"
                },
                "title": "任某(男,31歲),被行拘!",
                "description": ""
            }
        },
        "createdAt": "2024-08-18T14:05:19.645644Z"
    }
}

Lines marked as IllegalSpecFollowerAkaFixYourShit should be ignored in general though. Content isn't great anyway.

Changes

[01/09/24]

Removed mentions of nms. We stopped resolving DIDs after 01/09/24 as it appears that I'm slamming PLC directory too much lol. Sorry!

[04/09/24]

Fixed video embeds as it started to crash the scraper resuling in some missing stuff.

Various Notes

Recommendations

For getting a more proper stream of posts, it's recommended to keep a track of users + posts in a index cache.

Then again, you can just fetch a list from bsky api directly lol.

Do consider reading up on bsky docs and atproto docs.

Docs Nonsense

When the bluesky docs say: "...Implemented by PDS".

You should probably use the following base url: https://bsky.social/xrpc/

Deletions

UnActions ("unpost","unlike","unrepost") only contains rid as the record key.

License

For everyone out there, data is meant to be free unlike some previous license I did. This is free for grabs aka CC-BY-4.0.

for Big Corps wanting to use it: Sure. As long as you cite this dataset + CC-BY-4.0 license. Be nice to people who have came before you and did it.

Citations

We would much love academia to cite this dataset. Be nice please :)

@misc{bskyaozora,
  title         = {Aozora Diving: diving into the sea of atproto and bluesky network },
  author        = {KaraKaraWitch},
  year          = {2024},
  howpublished  = {\url{https://huggingface.co/datasets/WitchesSocialStream/bluesky-Aozora-Diving}},
}
Downloads last month
83

Collection including WitchesSocialStream/bluesky-Aozora-Diving