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

                                @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 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
                                #91

                                @jens the mere act of nesting erases the boundary between parent and child; the parent’s semantics always override whatever semantics the child had.

                                is that correct?

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

                                  @jens the mere act of nesting erases the boundary between parent and child; the parent’s semantics always override whatever semantics the child had.

                                  is that correct?

                                  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
                                  #92

                                  @trwnh It's a weirdly LD way of putting it.

                                  In what I call structured data now, the semantics are derived from the position in the data graph, i.e. the structure, and whichever definitions are associated with this structure.

                                  If we take e.g. https://schema.org/Person 's example 4, ".children.name" has semantics derived from the fact that ".children" has the definition "must also be a Person", not because ".children.@type" has a value of "Person". That field is, from a structured data point of...

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

                                    @trwnh It's a weirdly LD way of putting it.

                                    In what I call structured data now, the semantics are derived from the position in the data graph, i.e. the structure, and whichever definitions are associated with this structure.

                                    If we take e.g. https://schema.org/Person 's example 4, ".children.name" has semantics derived from the fact that ".children" has the definition "must also be a Person", not because ".children.@type" has a value of "Person". That field is, from a structured data point of...

                                    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
                                    #93

                                    @trwnh ... view, pretty much superfluous.

                                    It's not *entirely* superfluous if you consider that Any or Variant definitions may exist, in which case you need sole type specifier. But it's superfluous in this case, because the textual definition of the meaning of ".children" is unambiguous: https://schema.org/children

                                    The contained object must be Person.

                                    So rather than saying that the parent *overrides*, it's better to state that the parent determines what is permissable.

                                    But that also means...

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

                                      @trwnh ... view, pretty much superfluous.

                                      It's not *entirely* superfluous if you consider that Any or Variant definitions may exist, in which case you need sole type specifier. But it's superfluous in this case, because the textual definition of the meaning of ".children" is unambiguous: https://schema.org/children

                                      The contained object must be Person.

                                      So rather than saying that the parent *overrides*, it's better to state that the parent determines what is permissable.

                                      But that also means...

                                      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
                                      #94

                                      @trwnh ... that ".children" and ".follows" do not have the same semantics. Yes, the specs both state they're Person, but those aren't the semantics really. The semantics are that one Person is a child of the enclosing Person, and the other is a "uni-directional social relation" (https://schema.org/follows).

                                      So moving those objects elsewhere in the graph modifies the semantics.

                                      This is what LD doesn't really "get", because the knowledge graph is built (can be built) out of a flat list of triplets.

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

                                        @trwnh ... that ".children" and ".follows" do not have the same semantics. Yes, the specs both state they're Person, but those aren't the semantics really. The semantics are that one Person is a child of the enclosing Person, and the other is a "uni-directional social relation" (https://schema.org/follows).

                                        So moving those objects elsewhere in the graph modifies the semantics.

                                        This is what LD doesn't really "get", because the knowledge graph is built (can be built) out of a flat list of triplets.

                                        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
                                        #95

                                        @trwnh Structured data is never this "flat", the structure is the semantics and vice versa.

                                        So, by assuming the JSON representation is arbitrarily malleable, you're breaking the structured data model.

                                        You can argue that sucks, FWIW, but it's nonetheless the case for all structured data: JSON, YAML, TOML, XML, SGML, CBOR, all of those (more or less) follow the structured data model (attributes in XML/SGML and to a lesser degree YAML have additional structural properties, sure).

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

                                          @trwnh Structured data is never this "flat", the structure is the semantics and vice versa.

                                          So, by assuming the JSON representation is arbitrarily malleable, you're breaking the structured data model.

                                          You can argue that sucks, FWIW, but it's nonetheless the case for all structured data: JSON, YAML, TOML, XML, SGML, CBOR, all of those (more or less) follow the structured data model (attributes in XML/SGML and to a lesser degree YAML have additional structural properties, sure).

                                          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
                                          #96

                                          @jens even without LD you'd still have issues if you applied plaintext merging rules on json objects dumped to strings, which is the equivalent operation at a lower level.

                                          the thing is, in the example you give, you're staying within the schema.org vocabulary, and you're also looking at it purely from the lens of the root object (the Person that is the parent). i'm looking at it from the lens of the nested object.

                                          if a Person's child is also a Person, then can't that child also have children?

                                          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