CASE-1 Unstructured Query
The unstructured query means a query without any specification of the data structure to search. EML can naturally support this by its raw-data type independent object type (See Section 2.2) and normalized storage architecture. For instance, Query 1 below shows an unstructured query example to search over all databases to find any type of data objects. Internally EML searches e-nodes with "911" value. This unstructured query does not specify the data schema to search and also it does not even specify the field name of a value just like Web search using the keyword.
Ex.) Search all data objects that have a value "911".
SELECT * FROM _* AS t1 WHERE t1._value = "911";
CASE-2 Semantic Expansion
Ex.) Search data objects named like "memo" synonyms and whose value includes the word "party."
SELECT * FROM _* AS t1 WHERE t1._name LIKE _SYNS("memo") AND t1._value REGEXP "party";
CASE-3. EML Namespace Example
In EML, the name of data objects can be queried just like the value search. Also constraints on e-nodes properties can be specified on the type of data objects in addition to the name and value of objects.
Ex.) Unstructured query extension.
SELECT * FROM _* AS t1 WHERE t1._name LIKE "episode" AND t1._type = "INTEGER" AND t1._value = 601;
CASE-4. Temporal Query
Ex.) Find "BLOB" type data objects registered yesterday.
SELECT * FROM _* AS t1 WHERE t1._type = "BLOB" WHEN Day(Now()) - 2 day < Day(t1._timestamp) <= Day(Now()) - 1 day;
CASE-5. Ranking Queries
EML can prioritize the order of objects by their popularity. This is useful in information retrieval for ordering results by their reference count. Also, this method works for any e-nodes because any e-nodes joined in the e-node relation table have a reference count. This means _POPULARITY always works in the EML query statement.
Ex.) Select the most popular 100 data objects.
SELECT * FROM _* AS t1 ORDER BY _POPULARITY(t1) LIMIT 100;
CASE-6. Path Query
EML materializes the relation just like e-node objects. Also they are stored in the middle of the three-tuple adjacency list. In EML, relation types are assumed finite and priori known. Thus, a path query composed of names of concatenated e-functions can specify the path linked by the adjacency list. The below examples select text-type objects linked in the relation where the sentence subject is "Jason". Ex.) Select verbs and objects of a subject "Jason" from any texts in the database.
SELECT *, _R(%1, "_eSubjectVerb", R(*, "_eVerbObject", *)) FROM _* AS t1 WHERE t1._name LIKE "%lemma%" AND t1._value = "Jason";
Ex.) Rephrase Query 6 in recursive path form.
SELECT *, _R(%1, "_eSubjectVerb/_eVerbObject", *) FROM _* AS t1 WHERE t1._name LIKE "%lemma%" AND t1._value = "Jason";
CASE-7. Schema Object Manipulation
In EML, e-sdtypes are distinct e-node objects and can be shared by e-categories. Thus for instance when a user wants to remove some column for all databases, he can simply drop one e-sdtype node. Then EML drops linked relations automatically. Ex.) Drop the "SSN" column from all tables.
ALTER TABLE _* DROP COLUMN SSN