Android Question Expert system project for Android

peacemaker

Expert
Licensed User
Longtime User
HI, All,

Who tried to develop it ? I think, it's very interesting task.
For ex., we make:
1) choosing the subject, area for the app - say, fishing (or electrotechnics...)...
2) Develop the database structure
3) invent the interface template for db filling by the expert
4) invent the interface template for the end-user of app, who wants to learn the subject
5) Expert fills the db in: adding objects, their properties (parts, dimensions, colors, ...) and the relations between all these objects (formulas, proportions...)
6) And user can make searching by text, selecting the objects and see some map\chart\table\tag cloud ... of the related objects to understand the app subject, and learn.

My question #1 is: what can be the SQLite db structure for such system ?
 

RB Smissaert

Well-Known Member
Licensed User
Longtime User
HI, All,

Who tried to develop it ? I think, it's very interesting task.
For ex., we make:
1) choosing the subject, area for the app - say, fishing (or electrotechnics...)...
2) Develop the database structure
3) invent the interface template for db filling by the expert
4) invent the interface template for the end-user of app, who wants to learn the subject
5) Expert fills the db in: adding objects, their properties (parts, dimensions, colors, ...) and the relations between all these objects (formulas, proportions...)
6) And user can make searching by text, selecting the objects and see some map\chart\table\tag cloud ... of the related objects to understand the app subject, and learn.

My question #1 is: what can be the SQLite db structure for such system ?

Maybe you get more replies if you explain a bit better.
To me it sounds you want some sort of automatic app maker app, based on some features that are required.
I don't think such a thing is feasible, but maybe I misunderstood.

RBS
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
To me it sounds you want some sort of automatic app maker app, based on some features that are required.
I don't think such a thing is feasible, but maybe I misunderstood.
I also understood the same and will be exiting if such possibility is there.

Regards,

Anand
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
No, it's expert system that should give answers (or at least the list of related things) that an end-user wants, but the db of the systen is filled in by experts of the subject.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
I had some contact with expert systems in the 1980s. In those days they were mostly text based in an interview "question and answer" style.

The information technology problem ("designing the database") is secondary - it is often a "production rule" system of "if This and This then That" style. The primary problem is " ... 5) Expert fills the db in". Most people can instantly differentiate a dog from a cat, but not many people can explain how they do it. That is why it is generally impossible to simply have the expert filling in the data, especially when they are not allowed to use specialist terminology (jargon).

There are some apps around that roughly fit an "expert system" description. Look for ones on tree recognition, or bird or plant recognition - you will soon see some of their shortcomings. Nowadays these use a library of photos rather than text based Q & A. But a tree expert can recognise an oak tree from 50 metres away in the middle of winter; he or she does not need to see a leaf or an acorn first.

The Wikipedia article that you refer to looks like a pretty good summary. Codifying expertise proved to be a very difficult problem; machine learning also appeared to be a very difficult problem, but it seems to be the easier one to solve.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Now i'm thinking to create the system for the subject where i am an expert, 98% :D (feeder fishing).
So, i think that i should enter:
1) categories (rods, reels, lines, hooks, bites, feeder trays...) - partially it is jargon, yes. But the normal detailed description is just one of the db fields.
2) items of each category - variants of existing objects (kinds of rods; kinds of lines...)
3) properties (attributes) of each category: material of rods; material of lines.....; colors; weights; sizes ...

and the main table is:
4) relations between items and their properties: a rod must have a reel (of some size) that must contain a line (of some thickness and length that are vary), that is tied to a hook that ...

And if end-user see some starting tag cloud - he can tap a word (object) - and the tag cloud is refreshed showing all items and properties and categories that are linked to the chosen term.

Each kind of info should be in the db, having the id in their table. And an expert adds records one by one: reel #25 is small and slow (low speed), so can be used only for short distance up to X meters with the rods up to Y length.
 
Last edited:
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi, I agree with Brian.
An ES probably is not exactly what you have in mind. It seems to me that a good way to store information (i.e. knowledge base) and an easy way to obtain expert advice from it is closer to your goal.
Have a look at ElasticSearch, it may be the right tool.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Thanks, but no, it's not a just search engine. It's ... a db to manually digitize the chosen knowledge area, and then - yes, kind of interactive request dialog with the end-user that wants to fastly learn the subject (terms, dependencies... ) in this area.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
I see. It looks a very difficult task to me, in particular the interaction with the user.
Back in the late 80's I used Prolog and Lisp for NLP (natural language processing) and even simple sentences needed some work to infere a suitable meaning.
I don't know whether a general purpose language as B4X could really help here.
Anyway, keep the thread updated 'cause I find it very interesting. Thanks.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
So, i could be able to create the expert system :), with a knowledge base editor, and with ImageInternetChooser.
B4X:
Sub Service_Create
    'This is the program entry point.
    'This is a good place to load resources that are not specific to a single activity.
    Provider.Initialize
    ph.Initialize("ph")
   
    '-----db init----------
        'File.Delete(others.Folder, dbName)    'deleted old database for clean test
    Try
        DBUtils.CopyDBFromAssets(dbName)
        SQL.Initialize(others.Folder, dbName, True)    'DB
        '-------------------------------------------------------------------
        If SQL.IsInitialized = False Then
            SQL.Initialize(others.Folder, dbName, True)    'DB open to check the version
        End If
        Dim v As Int = DBUtils.GetDBVersion(SQL)
        Dim NewVer As Int = 1    'update here
        If v < NewVer Then
            SQL.Close
            File.Delete(others.Folder, dbName)    'deleted old database
            SQL.Initialize(others.Folder, dbName, True)
            v = DBUtils.GetDBVersion(SQL)    'set = 1
            DBUtils.SetDBVersion(SQL, NewVer)    'set new version = NewVer
        End If
        '-------------------------------------------------------------------
        If SQL.IsInitialized = False Then
            SQL.Initialize(others.Folder, dbName, True)
        End If
    Catch
        ToastMessageShow("Проблема с базой знаний, обновите или переустановите приложение", True)
        DBUtils.CopyDBFromAssets(dbName)
    End Try
    '-----db init end----------
   
    Dim ft As Map, L As List
   
    If DBUtils.TableExists(SQL, "facts") = False Then
        ft.Initialize
        ft.Put("id", DBUtils.DB_INTEGER)
        ft.Put("name", DBUtils.DB_TEXT)    'reserved: nothing, me
        ft.Put("alias", DBUtils.DB_TEXT)
        ft.Put("desc", DBUtils.DB_TEXT)
        ft.Put("img", DBUtils.DB_BLOB)
        DBUtils.CreateTable(SQL, "facts", ft, "id")
        L.Initialize
       
        ft.Initialize
        ft.Put("name", "")    'reserved: nothing
        ft.Put("desc", "")
        ft.Put("img", Null)
        L.Add(ft)
       
        ft.Initialize
        ft.Put("name", "я")    'reserved: me
        ft.Put("desc", "Вы, сам пользователь приложения")
        ft.Put("img", Null)
        L.Add(ft)
       
        DBUtils.InsertMaps(SQL, "facts", L)
    End If
   
    If DBUtils.TableExists(SQL, "actions") = False Then
        ft.Initialize
        ft.Put("id", DBUtils.DB_INTEGER)
        ft.Put("name", DBUtils.DB_TEXT)    'reserved: is, has
        ft.Put("desc", DBUtils.DB_TEXT)
        ft.Put("img", DBUtils.DB_BLOB)
        DBUtils.CreateTable(SQL, "actions", ft, "id")
        L.Initialize
       
        ft.Initialize
        ft.Put("name", "есть")    'reserved: is
        ft.Put("desc", "есть у кого-то, быть, являться")
        ft.Put("img", Null)
        L.Add(ft)
       
        ft.Initialize
        ft.Put("name", "иметь")    'reserved: has
        ft.Put("desc", "Содержать, обладать")
        ft.Put("img", Null)
        L.Add(ft)
       
        DBUtils.InsertMaps(SQL, "actions", L)
    End If
   
    If DBUtils.TableExists(SQL, "hows") = False Then
        ft.Initialize
        ft.Put("id", DBUtils.DB_INTEGER)
        ft.Put("name", DBUtils.DB_TEXT)    'reserved: nothing
        ft.Put("desc", DBUtils.DB_TEXT)
        ft.Put("img", DBUtils.DB_BLOB)
        DBUtils.CreateTable(SQL, "hows", ft, "id")
        L.Initialize
       
        ft.Initialize
        ft.Put("name", "")    'reserved: nothing
        ft.Put("desc", "")
        ft.Put("img", Null)
        L.Add(ft)
        DBUtils.InsertMaps(SQL, "hows", L)
    End If
   
    If DBUtils.TableExists(SQL, "whens") = False Then
        ft.Initialize
        ft.Put("id", DBUtils.DB_INTEGER)
        ft.Put("name", DBUtils.DB_TEXT)    'reserved: nothing
        ft.Put("desc", DBUtils.DB_TEXT)
        ft.Put("img", DBUtils.DB_BLOB)
        DBUtils.CreateTable(SQL, "whens", ft, "id")
        L.Initialize
       
        ft.Initialize
        ft.Put("name", "")    'reserved: nothing
        ft.Put("desc", "")
        ft.Put("img", Null)
        L.Add(ft)
        DBUtils.InsertMaps(SQL, "whens", L)
    End If
   
    ft.Initialize
    ft.Put("id", DBUtils.DB_INTEGER)
    ft.Put("who_fact_id", DBUtils.DB_INTEGER)
    ft.Put("does_action_id", DBUtils.DB_INTEGER)
    ft.Put("at_fact_id", DBUtils.DB_INTEGER)
    ft.Put("what_fact_id", DBUtils.DB_INTEGER)
    ft.Put("how_id", DBUtils.DB_INTEGER)
    ft.Put("when_id", DBUtils.DB_INTEGER)
    ft.Put("where_id", DBUtils.DB_INTEGER)
    ft.Put("img", DBUtils.DB_BLOB)
    ft.Put("desc", DBUtils.DB_TEXT)
    DBUtils.CreateTable(SQL, "relations", ft, "id")
Tables for the facts, actions, conditions and the relations between facts. And only 2 activities for the end-user: initial tags cloud with the search, and the mini-browser of the related facts and photos.

The system subject is the feeder fishing, but, sorry, only on russian:
 
Last edited:
Upvote 0
Top