Archive of articles classified as' "Databases"

Back home

Google’s support for RDFa and Microformats

19/10/2009

Google has announced that their search engine is going to support enhanced searching in web pages, by using RDFa and Microformats embedded in XHTML. Google states that the extra (structured) data will be used in order to get results for Product Reviews (e.g. CNET Reviews), Products (e.g. Amazon product pages), People (e.g. LinkedIn profiles) and any other types of resources will be made public through the data-vocabulary.org. W3C is pretty happy about that.

The news are good for three reasons:

  1. Google supports an Open Standard (RDFa by W3C) and also an Open RDF Vocabulary
  2. Structured Data embedded in human readable web pages are going to start showing up. Content providers will start using RDFa or Microformats to get Google’s Rich Snippets in search results. Of course other Search Engines will follow :) Yahoo! already supports RDFa in SearchMonkey.
  3. One more big step towards the Semantic Web.

I suspect that data from RDFa or Microformats will be also used in some way by Google for Ranking search results and that a new SEO era is going to start. However it is too early to make predictions.

From my personal point of view, if RDFa is finally going to be widely adopted, it will be the first time that scientists will have a Web-scale distributed, structured data “playground” to do research on. Although I am not an expert in the field, I remember that Semantic Web and Large Graph processing had scalability problems (correct me if I’m wrong!). The Web Graph (that is as simple as “one page links another”) is going to be much more complex and semantically “meaningful”. I am very curious to see what comes next in this direction!

2 Comments

MySQL Server configuration Variables

15/02/2009

Setting InnoDB variables


[mysqld]
# You can write your other MySQL server options here
# ...
# Data files must be able to hold your data and indexes.
# Make sure that you have enough free disk space.
innodb_data_file_path = ibdata1:10M:autoextend
#
# Set buffer pool size to 50-80% of your computer's memory
innodb_buffer_pool_size=70M
innodb_additional_mem_pool_size=10M
#
# Set the log file size to about 25% of the buffer pool size
innodb_log_file_size=20M
innodb_log_buffer_size=8M
#
innodb_flush_log_at_trx_commit=1
1 Comment

Importing data from CSV file in mysql

15/02/2009

Use this command to import data from a CSV file into MySQL

LOAD DATA LOCAL INFILE 'data.csv'
INTO TABLE table_name
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
(field1, filed2, field3);

Sample File

"3003","0.039","aster"
"3017","0.03h","affs"
"3018","0.03unit","xfs"

References

  • http://dev.mysql.com/doc/refman/5.0/en/load-data.html
No Comments

Concatenating multiple rows of a result set

15/02/2009

This is needed when you need to concatenate multiple rows of a result set in MySQL.

CREATE TABLE services (
  id INT UNSIGNED NOT NULL,
  client_id INT UNSIGNED NOT NULL,
  KEY (id)
);

INSERT INTO services
VALUES (1,1),(1,2),(3,5),(3,6),(3,7);

SELECT id,client_id 
       FROM services 
       WHERE id = 3;

+----+-----------+
| id | client_id 
+----+-----------+
|  3 |		 5 
|  3 |		 6 
|  3 |		 7 
+----+-----------+

SELECT id,GROUP_CONCAT(client_id) 
      FROM services 
      WHERE id = 3 GROUP BY id;

+----+-------------------------+
| id | GROUP_CONCAT(client_id) 
+----+-------------------------+
|  3 | 5,6,7				   
+----+-------------------------+

The group_concat function is affected by the group_concat_max_len and the max_allowed_packet variables. So, if you need to concatenate more than mysql can handle by default(1024 bytes) you just change the max_allowed_packet in my.cnf and set this:

SET [SESSION | GLOBAL] group_concat_max_len = VALUE;

into your session.

9 Comments