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. Uncategorized
  4. i'm not 100% sure about this but i am starting to think that the way #jsonld context declarations propagate by default is generally an anti-pattern

i'm not 100% sure about this but i am starting to think that the way #jsonld context declarations propagate by default is generally an anti-pattern

Scheduled Pinned Locked Moved Uncategorized
jsonld
106 Posts 3 Posters 0 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.
  • jens@social.finkhaeuser.deJ jens@social.finkhaeuser.de

    @trwnh You know, I understand what you're writing, but don't seem to get across what I mean. I'll step away from this. Maybe I'll figure out a different way to say it 🤷‍♂️

    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 last edited by
    #71

    @jens it's mostly this part:

    > it's only when you want to use LD to manipulate the entire document as a knowledge graph that you run into issues.

    which is incorrect, so there's still some miscommunication on my part.

    the issues occur when you use *JSON* to manipulate a *serialization*, like doing a find-and-replace on an English sentence resulting in nonsense.

    it's like a student says "I is..." and the teacher says, "no, it's *am*", so the student says "I am the ninth letter of the alphabet"

    trwnh@mastodon.socialT jens@social.finkhaeuser.deJ 2 Replies Last reply
    0
    • trwnh@mastodon.socialT trwnh@mastodon.social

      @jens it's mostly this part:

      > it's only when you want to use LD to manipulate the entire document as a knowledge graph that you run into issues.

      which is incorrect, so there's still some miscommunication on my part.

      the issues occur when you use *JSON* to manipulate a *serialization*, like doing a find-and-replace on an English sentence resulting in nonsense.

      it's like a student says "I is..." and the teacher says, "no, it's *am*", so the student says "I am the ninth letter of the alphabet"

      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 last edited by
      #72

      @jens i get a sense that we're looking at it from somewhat unrelated angles... like, you're saying

      > it should be part of the specifications of the key whether a string, array or object is *valid* here

      except they're all valid. we just can't constrain it any further. an `object` of an Activity is... the activity's object. this describes the activity but it doesn't describe its object

      so JSON semantics are fully defined, but there's still a higher level of semantics

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

        @jens i get a sense that we're looking at it from somewhat unrelated angles... like, you're saying

        > it should be part of the specifications of the key whether a string, array or object is *valid* here

        except they're all valid. we just can't constrain it any further. an `object` of an Activity is... the activity's object. this describes the activity but it doesn't describe its object

        so JSON semantics are fully defined, but there's still a higher level of semantics

        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 last edited by
        #73

        @jens that's all, really -- if we're going in circles then it probably isn't productive to continue, as you say.

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

          @jens it's mostly this part:

          > it's only when you want to use LD to manipulate the entire document as a knowledge graph that you run into issues.

          which is incorrect, so there's still some miscommunication on my part.

          the issues occur when you use *JSON* to manipulate a *serialization*, like doing a find-and-replace on an English sentence resulting in nonsense.

          it's like a student says "I is..." and the teacher says, "no, it's *am*", so the student says "I am the ninth letter of the alphabet"

          jens@social.finkhaeuser.deJ This user is from outside of this forum
          jens@social.finkhaeuser.deJ This user is from outside of this forum
          jens@social.finkhaeuser.de
          wrote last edited by
          #74

          @trwnh So we do arrive at it from two different points of view. That much is clear.

          What my impression is, is that you have a linked data type of model firmly in your head, and JSON-LD is compatible with that. A pure JSON processor won't understand that, and mess with things.

          What I'm trying to get across is that having the linked data model as a starting point when you *know* pure JSON processors will be involved is a mistake.

          You can still *use* LD, you just can't use it as a precondition.

          trwnh@mastodon.socialT 1 Reply Last reply
          0
          • jens@social.finkhaeuser.deJ jens@social.finkhaeuser.de

            @trwnh So we do arrive at it from two different points of view. That much is clear.

            What my impression is, is that you have a linked data type of model firmly in your head, and JSON-LD is compatible with that. A pure JSON processor won't understand that, and mess with things.

            What I'm trying to get across is that having the linked data model as a starting point when you *know* pure JSON processors will be involved is a mistake.

            You can still *use* LD, you just can't use it as a precondition.

            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 last edited by
            #75

            @jens i guess i don't really think "generic json processing" or "generic xml processing" really makes any sense. it's like trying to do "generic plaintext processing" or "generic octet stream processing". there should be *some* precondition of shared understanding; otherwise, communication breaks down. this understanding is baked into the application logic, media type, etc... and it always exists at least implicitly, although it can be explicitly described

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

              @jens i guess i don't really think "generic json processing" or "generic xml processing" really makes any sense. it's like trying to do "generic plaintext processing" or "generic octet stream processing". there should be *some* precondition of shared understanding; otherwise, communication breaks down. this understanding is baked into the application logic, media type, etc... and it always exists at least implicitly, although it can be explicitly described

              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 last edited by
              #76

              @jens so the goal of the thread was to take something like "i before e except after c" and extend it to account for edge cases: "or unless it's followed by an r or a g"

              the takeaway is basically "jsonld context authors should consider disabling propagation when using protected terms across semantic boundaries (like when merging two documents)"

              the alternative is to never do a JSON find-and-replace, and instead strictly process the two documents separately.

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

                @jens so the goal of the thread was to take something like "i before e except after c" and extend it to account for edge cases: "or unless it's followed by an r or a g"

                the takeaway is basically "jsonld context authors should consider disabling propagation when using protected terms across semantic boundaries (like when merging two documents)"

                the alternative is to never do a JSON find-and-replace, and instead strictly process the two documents separately.

                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 last edited by
                #77

                @jens

                basically this is fine:

                {"id": "foo", "actor": "i", "type": "Like", "object": "ghostbusters"}

                {"@\context": "schema.org", "id": "ghostbusters", "type": "Movie", "actor": "bill-murray"}

                and this would be problematic if activity+json used a protected context:

                {"id": "foo", "actor": "i", "type": "Like", "object": {"@\context": "schema.org", "id": "ghostbusters", "actor": "bill-murray"}}

                note that activity+json doesn't currently use a protected context... but arguably it does in spirit.

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

                  @jens

                  basically this is fine:

                  {"id": "foo", "actor": "i", "type": "Like", "object": "ghostbusters"}

                  {"@\context": "schema.org", "id": "ghostbusters", "type": "Movie", "actor": "bill-murray"}

                  and this would be problematic if activity+json used a protected context:

                  {"id": "foo", "actor": "i", "type": "Like", "object": {"@\context": "schema.org", "id": "ghostbusters", "actor": "bill-murray"}}

                  note that activity+json doesn't currently use a protected context... but arguably it does in spirit.

                  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 last edited by
                  #78

                  @jens of course combining the two documents is easy. it's splitting them apart that's challenging. like trying to separate two balls of differently colored play-doh.

                  the act of injecting movie.json (json, ld+json, hypothetically schemadotorg+json) into like.json (json, ld+json, activity+json) is impure wrt the resource <ghostbusters>. the semantics of activity+json are leaking in and through the semantic boundary of the original two resources.

                  so either plug the leak, or don't combine. right?

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

                    @jens of course combining the two documents is easy. it's splitting them apart that's challenging. like trying to separate two balls of differently colored play-doh.

                    the act of injecting movie.json (json, ld+json, hypothetically schemadotorg+json) into like.json (json, ld+json, activity+json) is impure wrt the resource <ghostbusters>. the semantics of activity+json are leaking in and through the semantic boundary of the original two resources.

                    so either plug the leak, or don't combine. right?

                    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 last edited by
                    #79

                    @jens well, people are combining anyway and not plugging the leak, because they don't know the leak is there.

                    it's like trying to fit two sections of a water pipe together, except instead of properly screwing them into a fitting, you just glue them together without the fitting.

                    ideally people would stop gluing together their pipes and use proper fittings instead, but at least i can scrape off the glue and use my own fitting, i guess?

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

                      @jens well, people are combining anyway and not plugging the leak, because they don't know the leak is there.

                      it's like trying to fit two sections of a water pipe together, except instead of properly screwing them into a fitting, you just glue them together without the fitting.

                      ideally people would stop gluing together their pipes and use proper fittings instead, but at least i can scrape off the glue and use my own fitting, i guess?

                      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 last edited by trwnh@mastodon.social
                      #80

                      @jens this is all from the angle of taking arbitrary JSON and "upgrading" it to JSONLD, sure, but even without JSONLD you are still doing the arithmetic in your head.

                      the same kinds of complexity issues exist for other media formats too. no one said building a web browser was easy!

                      /fin

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

                        @jens this is all from the angle of taking arbitrary JSON and "upgrading" it to JSONLD, sure, but even without JSONLD you are still doing the arithmetic in your head.

                        the same kinds of complexity issues exist for other media formats too. no one said building a web browser was easy!

                        /fin

                        jens@social.finkhaeuser.deJ This user is from outside of this forum
                        jens@social.finkhaeuser.deJ This user is from outside of this forum
                        jens@social.finkhaeuser.de
                        wrote last edited by
                        #81

                        @trwnh Again, though, ".actor" and ".object.actor" have different semantics, because of the semantics of ".object", so there really isn't a problem IMHO.

                        🤷‍♂️

                        trwnh@mastodon.socialT 1 Reply Last reply
                        0
                        • jens@social.finkhaeuser.deJ jens@social.finkhaeuser.de

                          @trwnh Again, though, ".actor" and ".object.actor" have different semantics, because of the semantics of ".object", so there really isn't a problem IMHO.

                          🤷‍♂️

                          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 last edited by
                          #82

                          @jens they can be the same semantics actually

                          id: foo
                          actor: i
                          type: Like
                          object:
                          id: bar
                          actor: you
                          type: Like
                          object: that

                          ".object" doesn't imply any semantics for <bar>, nor does it imply anything for ".object.actor" or any other properties. that's because <foo> and <bar> are in essence separate resources

                          it's semantically equivalent to saying

                          - id: foo
                          actor: i
                          type: Like
                          object: bar
                          - id: bar
                          actor: you
                          type: Like
                          object: that

                          only the serialization is different.

                          trwnh@mastodon.socialT jens@social.finkhaeuser.deJ 2 Replies Last reply
                          0
                          • trwnh@mastodon.socialT trwnh@mastodon.social

                            @jens they can be the same semantics actually

                            id: foo
                            actor: i
                            type: Like
                            object:
                            id: bar
                            actor: you
                            type: Like
                            object: that

                            ".object" doesn't imply any semantics for <bar>, nor does it imply anything for ".object.actor" or any other properties. that's because <foo> and <bar> are in essence separate resources

                            it's semantically equivalent to saying

                            - id: foo
                            actor: i
                            type: Like
                            object: bar
                            - id: bar
                            actor: you
                            type: Like
                            object: that

                            only the serialization is different.

                            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 last edited by
                            #83

                            @jens (in jsonld this is the difference between compacted form and flattened form)

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

                              @jens (in jsonld this is the difference between compacted form and flattened form)

                              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 last edited by
                              #84

                              @jens i am guessing the disconnect is that when you say "semantics" you are including what i would split out as "serialization" and/or "syntax"?

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

                                @jens they can be the same semantics actually

                                id: foo
                                actor: i
                                type: Like
                                object:
                                id: bar
                                actor: you
                                type: Like
                                object: that

                                ".object" doesn't imply any semantics for <bar>, nor does it imply anything for ".object.actor" or any other properties. that's because <foo> and <bar> are in essence separate resources

                                it's semantically equivalent to saying

                                - id: foo
                                actor: i
                                type: Like
                                object: bar
                                - id: bar
                                actor: you
                                type: Like
                                object: that

                                only the serialization is different.

                                jens@social.finkhaeuser.deJ This user is from outside of this forum
                                jens@social.finkhaeuser.deJ This user is from outside of this forum
                                jens@social.finkhaeuser.de
                                wrote last edited by
                                #85

                                @trwnh Again: this is *only* the case if your mental model is LD. That is what I keep trying to get across.

                                If your mental model is "structured data", then you *cannot* assume two different structures have the same semantics.

                                You want to make LD "safe" for structured data processors. That is only going to happen, IMHO, if you accept how structured data processors deal with semantics.

                                Instead, you seem to complain that structured data processors aren't linked data processors.

                                I don't want...

                                jens@social.finkhaeuser.deJ 1 Reply Last reply
                                0
                                • jens@social.finkhaeuser.deJ jens@social.finkhaeuser.de

                                  @trwnh Again: this is *only* the case if your mental model is LD. That is what I keep trying to get across.

                                  If your mental model is "structured data", then you *cannot* assume two different structures have the same semantics.

                                  You want to make LD "safe" for structured data processors. That is only going to happen, IMHO, if you accept how structured data processors deal with semantics.

                                  Instead, you seem to complain that structured data processors aren't linked data processors.

                                  I don't want...

                                  jens@social.finkhaeuser.deJ This user is from outside of this forum
                                  jens@social.finkhaeuser.deJ This user is from outside of this forum
                                  jens@social.finkhaeuser.de
                                  wrote last edited by
                                  #86

                                  @trwnh ... to offend you, quite the contrary! But this really isn't going to work, and I am trying my best to get you to understand that.

                                  JSON is just a serialization format from an LD perspective. But from a JSON perspective, LD is just payload; semantics derive from position within the structured data (and specs relating to those positions).

                                  To make JSON-LD compatible with JSON processors is to embrace the structured data model.

                                  jens@social.finkhaeuser.deJ 1 Reply Last reply
                                  0
                                  • jens@social.finkhaeuser.deJ jens@social.finkhaeuser.de

                                    @trwnh ... to offend you, quite the contrary! But this really isn't going to work, and I am trying my best to get you to understand that.

                                    JSON is just a serialization format from an LD perspective. But from a JSON perspective, LD is just payload; semantics derive from position within the structured data (and specs relating to those positions).

                                    To make JSON-LD compatible with JSON processors is to embrace the structured data model.

                                    jens@social.finkhaeuser.deJ This user is from outside of this forum
                                    jens@social.finkhaeuser.deJ This user is from outside of this forum
                                    jens@social.finkhaeuser.de
                                    wrote last edited by
                                    #87

                                    @trwnh Or to go back to a previous phrasing: you think in terms of knowledge graphs. In JSON, the graph *is* the structure of the serialization.

                                    You cannot make JSON understand a knowledge graph *unless* you map it into the graph structure that JSON understands. Anything else is futile.

                                    trwnh@mastodon.socialT 1 Reply Last reply
                                    0
                                    • jens@social.finkhaeuser.deJ jens@social.finkhaeuser.de

                                      @trwnh Or to go back to a previous phrasing: you think in terms of knowledge graphs. In JSON, the graph *is* the structure of the serialization.

                                      You cannot make JSON understand a knowledge graph *unless* you map it into the graph structure that JSON understands. Anything else is futile.

                                      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 last edited by
                                      #88

                                      @jens i’m not “complaining”, and it’s not even about LD per se; it’s about the boundary between resources. what you call “two different structures” can be combined without regard for semantics. i just want to preserve semantics.

                                      if the JSON vs JSONLD thing is tripping you up, then consider an example where someone dumps the json to a plaintext string and tries to do an even more naive string find-and-replace. or consider an example where someone manipulates the raw bytes

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

                                        @jens i’m not “complaining”, and it’s not even about LD per se; it’s about the boundary between resources. what you call “two different structures” can be combined without regard for semantics. i just want to preserve semantics.

                                        if the JSON vs JSONLD thing is tripping you up, then consider an example where someone dumps the json to a plaintext string and tries to do an even more naive string find-and-replace. or consider an example where someone manipulates the raw bytes

                                        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 last edited by
                                        #89

                                        @jens no offense taken, btw!

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

                                          @jens no offense taken, btw!

                                          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 last edited by
                                          #90

                                          @jens if the argument is “they can’t be combined while preserving JSONLD semantics”, i would argue that they can. if anything, they can’t be combined while preserving *JSON* semantics, because nesting a JSON object under a certain key in the document fundamentally alters the semantics of that nested object (if i understand you correctly)

                                          trwnh@mastodon.socialT 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