ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. * kathadris joined #java
  2. * graves joined #java
  3. * kcomhnall joined #java
  4. * szkl joined #java
  5. dreamreal XML is not slow to parse
  6. dreamreal nor does it use a lot of memory
  7. 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.)
  8. 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
  9. cheeser kneel before xom!
  10. jreicher In all seriousness, is it still XML if there's no schema? I'm interested in the "philosophical" aspect of that.
  11. dreamreal XOM is quite good
  12. dreamreal jreicher: sure
  13. dreamreal it's still structured, still walkable, still graphable, just not compliant with a known structure
  14. * kcomhnall joined #java
  15. * michele8 joined #java
  16. * LtHummus joined #java
  17. * kcomhnall joined #java
  18. * kcomhnall joined #java
  19. * unit86 joined #java
  20. * kcomhnall joined #java
  21. deebo we used to run several companies ecommerce on xml + xslt integrations, it's fast enough :)
  22. deebo did you know you can do jdbc in xslt!
  23. * unit86 joined #java
  24. * acidjnk joined #java
  25. * unit86 joined #java
  26. * kcomhnall joined #java
  27. * MinusSeven joined #java
  28. * fed-kaczynski_ joined #java
  29. * gjvc joined #java
  30. * xdminsy joined #java
  31. * tomboy64 joined #java
  32. * Inline joined #java
  33. * MikeBux joined #java
  34. * jreicher joined #java
  35. * gjvc joined #java
  36. Para XML compresses really well, btw.
  37. * X-Scale joined #java
  38. jreicher Not necessarily a point in its favour, you know. :p
  39. 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
  40. jreicher Honestly, I do not hate XML at all. But I wonder why it's both a serialisation format and... other things.
  41. 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.
  42. jreicher In all honesty I'm not sure I know what I mean. If it's only serialisation, why would it need a schema?
  43. dreamreal Right. But it's not: it's an extensible markup language, which is where "XML" in the name comes from
  44. 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.
  45. jreicher Well, that's what i mean by "other things". Sometimes it's not just serialisation.
  46. 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?
  47. dreamreal The JSON equivalent is {"name":{"first":"jack", "last": "frink"}} of course
  48. [twisti] we have a schema that does (weak, obviously) constraints, and i dont know how to feel about that
  49. dreamreal We have a schema that does *exact* constraints, and it's hard to break :D
  50. [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
  51. dreamreal [twisti]: yeah, what YOU have is more than data, it's an ontology
  52. [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 ?
  53. dreamreal XML itself is not, no
  54. dreamreal like I said, what you have is an ontology: you wouldn't use XML/XSD for that, you'd use XML/XSD/OWL
  55. dreamreal You wouldn't HAVE to use XML for it, OWL can leverage other formats like turtle, etc
  56. [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
  57. 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"
  58. dreamreal (shadowbox: "is this data rabbit-shaped?" OWL: "does this data match the definition of a rabbit?")
  59. [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)
  60. dreamreal https://bytecode.news/posts/2026/05/from-stringly-to-strongly-typed-refined-design
  61. dreamreal That would be an ontology, yes, but a simple one
  62. [twisti] ill read up when i next need to procrastinate :D
  63. dreamreal :( It's actually pretty appropriate for what you're describing
  64. [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
  65. dreamreal Definitely, enjoy
  66. [twisti] thanks for the link, i didnt mean it to sound deprecating if thats how it came over
  67. dreamreal It did not
  68. 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"
  69. 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)
  70. 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
  71. 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
  72. 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"
  73. jreicher But how do you think it works in practice?
  74. jreicher The most obvious interpretation is "classes are nouns", but that's probably not correct.
  75. 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
  76. dreamreal no, it's more like "is this is a valid X because X has these characteristics and this has THESE characteristics"
  77. jreicher So how do you find your ontology?
  78. dreamreal find?
  79. dreamreal An ontology is built, not found
  80. jreicher OK, that's saying something.
  81. jreicher So the schema records that construction also?
  82. dreamreal The SCHEMA does not, no
  83. dreamreal the schema records the input for an ontology
  84. 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
  85. jreicher OK. I'm struggling a bit to understand what you mean by "input" for that, as it's not a function...
  86. dreamreal sure it is
  87. jreicher It's a description. You just said that.
  88. dreamreal okay, so: imagine a person. Is a person a terminator?
  89. dreamreal An ontology yields a description
  90. jreicher Yes, but a description is not a function AFAICT.
  91. dreamreal like, from the terminator movies. If you're unfamiliar, give me a context and I'll try to figure out a better example.
  92. 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
  93. 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?
  94. dreamreal Hah, picking up a cold ball, are we
  95. dreamreal Okay, a CLASS and a FILE are different things
  96. dreamreal I was describing an XML file and a JSON equivalent
  97. 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"
  98. dreamreal which means NEITHER ONE of those files represents a person
  99. * jreicher joined #java
  100. dreamreal WB, dunno what you saw last
  101. 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.
  102. dreamreal schema is a data-level validation of presence and simple values
  103. jreicher I've checked.
  104. 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"
  105. dreamreal an ontology has no issues with the latter
  106. dreamreal it wouldn't PREVENT such a player, but would be able to say "this player's construction is an aberration"
  107. 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.
  108. dreamreal "this country road, unpaved, has seven lanes going in each direction, which is an odd definition for a country road"
  109. 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
  110. 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.
  111. dreamreal Most people express ontologies in code rather than in AN ONTOLOGY, because ontologies are wierd and hard to use and hard to build.
  112. dreamreal We were originally talking about XML and namespaces and schema, and nobody answered the questions I was actually asking so it veered off
  113. 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?
  114. 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."
  115. jreicher What's the difference?
  116. jreicher You don't have data without input
  117. 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
  118. jreicher Why couldn't a sufficiently rich schema system tell you just as much as the ontology?
  119. dreamreal Well, go back to that XML thing
  120. dreamreal It depends on the nature of the schema! I keep bringing up examples and you keep not interacting with them
  121. dreamreal but I actually bring them up to observe them
  122. jreicher Because I'm trying to figure what's inherent to the nature of "schema", rather than a particular schema system.
  123. jreicher Put another way, I'm trying to figure out the difference between schema validation and type checking.
  124. dreamreal Well, the examples are meant to illustrate aspects to make their nature more clear
  125. dreamreal scope
  126. dreamreal schema validation means type checking of each field and its presence or negation
  127. dreamreal type checking is for a field; schema is for a set of fields; ontology is for the relationship of fields in a schema
  128. jreicher You don't think a sufficiently expressive schema could check relationships?
  129. 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
  130. dreamreal I know it can't.
  131. jreicher Why not? I'm not contesting it, but I don't understand why it's a foregone conclusion.
  132. dreamreal Again, I keep bringing up examples :D
  133. dreamreal Okay, describe a D&D player character. Or a terminator.
  134. 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
  135. 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.
  136. dreamreal I've tried D&D, action movies, biology, census data, all flew over
  137. dreamreal Well, pick one anyway
  138. jreicher Car
  139. jreicher I'm traditional
  140. dreamreal Okay, what is a car?
  141. jreicher For now, let's say it's an object composed of a chassis, engine, and four wheels
  142. dreamreal Okay. Describe one in data: XML, json, doesn't matter
  143. dreamreal <thing hasChassis="true" hasEngine="true" wheelCount="4" /> ?
  144. jreicher OK
  145. dreamreal How would a truck look?
  146. jreicher Same, but also with a trailer
  147. dreamreal A truck has a trailer? Mine doesn't
  148. dreamreal Anyway, type validation says "hasChassis" can be either "true" or "false"
  149. jreicher I'm not really fussed at the definition. I just came up with an arbitrary extension.
  150. jreicher OK
  151. dreamreal and a "thing" in this context CAN HAVE attributes like hasChassis, hasEngine, wheelCount
  152. jreicher OK
  153. dreamreal I'm working with your examples!
  154. jreicher I understand that, but I don't know what's required to answer my question.
  155. 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
  156. dreamreal and "hasTrailer" is indeed a candidate for a truck, but a truck might also have a flat bed
  157. 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?
  158. dreamreal so "a truck" is defined as "a thing" with at least four wheels, and EITHER a bed OR a trailer
  159. dreamreal jreicher: we are sure there IS a richer kind of field validation
  160. dreamreal it's an ontology
  161. jreicher OK, let me ask the question really weirdly. Can we have an XML document with "ontology validation"?
  162. dreamreal not with the formal definition of an XML file, no. It has a spec; the spec precludes ontological inference.
  163. jreicher But we can imagine a different kind for serialisation format that might admit this kind of validation?
  164. dreamreal an XML file has a structural specification (the SGML spec, which includes schema specifications)
  165. dreamreal sure: it's an ontology
  166. jreicher Perfect. I think that answers my question.
  167. dreamreal You keep asking for the thing that's right there
  168. dreamreal <thing hasWheels="2" hasBed="true" hasChassis="true" hasEngine="true" /> is a truck, yeah?
  169. dreamreal It has a bed, it has wheels, it has an engine...
  170. jreicher I'm OK with that
  171. dreamreal * dreamreal thinks that would be a very strange truck, personally
  172. * raj joined #java
  173. dreamreal maybe a sort of ATV, but for stability you'd want three wheels, not two
  174. dreamreal in code, you'd load that object and have some kind of validation to make sure the data made sense
  175. dreamreal but that's exactly what an ontology does; it'd be way easier to do it in code, though, and way faster
  176. * Ragnor joined #java
  177. * hwpplayer1 joined #java
  178. * deadbeat joined #java
  179. Para Remember to spend your tokens, kids, month is going to change and token costs will skyrocket in all subscriptions.
  180. dreamreal or thank your past selves for buying a machine you can run a model on locally :D
  181. Para I'm going to add picture of my 64GB DDR5 to my Tinder profile.
  182. * MonsterAbyss joined #java
  183. * marcel1 joined #java
  184. Chronos Para: LOL :D
  185. * dob1 joined #java
  186. * stewi joined #java
  187. * Drixtan joined #java
  188. * dob1_ joined #java
  189. * Drixtan joined #java
  190. sweatiest FY2026 Q3 it all goes tits up, we got a month left
  191. sweatiest Para: not next month, but in July
  192. Para Good thing I'm European, I'll be vacationing then.
  193. Para I can come back to chaos with fresh mind!
  194. * five618480339176 joined #java
  195. * OmniRadix6 joined #java
  196. * dob1 joined #java
  197. * BSaboia joined #java
  198. * hwpplayer1 joined #java
  199. * Betal joined #java
  200. * mindCrime joined #java
  201. 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) ?
  202. sweatiest earnings reports
  203. sweatiest post spacex IPO
  204. Drixtan ah, those apocalypses, I can't follow all of them, my bad.
  205. * tronexte joined #java
  206. Para your apocalypse stack is full
  207. * m joined #java
  208. * Inline joined #java
  209. * X-Scale joined #java
  210. * MonsterAbyss joined #java
  211. * GreenResponse joined #java
  212. * hwpplayer1 joined #java
  213. * dgregory joined #java
  214. * hwpplayer1 joined #java
  215. * Betal joined #java
  216. * gildarts joined #java
  217. * caryhartline joined #java
  218. jbosmans clearly, i missed a bunch and or a whole lot
  219. jbosmans k, something about motorized vehicles vs XML
  220. jbosmans 'nuff said
  221. * X-Scale joined #java
  222. * mindCrime joined #java
  223. * X-Scale joined #java
  224. * danba9 joined #java
  225. danba9 jer
  226. * danba9 left #java
  227. * cronos joined #java
  228. * PrimaMat1 joined #java
  229. * X-Scale joined #java