Friday, 9 December 2011

OpenCycloGraph

A recent post to MudBytes on using real world natural resource and mineral data to make a game, made me think of OpenCyc.  I've played around with it in the past, but it is somewhat complicated.  Starting it up also starts up a web interface through which the ontology can be either clicked through, or searched for specific terms.  Even so, it is still hard to get a grip on what is in there and what it means.


Even people who know it well enough to be ready to extend the ontologies are warned that it can be difficult to know whether whatever you wish to add is in there or not.  Just clicking through the data, or searching on relevant searching terms that come to mind, I sort of wished for a graph to click through.  And this reminded me of opencyclograph.  OpenCycloGraph can be pointed at a running instance of OpenCyc, and from there it can fetch and display the hierarchy of concepts.


In the screenshot above, it can be seen showing the results of a search for "Mineral".

Unfortunately, OpenCycloGraph is not quite ready for use.  There are no binaries provided at the Google Code project.  This means that anyone wanting to use it, needs to do a little bit of legwork.  I'll note below what I did, although I've never really worked in Java or used this IDE before, so maybe I'm doing it a little harder than I need to.

  1. Download and install NetBeans.
  2. Run NetBeans and import the code as a project.
  3. Find the "GLPanel.java" file under CycloGraph/src/com.touchgraph.graphlayout in NetBeans.
  4. Right click on it, and select "Run File".
At this point, you will see a window looking something like the above.  However, it won't be able to find a running instance of OpenCyc so it won't really be useful.
  1. Download and extract OpenCyc 2.0.
  2. Try and run its "scripts/run-cyc.bat".  If it fails due to lack of memory, edit the BAT script and modify it to run the 64-bit version (this is a two line change).
  3. Once it has started running on "localhost" up go back into NetBeans.
  4. Search for "CycServer" which is used in OpenCycloGraph as the default address where it should look for a running instance of OpenCyc.  It should be in "GLPanel.java", line 1282.  Replace it with "localhost".


Now when you right-click on "GLPanel.java" and select "Run File", it should "work correctly" for selected values of "work correctly".

You start by entering a search term and hitting enter.


This will populate the graph, and from there you can click on related entries of interest.



Note that you can see what the relation is, for example above you can see that "NonMetal" is 'disjointWith' "Metal" which seems not very useful to the end user and more likely was added to help out OpenCyc inferencing.

If you find a node and want to know more, you can right click and select "Inspect Node" to update/synchronise the browser display in the left-hand pane. 


And that's about it.  There's a video of me generically browsing game world relevant information for about a minute and a half below.  One application would be adding a "light" verb and linking it to objects which are CombustibleFuelSources, for instance.


An aspect of OpenCyc that escapes me is that either some data is missing and was not released as part of the cut-down OpenCyc public ontology, or I just don't know how to query it yet.  Case in point is Mass, massOfObject and MassOfObjectFn.  I am unable to locate any entries which map values for these to other ontology objects.

Xi'an - Looks like savoury potatoes

I don't remember what this dish was called, but it was common to see out in front of restaurants in a large pan like this.  To me, it looked like a potato dish.  So when it was recommended to me in restaurant, and was 5 RMB, I gave it a shot.

2011-11-16 - Xian - 09 - Big frypan of grass sand dish

Very little flavour and a gritty texture.

2011-11-16 - Xian - 10 - Grass sand dish

Translating the menu, I seem to remember it being called something related to sand and grass. Having seen a pan of it being prepared from scratch later on, the chunks looked like a clear and opaque solid. Perhaps some kind of gelatine based mixture.

There's a reason this one isn't recommended on the tourism related websites..

Tuesday, 6 December 2011

Xi'an - Xiyangshi - Niu rou pao mo

One of the dishes that internet sites recommend you try when you visit Xi'an, is yang rou pao mo (羊肉泡馍) which is a mutton "soup".  Most every restaurant I went to instead offered niu rou pao mo (牛肉泡馍) which is a beef "soup", so that's what this post is about.  I put soup in quotes because eating this dish constitutes mostly fishing soggy bits of bread out of your bowl.

The restaurant with the black sign was the one I mostly frequented, as it was always packed out unlike many others.


2011-11-16 - Xian - 11 - Niu rou pao muo - Restaurant

For 15 RMB, you get given a bowl, two unleavened pieces of bread and a tag. Then you go to a table and start breaking your bread into very small pieces. I was on the large side here, and my table companion told me to go smaller.

2011-11-16 - Xian - 12 - Niu rou pao muo - Bread preparation

Once you've broken your bread up, you take your bowl and "proof you paid" plastic tag up to this counter and they give you a numbered tag in exchange for them. At this point, I recommend grabbing a small bowl of pickled garlic and minced chilli. The chilli I added to my soup later on, and the garlic.. well.. it tasted a little kerosinesque to me so I skipped it unless the "passing time" to "this doesn't taste right" ratio went in the wrong direction.

2011-11-16 - Xian - 13 - Niu rou pao muo - Hand-in counter

When they've added soup and a few pieces of beef to the bowl, they call out your number in Mandarin. And some young guy brings it to you, as you indicate that it is yours.

2011-11-16 - Xian - 14 - Niu rou pao muo - Returned soup


Going back several times, I enjoyed it a lot. There's not much flavour to the dish, but it doesn't taste watery, it doesn't have the texture of soggy bread and it is on the cheap side. I had the mutton version elsewhere for slightly more, and it wasn't better. Really, I couldn't tell the difference.

I'd definitely re-recommend this common internet recommendation as a filling and satisfying meal.  There are many things that are recommended on the internet which really aren't worth trying, but this isn't one of them.