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 ... it felt like less of a bother. It also meant implementation complexity went back to SGML levels, and now only Google has the resources to develop a browser engine.

    SOAP was a different beast. It was permissive in a way that let vendor extensions proliferate, but the way it happened was that, essentially, SOAP from one vendor was incompatible with that from another. Frustrated, the community proposed XML-RPC, which is also permissive, but embraced simplicity at the same time.

    ...

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

    @trwnh Then JSON came along, making working with JS a lot easier, but the fundamental model of sending JSON around is very, very similar to how XML-RPC handled it.

    JSON-LD provides much the same "feel" as SOAP. Yes, there's more clarity in it. But it comes at a complexity cost that also allows for abuse. And in that sense, the XHTML/HTML5 story is the same ad the SOAP story, is the same (almost) as the JSON-LD story:

    Clarity (avoiding ambiguity) is what people wish for, complexity is not.

    ...

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

      @trwnh Then JSON came along, making working with JS a lot easier, but the fundamental model of sending JSON around is very, very similar to how XML-RPC handled it.

      JSON-LD provides much the same "feel" as SOAP. Yes, there's more clarity in it. But it comes at a complexity cost that also allows for abuse. And in that sense, the XHTML/HTML5 story is the same ad the SOAP story, is the same (almost) as the JSON-LD story:

      Clarity (avoiding ambiguity) is what people wish for, complexity is not.

      ...

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

      @trwnh Arguably, that specific combination does not exist yet, so people keep proposing namespaces as a simple yet effective alternative.

      FWIW there's a related issue with the back and forth between "use schemata to generate code" vs. "use code to generate schemata".

      Schema first approaches provide clarity. But code generation means that schema changes overwrite code, which you may have modified. So that's unpleasant to deal with. In the past, frameworks often suggested an indirection ...

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

        @trwnh Arguably, that specific combination does not exist yet, so people keep proposing namespaces as a simple yet effective alternative.

        FWIW there's a related issue with the back and forth between "use schemata to generate code" vs. "use code to generate schemata".

        Schema first approaches provide clarity. But code generation means that schema changes overwrite code, which you may have modified. So that's unpleasant to deal with. In the past, frameworks often suggested an indirection ...

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

        @trwnh ... layer, which avoids that issue, but then you have two layers to maintain compatibility between. Not fun.

        OoenAPI started out solving that, it was schema first, but didn't generate code. Instead it let you tag your schema in a way that an API framework could use to map between your implementation and the schema. It still requires adjustment, but it's less disruptive.

        Now modern API frameworks have gone the opposite direction again and generate schemata from code, which shifts the...

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

          @trwnh ... layer, which avoids that issue, but then you have two layers to maintain compatibility between. Not fun.

          OoenAPI started out solving that, it was schema first, but didn't generate code. Instead it let you tag your schema in a way that an API framework could use to map between your implementation and the schema. It still requires adjustment, but it's less disruptive.

          Now modern API frameworks have gone the opposite direction again and generate schemata from code, which shifts the...

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

          @trwnh ... maintenance burden onto the consumer of the API. Personally, I think that is very stupid: schemata are contracts, and unilaterally breaking them invites pain. But here we are.

          Nonetheless, even though this detour has strayed a bit from the OT, the point remains that devs seek clarity *and* simplicity (which provides for its own kind of clarity), and that's a difficult balance to strike.

          But if you don't, chances are it'll get worse before it gets better.

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

            @trwnh ... maintenance burden onto the consumer of the API. Personally, I think that is very stupid: schemata are contracts, and unilaterally breaking them invites pain. But here we are.

            Nonetheless, even though this detour has strayed a bit from the OT, the point remains that devs seek clarity *and* simplicity (which provides for its own kind of clarity), and that's a difficult balance to strike.

            But if you don't, chances are it'll get worse before it gets better.

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

            @jens i think you read a bit too much "problem" into what i wrote; i was trying to formulate a way for graph-unaware consumers to do graph merges "properly", i.e. without introducing errors. namespaces alone don't really solve that; it's the *propagation of context* that is introducing issues. a context-unaware consumer might assume their context applies everywhere, even for resources where it doesn't. in xml terms, it's like changing the default namespace (xmlns), not really any prefix stuff.

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

              @jens i think you read a bit too much "problem" into what i wrote; i was trying to formulate a way for graph-unaware consumers to do graph merges "properly", i.e. without introducing errors. namespaces alone don't really solve that; it's the *propagation of context* that is introducing issues. a context-unaware consumer might assume their context applies everywhere, even for resources where it doesn't. in xml terms, it's like changing the default namespace (xmlns), not really any prefix stuff.

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

              @jens basically, the issue is how do we maintain "well-formedness" of the LD when an LD-unaware processor starts to mutate and manipulate the graph while not treating it as a graph.

              it's less of a problem in the xml ecosystem because you generally expect xml processors to already understand namespaces. and also in the xml world, namespaces don't carry any semantic information; they're just a way to prefix things more efficiently. for jsonld, this would be like only defining prefix terms.

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

                @jens i think you read a bit too much "problem" into what i wrote; i was trying to formulate a way for graph-unaware consumers to do graph merges "properly", i.e. without introducing errors. namespaces alone don't really solve that; it's the *propagation of context* that is introducing issues. a context-unaware consumer might assume their context applies everywhere, even for resources where it doesn't. in xml terms, it's like changing the default namespace (xmlns), not really any prefix stuff.

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

                @trwnh Namespaces don't solve this? You lost me there, sorry. Could you explain that?

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

                  @jens basically, the issue is how do we maintain "well-formedness" of the LD when an LD-unaware processor starts to mutate and manipulate the graph while not treating it as a graph.

                  it's less of a problem in the xml ecosystem because you generally expect xml processors to already understand namespaces. and also in the xml world, namespaces don't carry any semantic information; they're just a way to prefix things more efficiently. for jsonld, this would be like only defining prefix terms.

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

                  @jens we are less concerned with schematic validation; we are more concerned with semantic confusion. we don't stop at knowing the difference between as:actor and schema:actor; we also want to know that the value is a Thing and not a String, i.e. that it is a reference and not a literal.

                  really, the complexity of jsonld processing is less to do with the actual LD and more to do with the ability to take arbitrarily complex JSON and still interpret it as a semantic graph.

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

                    @jens basically, the issue is how do we maintain "well-formedness" of the LD when an LD-unaware processor starts to mutate and manipulate the graph while not treating it as a graph.

                    it's less of a problem in the xml ecosystem because you generally expect xml processors to already understand namespaces. and also in the xml world, namespaces don't carry any semantic information; they're just a way to prefix things more efficiently. for jsonld, this would be like only defining prefix terms.

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

                    @trwnh Again, lost me. XML namespaces don't carry semantic information how?

                    I *think* I know what you mean, but if so, I might disagree. Can't be sure, though 🤷‍♂️

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

                      @jens we are less concerned with schematic validation; we are more concerned with semantic confusion. we don't stop at knowing the difference between as:actor and schema:actor; we also want to know that the value is a Thing and not a String, i.e. that it is a reference and not a literal.

                      really, the complexity of jsonld processing is less to do with the actual LD and more to do with the ability to take arbitrarily complex JSON and still interpret it as a semantic graph.

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

                      @jens really, the challenge is that people produce all kinds of "bad JSON", because of poor data models, lots of indirection, etc. -- it can be complex to unravel all those bad practices and get the true simple meaning out of the soup.

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

                        @jens really, the challenge is that people produce all kinds of "bad JSON", because of poor data models, lots of indirection, etc. -- it can be complex to unravel all those bad practices and get the true simple meaning out of the soup.

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

                        @trwnh Sure. But you're not going to avoid that. People will always be people.

                        You need a way to keep one bad data model from not interfering with another. Anything else becomes tilting at windmills IMHO.

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

                          @trwnh Namespaces don't solve this? You lost me there, sorry. Could you explain that?

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

                          @jens namespaces are only a solution for people willing to deal with namespaces. there are JSON consumers who don't understand namespacing at all. the JSONLD context qualifies a term like `actor` to be as:actor or schema:actor or whatever, but the naive JSON consumer is looking for the literal key `actor` *without expanding to the full IRI*.

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

                            @trwnh Again, lost me. XML namespaces don't carry semantic information how?

                            I *think* I know what you mean, but if so, I might disagree. Can't be sure, though 🤷‍♂️

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

                            @jens XML namespaces are a simple prefix mechanism, just like JSONLD can be used as a simple prefix mechanism if you only use simple term definitions to define prefixes

                            but the full context is more than that. you take `actor` and you can expand to `http://schema.org/actor` and that's where namespaces stop. you still need to know whether the value is a string literal or a reference to something else on the graph.

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

                              @jens XML namespaces are a simple prefix mechanism, just like JSONLD can be used as a simple prefix mechanism if you only use simple term definitions to define prefixes

                              but the full context is more than that. you take `actor` and you can expand to `http://schema.org/actor` and that's where namespaces stop. you still need to know whether the value is a string literal or a reference to something else on the graph.

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

                              @trwnh Correct.

                              But a naive consumer can (and should) simply not process namespaces they don't understand.

                              I think you may need to let go a little of what namespaces mean in JSON-LD, and consider what they mean elsewhere.

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

                                @trwnh Sure. But you're not going to avoid that. People will always be people.

                                You need a way to keep one bad data model from not interfering with another. Anything else becomes tilting at windmills 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
                                #29

                                @jens that's the goal of the thread 🙂

                                the LD agent sees the graph as a graph, but the JSON agent sees the graph as a JSON document. it might understand that a certain value is actually a reference, but then how can it dereference?

                                the LD agent does a graph merge. no problems.

                                the JSON agent fetches a JSON document and naively sets that JSON object as the value of the property to be expanded. oops, problems! you might have just accidentally redefined a term from the parent document!

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

                                  @jens that's the goal of the thread 🙂

                                  the LD agent sees the graph as a graph, but the JSON agent sees the graph as a JSON document. it might understand that a certain value is actually a reference, but then how can it dereference?

                                  the LD agent does a graph merge. no problems.

                                  the JSON agent fetches a JSON document and naively sets that JSON object as the value of the property to be expanded. oops, problems! you might have just accidentally redefined a term from the parent document!

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

                                  @trwnh What I mean is, don't do LD. Problem solved.

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

                                    @trwnh Correct.

                                    But a naive consumer can (and should) simply not process namespaces they don't understand.

                                    I think you may need to let go a little of what namespaces mean in JSON-LD, and consider what they mean elsewhere.

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

                                    @jens the problem is that terms conflict, and the naive consumer isn't "simply not process[ing] namespaces they don't understand" -- they straight up don't understand the concept of namespacing.

                                    this is a problem because they will then perform data manipulations that cause all kinds of semantic hell, completely unaware that they are doing anything wrong.

                                    they don't understand that `actor` can mean two different things. for all they know, `actor` ALWAYS means as:actor, even when it doesn't!

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

                                      @jens the problem is that terms conflict, and the naive consumer isn't "simply not process[ing] namespaces they don't understand" -- they straight up don't understand the concept of namespacing.

                                      this is a problem because they will then perform data manipulations that cause all kinds of semantic hell, completely unaware that they are doing anything wrong.

                                      they don't understand that `actor` can mean two different things. for all they know, `actor` ALWAYS means as:actor, even when it doesn't!

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

                                      @jens i need to stress that the JSON agent is, in this case, creating the problem where there wasn't a problem before.

                                      as two separate JSON documents, all is fine and dandy.

                                      it's when you naively merge the two JSON documents that you might accidentally produce a resulting document that has errors. this merging is foundational for Web use-cases.

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

                                        @jens the problem is that terms conflict, and the naive consumer isn't "simply not process[ing] namespaces they don't understand" -- they straight up don't understand the concept of namespacing.

                                        this is a problem because they will then perform data manipulations that cause all kinds of semantic hell, completely unaware that they are doing anything wrong.

                                        they don't understand that `actor` can mean two different things. for all they know, `actor` ALWAYS means as:actor, even when it doesn't!

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

                                        @trwnh You're still in LD headspace.

                                        In basic namespace headspace, "actor" doesn't exist. It's either e.g. "as:actor", which the consumer may understand (should in the context of AS), or it's "foo:actor", which the consumer doesn't understand and doesn't process.

                                        Keep in mind that MIME has existed for decades, and was used in Email *and* HTTP (Until the QUIC crowd forked it [TL;DR]) with this simple a scheme for headers, and there was no semantic ambiguity here.

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

                                          @trwnh What I mean is, don't do LD. Problem solved.

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

                                          @jens no, i want to do LD because i want to be able to fetch documents over the Web and reason about things. the LD agent knows what it's doing and doesn't cause problems.

                                          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