Yes, currently that is a non-trivial task, as there really is no "standard
Json format", so all importing o far from database-structures has been
ad-hoc work (I believe Evan Balster has a good CSV importing workflow).
Also, I apologize for my example wiki-code. It was late and I messed up
both the path _and_ my seperator character (should have been 'slash' not
'backslash'). Sheesh, good one Josh (lol).
The working transclusion would be:
{{Test/YouTubeAPI.json##/items/1/id/videoId}}
Moving on to your query, would your output data have a standard set of
fields, and what kind of json structure would there be? Once we have that
nailed down a bit, I can suggest various Filter tricks.
Best,
Joshua Fontany
On Monday, January 6, 2020 at 7:59:16 PM UTC-8, springer wrote:
>
> Hi Joshua, thanks for your reply. The JsonMangler sounds impressive!
>
> I suspect that (at least for now) flat table (vanilla) functionality is
> fine, since I still do all my relational database work in FileMaker.
>
> What I would really benefit from is some kind of walkthrough of a very
> basic JSON import process (starting not from a "file" per se but from a big
> hunk of exported text, which is what my database will yield), along with a
> couple simple demos of ways to use TW macros or templates to filter and
> extract field data from it. From there I would begin experimenting to
> produce the templates I need for things like slider sets for batches of
> records from the JSON data.
>
> One other thing that a JSON-savvy person might be able to clarify, quite
> quickly, is how much of a nuisance it will be to handle things like
> quotation marks or style formatting within my original data. I assume JSON
> files have some kind of escape sequences available, and that these play
> nice with TW5, but a confirmation would make a big difference.
>
> I'll poke around at your site to learn a bit more, but I admit that even
> the simple transclusion task you described wasn't coming through with
> anything for me (I created a new tiddler at your site and pasted in the
> string from your post, but the resulting tiddler showed nothing). Perhaps I
> just need pointers to get oriented on the basics, since your wiki seems to
> be doing stuff at a much higher level than the simple task
> (retrieve-filtered-records-from-flat-JSON-and-display-selected-fields-according-to-template)
>
> that I'm aiming for.
>
> Many thanks again!
>
> On Monday, January 6, 2020 at 8:56:54 PM UTC-5, Joshua Fontany wrote:
>>
>> You have a good understanding of the different approaches. One thing to
>> note is that native-Tiddlywiki syntax can only understand "flat" (1 level
>> deep) JSON structure.
>>
>> Being able to proccess large-data-sets from other data-management
>> structures i one of the reasons I made the "JsonMangler" plugin. See demo
>> here:
>>
>> https://joshuafontany.github.io/TW5-JsonMangler/
>>
>> With this plugin installed, you can "dig down" into nested or mutli-level
>> JSON structures with Tiddlywiki widgets/syntax.
>>
>> For example, to transclude the "videoId" of the second item (index 1) in
>> one of my Test json tiddlers (
>> https://joshuafontany.github.io/TW5-JsonMangler/#Test%2FYouTubeAPI.json),
>> which is full of nested objects representing YouTube search results, you
>> could write:
>>
>> {{Test/YouTubeAPI.json##\items\1\etag\id\videoId}}
>>
>> In vanilla Tiddlywiki, you would only be able to access the "items"
>> object and would need to manually split the items into individual tiddlers.
>>
>> With the ability to access nested data, the rest of the Tiddlywiki
>> toolkit (List Widget, Filters, etc) will allow you format or even break up
>> the data into individual tiddler.
>>
>> Let me know if the docs at the example wiki are in need of updating. :)
>>
>> Best,
>> Joshua Fontany
>>
>> On Monday, January 6, 2020 at 2:35:29 PM UTC-8, springer wrote:
>>>
>>> OK, all. I have mentioned that in the classroom my students see lots of
>>> TiddlyWiki; I freely navigate links, on the big screen, to pull up relevant
>>> bits during discussion.
>>>
>>> But I'm also a kind of database nerd. In my office I work out of
>>> FileMaker. FileMaker is the "back end" of what I do in TW (and elsewhere),
>>> for lots of reasons.
>>>
>>> In TW Classic, I used calculation functions in the database to "extrude"
>>> marked-up content to paste in TiddlyWiki.
>>>
>>> - Example 1: my database has hundreds of quiz question-answer sets
>>> accumulated over the years, and in TWC I used a calculation to "dress
>>> them
>>> up" with Eric's NestedSliders syntax. Paste the complex result in a
>>> tiddler
>>> and.. Instant fun quiz GUI!
>>> <http://ethics.tiddlyspot.com/#Autonomy...>
>>> - Example 2: my database has thousands of quoted excerpts from books
>>> and articles. I used a database calculation to build a nice slider
>>> around
>>> each quote (page number and teaser, plus details-style slider to show
>>> full
>>> quote). After using the find function in the database to bring up a
>>> particular subset of quotes, I could grab a tiddler-worth of
>>> neatly-formatted excerpts
>>> <http://ethics.tiddlyspot.com/#%5B%5BKing%20passages%5D%5D> ready to
>>> paste and go.
>>>
>>> Now, I face a decision: Do I (A) just rework the TW5 calc field in my
>>> database (updating so as to dress each quote/quiz element in TW5-specific
>>> reveal/details/slider macro syntax, options still under evaluation), or (B)
>>> do I figure out how to go all-in on data structure, and use TW5 data
>>> features to grab the bits I need from a massive "in-house" JSON tiddler
>>> (not thousands of quotes, but hundreds), and use templates to display
>>> aspects of the database as desired? The second *sounds* great...
>>>
>>> HOWEVER (!), I have no experience with manipulating JSON data yet, and
>>> grasp only the syntactic basics of how fields and values are paired (plus
>>> the fact that FileMaker does have some JSON-handling functions, so export
>>> should be possible). With JSON, there would be a learning curve, but I
>>> don't know how steep. (I tried mocking up some JSON-looking stuff and
>>> pasting it into TiddlyWiki and giving it JSON data "type" and my wiki just
>>> blinked back at me and said, OK, there's a buncha funny looking text...)
>>>
>>> If I understand correctly, it seems the advantage of the JSON approach
>>> (once I figure out how to import the data) is that I'd have great
>>> flexibility to re-filter things on the fly within TW, and *also* great
>>> flexibilty in GUI. So, if I suddenly discover some new display macro
>>> approach (in the reveal/details/accordion/slider world) or I realize I want
>>> to change which fields to display and how, I modify my template once, and
>>> all the tiddlers that rely on it are instantly updated. On my old system,
>>> when I became inspired to tweak how these things display, I would have to
>>> shuttle back and forth to my FileMaker database, and perform copy-paste
>>> operations for each tiddler with the new syntax.
>>>
>>> So, for those fluent in JSON (and yet not unsympathetic to JSON
>>> newbies), would you advise me toward (A), or toward (B)? Or, am I not
>>> grasping the choice well yet?
>>>
>>> By the way, I'm guessing that the path of importing JSON data, if I
>>> don't ever convert it into regular tiddlers, seems to place more importance
>>> on the possibility of freelinking, since my database of quoted passages
>>> uses many terms that are in my glossary, and I've love for them to link,
>>> but all the data will stay "under the hood" within the JSON tiddler, right?
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/141d0845-580a-4a02-9a63-87254172ca13%40googlegroups.com.