Skip to content
  • Categories
  • Recent
  • Popular
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB-ActivityPub Bridge Test Instance

  1. Home
  2. Categories
  3. General Discussion
  4. AP Test (community.nodebb.org)
  5. Question re: @context and JSON-LD

Question re: @context and JSON-LD

Scheduled Pinned Locked Moved AP Test (community.nodebb.org)
activitypubmastodonjsonld
5 Posts 3 Posters 22 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • julian@community.nodebb.orgJ This user is from outside of this forum
    julian@community.nodebb.orgJ This user is from outside of this forum
    julian@community.nodebb.org
    wrote on last edited by
    #1

    Let's say for some contrived (but very real) reason, I want to add { "toot": "http://joinmastodon.org/ns#", "Emoji": "toot:Emoji" } to @context, but another member of @context might be { "toot": "http://joinmastodon.org/ns#", "focalPoint": ... }

    Would it be acceptable if I just pushed my object to the end and assumed that JSON-LD parsers would correctly reduce it down to:

    {
      "toot": "http://joinmastodon.org/ns#",
      "Emoji": "toot:Emoji",
      "focalPoint": ...
    }
    

    ... or should I be adding in logic to detect the existing member defining toot and merge the Emoji property in?

    1 Reply Last reply
    0
    • thisismissem@hachyderm.ioT This user is from outside of this forum
      thisismissem@hachyderm.ioT This user is from outside of this forum
      thisismissem@hachyderm.io
      wrote on last edited by
      #2

      @julian depends on if your property conflicts with any other defined properties. (see the schema.org problem)

      julian@community.nodebb.orgJ 1 Reply Last reply
      0
      • thisismissem@hachyderm.ioT thisismissem@hachyderm.io

        @julian depends on if your property conflicts with any other defined properties. (see the schema.org problem)

        julian@community.nodebb.orgJ This user is from outside of this forum
        julian@community.nodebb.orgJ This user is from outside of this forum
        julian@community.nodebb.org
        wrote on last edited by
        #3

        @thisismissem@hachyderm.io let's assume no. Only common property is toot.

        I just want to make sure it's not going to make fedify or smithereen throw errors when it tries to parse my janky @context.

        1 Reply Last reply
        0
        • trwnh@mastodon.socialT This user is from outside of this forum
          trwnh@mastodon.socialT This user is from outside of this forum
          trwnh@mastodon.social
          wrote on last edited by
          #4

          @julian @thisismissem context definitions work on a "most recently declared wins" basis. so it's generally *okay* to redeclare the same definition, just unnecessary.

          the only exception is when the @\protected keyword is used, which disallows any further redefinitions unless the new definition exactly matches the old definition.

          trwnh@mastodon.socialT 1 Reply Last reply
          0
          • trwnh@mastodon.socialT trwnh@mastodon.social

            @julian @thisismissem context definitions work on a "most recently declared wins" basis. so it's generally *okay* to redeclare the same definition, just unnecessary.

            the only exception is when the @\protected keyword is used, which disallows any further redefinitions unless the new definition exactly matches the old definition.

            trwnh@mastodon.socialT This user is from outside of this forum
            trwnh@mastodon.socialT This user is from outside of this forum
            trwnh@mastodon.social
            wrote on last edited by
            #5

            @julian @thisismissem which is to say, the following are equivalent within the same scope...

            @\context: [
            {
            toot: http://joinmastodon.org/ns#,
            Emoji: toot:Emoji
            },
            {
            toot: http://joinmastodon.org/ns#,
            IdentityProof: toot:IdentityProof
            }
            ]

            @\context: [
            {
            toot: http://joinmastodon.org/ns#,
            Emoji: toot:Emoji,
            IdentityProof: toot:IdentityProof
            }
            ]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Popular