473,372 Members | 717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Is there a way to take a priori knowledge out of field definitions?

Hi,

It is possible to build a system where the fields are "self defining" : -

One way is to keep a dictionary of tags and descriptors, and to keep "the data"
in a dictionary using the same tags as keys, with values - an oversimplified
example:

DefinitionDict = {1:'Quantity',2:'Price',3:'Value'}

DataItemDict = {1:10,2:3.50,3:35.00}

This is conceptually not much different to putting headers on columns in a
database table or a spreadsheet, with the data item being a row, or to HT or
XML.

Now obviously the definitions need not be single valued strings, but could be
multivalues, for use at different times, such as for gui displaying, for
printing, etc, and could also hold type information, as most databases do.

Up to this point, there is no a priori human knowledge mixed in with the data
that has not been written down.

However, when we want to make say a validation rule, such as Quantity times
Price must equal Value, then we are using a priori knowledge about the data to
formulate this.

At this point, if a routine is written to check that DataItemDict[1] multiplied
by DataItemDict[2] is indeed equal to DataItemDict[3], then we are casting the
meanings into stone, and the flexibility of the structure is to a large extent
lost.

Now if I want to make a system where these sort of rules, as well as more
complicated ones, are also definable - Is there a way to do it simply and
cleanly - a way to expand the DefinitionDict so that it contains all of what we
know about the structure and relationships of and between the items of data?

It seems to me that if this could be done, then it could be used to dynamically
generate the routines needed for validation, update, etc...

But my brain strains when I try to think about how to do it...

- Hendrik

Sep 11 '06 #1
1 888
Hendrik van Rooyen wrote:
Hi,

It is possible to build a system where the fields are "self defining" : -

One way is to keep a dictionary of tags and descriptors, and to keep "the data"
in a dictionary using the same tags as keys, with values - an oversimplified
example:

DefinitionDict = {1:'Quantity',2:'Price',3:'Value'}

DataItemDict = {1:10,2:3.50,3:35.00}

This is conceptually not much different to putting headers on columns in a
database table or a spreadsheet, with the data item being a row, or to HT or
XML.

Now obviously the definitions need not be single valued strings, but could be
multivalues, for use at different times, such as for gui displaying, for
printing, etc, and could also hold type information, as most databases do.

Up to this point, there is no a priori human knowledge mixed in with the data
that has not been written down.

However, when we want to make say a validation rule, such as Quantity times
Price must equal Value, then we are using a priori knowledge about the data to
formulate this.

At this point, if a routine is written to check that DataItemDict[1] multiplied
by DataItemDict[2] is indeed equal to DataItemDict[3], then we are casting the
meanings into stone, and the flexibility of the structure is to a large extent
lost.

Now if I want to make a system where these sort of rules, as well as more
complicated ones, are also definable - Is there a way to do it simply and
cleanly - a way to expand the DefinitionDict so that it contains all of what we
know about the structure and relationships of and between the items of data?
Looks a lot like a RDBMS...
It seems to me that if this could be done, then it could be used to dynamically
generate the routines needed for validation, update, etc...

But my brain strains when I try to think about how to do it...
You may want to have a look at the descriptor protocol and packages like
traits and FormEncode.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Sep 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Maarten van Reeuwijk | last post by:
Hello, I am using the Numeric package, and I need to strip edge cells off an array (dimension unknown) in an a-priori unknown direction. I implented this as follows: def el_remove_bcells(var,...
1
by: Yasso Picasso | last post by:
Greetings, I have to admit that I'm still a beginner in the database field, but I'm actively studying, and this is why I will be utterly grateful for the proper, accurate, and wise guidance to...
36
by: zouyongbin | last post by:
Stanley B Lippman in his "C++ Primer" that a definition like this should not appear in a header file: int ix; The inclusion of any of these definitions in two or more files of the same...
2
by: Phil Latio | last post by:
My quandary is this..... I have a label application (Bartender) that I have hooked up to Access, to use the output of a cross tab. I've succeeded in getting the data within Access, but my...
17
by: The Frog | last post by:
Hello everyone, I am working on an application that can build database objects in MS Access from text files. I suppose you could call it a backup and restore type routine. Accessing the...
3
by: David Greenberg | last post by:
Hi This is a question of "what does it cost me". Lets say I have an integer value which would fit into a smallint field but the field is actually defined as int or even larger as bigint. What...
3
by: perfectclick.ng | last post by:
I'm a beginner of MS Access, I need adequate knowledge on how to programme. I have a challenge in my office to write a pragramme that will calculate a compensation for all our distributors. This is...
6
by: naschol | last post by:
I am somewhat of a novice and am trying to do a somewhat complicated thing (to me, anyway). What I would like to do is populate the field Entry Fee in the subform (Category Entries table) from a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.