ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. dreamreal XML is not slow to parse
  2. dreamreal nor does it use a lot of memory
  3. dreamreal it *can* but it doesn't unless you choose options to create that situation (slow to parse is harder to do: it's pretty quick to parse. But you CAN make it chew through a TON of memory.)
  4. dreamreal And as far as a DTD/XSD... eh, free-form can have value, but you really see it pay off with a DTD/XSD if you need to know the structure is compliant
  5. cheeser kneel before xom!
  6. jreicher In all seriousness, is it still XML if there's no schema? I'm interested in the "philosophical" aspect of that.
  7. dreamreal XOM is quite good
  8. dreamreal jreicher: sure
  9. dreamreal it's still structured, still walkable, still graphable, just not compliant with a known structure
  10. deebo we used to run several companies ecommerce on xml + xslt integrations, it's fast enough :)
  11. deebo did you know you can do jdbc in xslt!
  12. Para XML compresses really well, btw.
  13. jreicher Not necessarily a point in its favour, you know. :p
  14. dreamreal Sure, but it's not one NOT in its favor: if you're trying to put down XML, it's not difficult to do. It IS very verbose; DOM sucks but makes sense in context; namespaces are great, *verifiability* is great, encoding is still textual in nature for the most part
  15. jreicher Honestly, I do not hate XML at all. But I wonder why it's both a serialisation format and... other things.
  16. dreamreal What do you mean? It's a serialization format because it contains regular data that can be annotated, verified, and expanded upon with namespaces.
  17. jreicher In all honesty I'm not sure I know what I mean. If it's only serialisation, why would it need a schema?
  18. dreamreal Right. But it's not: it's an extensible markup language, which is where "XML" in the name comes from
  19. jreicher I've always really struggled to wrap my head around the part the schema plays. I have some thoughts, but it never seems to be what people do.
  20. jreicher Well, that's what i mean by "other things". Sometimes it's not just serialisation.
  21. dreamreal Well, suppose you have a file representing something: <?xml version="1.0"?><person><name><first>Jack</first><last>Frinkmanhoppergoodstein</last></name></person> -- does that represent a person?
  22. dreamreal The JSON equivalent is {"name":{"first":"jack", "last": "frink"}} of course
  23. [twisti] we have a schema that does (weak, obviously) constraints, and i dont know how to feel about that
  24. dreamreal We have a schema that does *exact* constraints, and it's hard to break :D
  25. [twisti] like, it has min/max stuff, and that actually has caught stuff in production and prevented bad data from spreading. but in the end, it means we maintain at least two different sets of constraints (because some constraints cant be expressed in schema, like min/max of something depending on the content of something else) and sometimes they drift
  26. dreamreal [twisti]: yeah, what YOU have is more than data, it's an ontology
  27. [twisti] that is json schema for us, not xml, obviously xml is more powerful in that regard, though i dont think its turing complete either, right ?
  28. dreamreal XML itself is not, no
  29. dreamreal like I said, what you have is an ontology: you wouldn't use XML/XSD for that, you'd use XML/XSD/OWL
  30. dreamreal You wouldn't HAVE to use XML for it, OWL can leverage other formats like turtle, etc
  31. [twisti] not enough xml in my world to know my way around there; we have validation on code level, and the json schema acts like an additional net
  32. dreamreal but what you're talking about is reasoning, data relationships, not a shadowbox: XSD is a shadowbox, OWL is "does this data make sense as a whole"
  33. dreamreal (shadowbox: "is this data rabbit-shaped?" OWL: "does this data match the definition of a rabbit?")
  34. [twisti] i guess that makes sense, though i feel reluctant to fully agree - we are still talking about single objects, not multiple objects interacting. the check i was talking about was object level consistency (i.e. we deal with road stuff, so one check is 'does amount of lanes make sense in combination with road class - 'highway' with 6 lanes makes sense, 'footpath' or 'inner city road' does not, but the latter might still have up to 3 lanes)
  35. dreamreal https://bytecode.news/posts/2026/05/from-stringly-to-strongly-typed-refined-design
  36. dreamreal That would be an ontology, yes, but a simple one
  37. [twisti] ill read up when i next need to procrastinate :D
  38. dreamreal :( It's actually pretty appropriate for what you're describing
  39. [twisti] unfortunately the girlfriend is coming over and my place is a pigsty, so technically, im procrastinating right now, so i have to take off
  40. dreamreal Definitely, enjoy
  41. [twisti] thanks for the link, i didnt mean it to sound deprecating if thats how it came over
  42. dreamreal It did not
  43. dreamreal If I ever want to get a party shut down I'll start talking about ontologies, peoples' eyes glaze over and they're like "oh look it's 7:45 already, time to shut everything down, so tired, good evening, please shut the door behind you, everyone else can stay"
  44. jreicher What do you feel an ontology is in practice? (I really do know what an ontology is, but this aspect is something more specific)
  45. dreamreal I think they're horrifically underused, mostly because A) they're scary for most people and 2) (related to A) they're hard to use
  46. dreamreal and D) nobody really cares all that much since it's easy to add code to enforce an ontology's rules without having to invest in a reasoner and the understanding to use it and intepret it
  47. dreamreal i.e., "I have a road, I don't care if it's a highway or not ontologically speaking, it says it's a highway, I'll just add code to make sure it has N lanes"
  48. jreicher But how do you think it works in practice?
  49. jreicher The most obvious interpretation is "classes are nouns", but that's probably not correct.
  50. dreamreal people rarely think in ontologies explicitly: they see something turtle-shaped, they think it's a turtle, they're not going "oh is that a tortoise or a turtle" - and thus they see paleontologists, people going "oh that's not a t-rex, the forelimb for a t-rex is variegated along these lines," as being really wonky
  51. dreamreal no, it's more like "is this is a valid X because X has these characteristics and this has THESE characteristics"
  52. jreicher So how do you find your ontology?
  53. dreamreal find?
  54. dreamreal An ontology is built, not found
  55. jreicher OK, that's saying something.
  56. jreicher So the schema records that construction also?
  57. dreamreal The SCHEMA does not, no
  58. dreamreal the schema records the input for an ontology
  59. dreamreal you have data in some form, and an ontology is a dataset that describes what that data is and what conclusions can be drawn from it
  60. jreicher OK. I'm struggling a bit to understand what you mean by "input" for that, as it's not a function...
  61. dreamreal sure it is
  62. jreicher It's a description. You just said that.
  63. dreamreal okay, so: imagine a person. Is a person a terminator?
  64. dreamreal An ontology yields a description
  65. jreicher Yes, but a description is not a function AFAICT.
  66. dreamreal like, from the terminator movies. If you're unfamiliar, give me a context and I'll try to figure out a better example.
  67. dreamreal A description isn't a function, but an ontology is a data set fed to a reasoner, a reasoner has a query function and yields descriptions
  68. jreicher Well, let's use the example you started earlier. I have a Person class, and to keep it simple it contains just the name. How does that relate to a schema?
  69. dreamreal Hah, picking up a cold ball, are we
  70. dreamreal Okay, a CLASS and a FILE are different things
  71. dreamreal I was describing an XML file and a JSON equivalent
  72. dreamreal And I was going to point out that it LOOKS like a simple expression of a person... but a *schema* might say "a person has a name, a name is made of a first and last word, and a person has a birthdate"
  73. dreamreal which means NEITHER ONE of those files represents a person
  74. dreamreal WB, dunno what you saw last
  75. jreicher I think you and I have the same understanding of an ontology, but I don't think I understand what your ideas about the relationship between schema and ontology.
  76. dreamreal schema is a data-level validation of presence and simple values
  77. jreicher I've checked.
  78. dreamreal a schema struggles to say "this player is a halfling, being humanoid and standing 2m tall, and is a paladin" because it can record humanoid construction, player class as "paladin", and height between 0.7m and 2.3m, but struggles to say "no, wait, this height and this player race and this class don't mix"
  79. dreamreal an ontology has no issues with the latter
  80. dreamreal it wouldn't PREVENT such a player, but would be able to say "this player's construction is an aberration"
  81. jreicher Hmm. Let me put this a different way. We were talking about schemas. You mentioned ontology. I'm trying to understand why you took the conversation in that direction.
  82. dreamreal "this country road, unpaved, has seven lanes going in each direction, which is an odd definition for a country road"
  83. dreamreal a SCHEMA says "a thing has these elements, and these elements have these simple definitions" and an ontology can suggest whether those relationships are valid
  84. dreamreal if you're saying "this field can have THESE values" a schema is apt. If you're saying "this field and THAT field over there have these acceptable ranges in coordination with each other" that's an ontology.
  85. dreamreal Most people express ontologies in code rather than in AN ONTOLOGY, because ontologies are wierd and hard to use and hard to build.
  86. dreamreal We were originally talking about XML and namespaces and schema, and nobody answered the questions I was actually asking so it veered off
  87. jreicher I think you're saying an ontology will be modelled in a particular language's type system, and checked accordingly, and an equivalent ontology might be modelled in a different language, and checked differently, and schema validation in the ideal case might be the high common denominator for what can be checked for both? Something like that?
  88. dreamreal not really. A schema is useful for saying what valid input is. an ontology is useful for saying "this schema's data represents this definition properly."
  89. jreicher What's the difference?
  90. jreicher You don't have data without input
  91. dreamreal If you had a person object, you could say "this person's data is person-shaped" by a schema: it has a name, a birth date, gender, etc etc etc, but an ontology could tell you whether that person was a fireman, a doctor, a teacher, or perhaps all three
  92. jreicher Why couldn't a sufficiently rich schema system tell you just as much as the ontology?
  93. dreamreal Well, go back to that XML thing
  94. dreamreal It depends on the nature of the schema! I keep bringing up examples and you keep not interacting with them
  95. dreamreal but I actually bring them up to observe them
  96. jreicher Because I'm trying to figure what's inherent to the nature of "schema", rather than a particular schema system.
  97. jreicher Put another way, I'm trying to figure out the difference between schema validation and type checking.
  98. dreamreal Well, the examples are meant to illustrate aspects to make their nature more clear
  99. dreamreal scope
  100. dreamreal schema validation means type checking of each field and its presence or negation
  101. dreamreal type checking is for a field; schema is for a set of fields; ontology is for the relationship of fields in a schema
  102. jreicher You don't think a sufficiently expressive schema could check relationships?
  103. dreamreal I was going to say that <person> xml thing wasn't a person at all, because the schema might say a person has a name and a birth date, but you flew past it. :D
  104. dreamreal I know it can't.
  105. jreicher Why not? I'm not contesting it, but I don't understand why it's a foregone conclusion.
  106. dreamreal Again, I keep bringing up examples :D
  107. dreamreal Okay, describe a D&D player character. Or a terminator.
  108. dreamreal Or a car. Or a book. I don't know, pick a freaking thing of interest to you, I'll figure something out, but if it's not of interest to you, you'll ignore the example again
  109. jreicher I'm not ignoring any examples. I just can't figure out how to use them to resolve my confusion. I'm happy with any example you choose.
  110. dreamreal I've tried D&D, action movies, biology, census data, all flew over
  111. dreamreal Well, pick one anyway
  112. jreicher Car
  113. jreicher I'm traditional
  114. dreamreal Okay, what is a car?
  115. jreicher For now, let's say it's an object composed of a chassis, engine, and four wheels
  116. dreamreal Okay. Describe one in data: XML, json, doesn't matter
  117. dreamreal <thing hasChassis="true" hasEngine="true" wheelCount="4" /> ?
  118. jreicher OK
  119. dreamreal How would a truck look?
  120. jreicher Same, but also with a trailer
  121. dreamreal A truck has a trailer? Mine doesn't
  122. dreamreal Anyway, type validation says "hasChassis" can be either "true" or "false"
  123. jreicher I'm not really fussed at the definition. I just came up with an arbitrary extension.
  124. jreicher OK
  125. dreamreal and a "thing" in this context CAN HAVE attributes like hasChassis, hasEngine, wheelCount
  126. jreicher OK
  127. dreamreal I'm working with your examples!
  128. jreicher I understand that, but I don't know what's required to answer my question.
  129. dreamreal So field validation says wheelcount is integral or null (it might be a tank and not have wheels!) and those has* are "true" or "false" or not present
  130. dreamreal and "hasTrailer" is indeed a candidate for a truck, but a truck might also have a flat bed
  131. jreicher That's what field validation says for a particular kind of schema system. Why are we sure there isn't a richer kind of field validation available in a different system?
  132. dreamreal so "a truck" is defined as "a thing" with at least four wheels, and EITHER a bed OR a trailer
  133. dreamreal jreicher: we are sure there IS a richer kind of field validation
  134. dreamreal it's an ontology
  135. jreicher OK, let me ask the question really weirdly. Can we have an XML document with "ontology validation"?
  136. dreamreal not with the formal definition of an XML file, no. It has a spec; the spec precludes ontological inference.
  137. jreicher But we can imagine a different kind for serialisation format that might admit this kind of validation?
  138. dreamreal an XML file has a structural specification (the SGML spec, which includes schema specifications)
  139. dreamreal sure: it's an ontology
  140. jreicher Perfect. I think that answers my question.
  141. dreamreal You keep asking for the thing that's right there
  142. dreamreal <thing hasWheels="2" hasBed="true" hasChassis="true" hasEngine="true" /> is a truck, yeah?
  143. dreamreal It has a bed, it has wheels, it has an engine...
  144. jreicher I'm OK with that
  145. * dreamreal thinks that would be a very strange truck, personally
  146. dreamreal maybe a sort of ATV, but for stability you'd want three wheels, not two
  147. dreamreal in code, you'd load that object and have some kind of validation to make sure the data made sense
  148. dreamreal but that's exactly what an ontology does; it'd be way easier to do it in code, though, and way faster
  149. Para Remember to spend your tokens, kids, month is going to change and token costs will skyrocket in all subscriptions.
  150. dreamreal or thank your past selves for buying a machine you can run a model on locally :D
  151. Para I'm going to add picture of my 64GB DDR5 to my Tinder profile.
  152. Chronos Para: LOL :D
  153. sweatiest FY2026 Q3 it all goes tits up, we got a month left
  154. sweatiest Para: not next month, but in July
  155. Para Good thing I'm European, I'll be vacationing then.
  156. Para I can come back to chaos with fresh mind!
  157. Drixtan sweatiest: what is happening in 2026 Q3? We are all out of job (from all the previous predictions 12-18 months ago by then) ?
  158. sweatiest earnings reports
  159. sweatiest post spacex IPO
  160. Drixtan ah, those apocalypses, I can't follow all of them, my bad.
  161. Para your apocalypse stack is full
  162. jbosmans clearly, i missed a bunch and or a whole lot
  163. jbosmans k, something about motorized vehicles vs XML
  164. jbosmans 'nuff said
  165. danba9 jer