Wiki

Clone wiki

BaseParadigm / like content addressable json

I've just been testing the library by putting the whole tree of files in the BaseParadigm mercurial repository into a Graph. In doing so I wrote a few toString() methods to help look at the results. Surprise surprise, it looks kinda like json. What I pasted below is a single edge (unsigned, with no assumptions, authors, or patterns). The edge links the file "GPLv3.txt" to its parent directory, "/home/travis/workspace/BaseParadigm". I'm not necessarily recommending filesystems be translated into graphs exactly this way, but it's an illustrative experiment.

Also note the following code is by no means valid or useful except for illustration. BaseParadigm is a binary format.

org.baseparadigm.Edge[
  PROPERTIES: org.baseparadigm.EdgeSet[
    org.baseparadigm.Edge[
      OBJECTS: org.baseparadigm.CaSet[ "file" ]
      PREDICATES: org.baseparadigm.CaSet[ "filesystem type" ]
      SUBJECTS: org.baseparadigm.CaSet[
        org.baseparadigm.i.Pair.Impl[
          A: OBJECTS
          B: org.baseparadigm.CaBytes@e4ae6758
        ]
      ]
    ]
    org.baseparadigm.Edge[
      OBJECTS: org.baseparadigm.CaSet[ "GPLv3.txt" ]
      PREDICATES: org.baseparadigm.CaSet[ "filesystem name" ]
      SUBJECTS: org.baseparadigm.CaSet[
        org.baseparadigm.i.Pair.Impl[
          A: OBJECTS
          B: org.baseparadigm.CaBytes@e4ae6758
        ]
      ]
    ]
  ]
  OBJECTS: org.baseparadigm.CaSet[ org.baseparadigm.CaBytes@e4ae6758 ]
  PREDICATES: org.baseparadigm.CaSet[ "filesystem child" ]
  SUBJECTS: org.baseparadigm.CaSet[ "/home/travis/workspace/BaseParadigm" ]
]

Updated