AsOpen.org (alpha) - How to Use the As Open Data The As Open Data Explained

How to Use the Reference Tables

The current As Open Data format relies on a referential system. Each element of interest is denoted by a number. Countries, languages, and strings are all represented by unique numbers in their own respective tables, which in turn serve as reference values in other tables.
A country reference from the Country Reference Data set looks as follows:
Country RefID     ISO Country Code     2-Letter Country Code     3-Letter Country Code
         1840                  840                        US                       USA
      
The country reference number Country RefID is used to represent a specific country (in the above example, the United States) in all other entries in the As Open data format. By following the Country RefID, the user can obtain additional information about the country referenced, such as ISO Country Code, 2-Letter Country Code, and 3-Letter Country Code.
A language reference from the Language Reference Data set looks as follows:
Language RefID     Country RefID     2-Letter Language Code     3-Letter Language Code
          2044              1840                         en                     (null) 
      
The language reference number Language RefID is used to represent a specific language (in the above example, English in country 1840, which is the United States; therefore, American English) in all other entries in the As Open data format. By following the Language RefID, the user can obtain additional information about the language referenced, such as the country associated with the language, 2-Letter Language Code, and 3-Letter Language Code.
Country and language references have a special property, which will be discussed further below as an understanding of this property requires an understanding of string references and product references.
String references from the String Reference Data set look as follows:
String RefID     String 
        1840     United States
        6201     Filmography
      100561     Genevieve Brunet
      
The string reference number String RefID is used to represent a specific string in all other entries in the As Open data format.
A product reference from the Product Reference Data set looks as follows:
Product RefID     Language RefID     String RefID
       100736               2044           100561
      
The product reference number Product RefID is used to associate a specific item to a language and a string (often a name or a description of the item). In the above example, a product denoted as 100736 has the name/description Genevieve Brunet in American English. The product reference number Product RefID is used to denote the item in all other entries in the As Open data format.
At this point, there is sufficient information to discuss the special property of country and language references. A country reference can be used in conjunction with a language reference to obtain the name of a country. For example, if one does a look up with 1840 as a Product RefID with the Language RefID set to 2044 (American English), one obtains the String RefID 1840, which in turn represents the string "United States". Similarly, if one does a look up with 2044 as a Product RefID with the Language RefID set to 2044 (American English), one obtains the String RefID 2044, which in turn represents the string "English locale for the USA". Please note: the fact that the same reference number values (such as 2044 above) appear in separate tables as references is merely coincidental and no significance should be attached to it.

How to Use the Product Relation Data

An example entry from the Product Relation Data set is as follows:
Product RefID    Relation (in Product RefID)    Value: LHS (in Product RefID)    Value: RHS (in Product RefID)    Sort Order Index
       100165                           6301                           100166                           100167               10000
      
An example entry from the Products per Data Set table is as follows:
Member (in Product RefID)       Group (in Product RefID)
                   100165                           6201
      
These entries establish a property or a relation for the item referred to by 100165. Using American English (2044) as our language, a look up in the Product Reference Data table leads to the name/description The Lord of the Rings: The Two Towers. A similar look up for 6201 using American Enlgish leads to the name/description Filmography. Hence, we have established that The Lord of the Rings: The Two Towers belongs to the group Filmography.
A similar process with the entry from the Product Relation Data set using American English establishes the following: the item The Lord of the Rings: The Two Towers has a property or a relation called Overview, which in turn has an element with a left-hand side entry of Director and a right-hand side entry of Peter Jackson. The Sort Order Index indicates the order in which properties or relations should be displayed. Properties or relations with lower values should appear before those with higher values. In simple terms, the two entries together state that "The Director of the movie The Lord of the Rings: The Two Towers is Peter Jackson".

How to Use the SQL-Ready Data Aggregate

The SQL-Ready Data Aggregate contains all of the data in the Reference Tables, the Product Relation Data set, and the Products per Data Set table. The aggregate is intended to be executed via an SQL client. Once executed the script will create the necessary tables and populate them.
An example in a BASH shell on a Linux platform using PostgreSQL is:
[user@server user]$ psql [database_name] [other optional parameters] < [filename]