From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: triples Date: Thu, 27 Oct 2022 22:15:38 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28870"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Cc: emacs-devel@gnu.org To: Andrew Hyatt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 27 21:33:50 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oo8dS-0004wp-R7 for ged-emacs-devel@m.gmane-mx.org; Thu, 27 Oct 2022 21:33:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo8QU-0003TP-4q; Thu, 27 Oct 2022 15:20:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo8Q8-0003PA-8S for emacs-devel@gnu.org; Thu, 27 Oct 2022 15:20:11 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo8Q4-0001ZT-6N for emacs-devel@gnu.org; Thu, 27 Oct 2022 15:20:03 -0400 Original-Received: from localhost ([::ffff:102.85.119.94]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000081D8D.00000000635AD9E0.0000431D; Thu, 27 Oct 2022 12:19:59 -0700 Mail-Followup-To: Andrew Hyatt , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298639 Archived-At: * Andrew Hyatt [2022-10-27 08:20]: > > In this case any table, column, with its primary key may be related to > > any other table, column with its primary key. That way objects and > > subjects are constrained and rigid, it is not universal triplets, but > > database tables dependent one. It relates only what exists in the > > database. If there is `people' database then such may be related to > > arbitrary other tables like `statistics'. > > Thanks for mentioning this, it's an interesting design I'll read up > on! Recently I am thinking of using UUID. Any table, column, by primary key (by it UUID or just INTEGER or else), may still have UUID. Let us say transaction entry: ID 3 Date created "2022-02-27 18:57:23.52117" Date modified nil User created "maddox" User modified "maddox" Date/Time "2022-02-27 00:00:00" Name "Mobile money fee" Description "nil" Amount 2310.0 Currency "UGX - Ugandan shilling" From account "Jean Louis" To account "Mobile money expenses" UUID "3c171d3d-b2c8-4527-8984-34bbacc82ff2" Hyperdocument nil Then by using UUID as subject, predicate, and UUID as object, it becomes clear what is what. A function must search UUID among those tables who have it. It is really fast, not noticable. But I can't know how well it could scale with millions or billions of records. For presentation purposes it would be fine, but for direct access, I can't be sure of speed. > > select * from predicates; predicates_id | predicates_name | > > predicates_description > > ---------------+-----------------+----------------------------------- > > 1 | is | When subject is object. 2 | knows > > | When subject knows object. 3 | registered | When > > subject registered an object > > > > by adding "has" predicate, one can tell: > > > > person has age person has name employee has id id is integer employeee > > has manager employee is person manager is person > > We have "has" but not "is". The schema has types, those types have > properties. So we can have a subject, "Joe Employee", who has a type > person, and a type employee, and a type manager, the properties of those > respective types. But we don't know or enforce that > every employee is also a person. It's perhaps a feature that can be > added later if needed; it seems possible in the current > implementation. Principle of semantic triplets is just subject, predicate and object. I guess you allow users to add any kind of predicates, right? Types are automatically formed by using subject, predicate, object principle. Reference: https://en.wikipedia.org/wiki/Semantic_triple This should be enough by using that principle: - job is activity - job has status - employee is status - Joe is name - person has name - Joe has employee (meaning status) Also see this: OneModel — an Alternative to emacs org-mode: https://soylentnews.org/article.pl?sid=16/04/23/0149257 OneModel - Record, manage and share any knowledge: http://onemodel.org/1/e-9223372036854618119.html -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/