addObject(ostrich);
System.out.println("total number of objects registered: " + _objectIndex.size());
QmfQuery query;
List<QmfConsoleData> results;
System.out.println("looking up wasp object by ID");
query = new QmfQuery(QmfQueryTarget.OBJECT, wasp.getObjectId());
results = evaluateDataQuery(query);
displayResults(results);
System.out.println("\nlooking up mammal objects");
query = new QmfQuery(QmfQueryTarget.OBJECT, new SchemaClassId("mammal"));
results = evaluateDataQuery(query);
displayResults(results);
System.out.println("\nlooking up everything in package com.fadams.qmf2");
query = new QmfQuery(QmfQueryTarget.OBJECT, new SchemaClassId("com.fadams.qmf2", null));
results = evaluateDataQuery(query);
displayResults(results);
System.out.println("\nQuery for all mammals with more than two legs");
String predicate = "['and', ['eq', '_package_name', ['quote', 'com.fadams.qmf2']], " +
"['eq', '_class_name', ['quote', 'mammal']], " +
"['gt', 'legs', 2]]";
//predicate = "['eq', '_package_name', ['quote', 'com.fadams.qmf2']]";
//predicate = "[]";
query = new QmfQuery(QmfQueryTarget.OBJECT, predicate);
System.out.println(query.getPredicate());
results = evaluateDataQuery(query);
displayResults(results);
System.out.println("\nQuery for everything with less than four legs");
predicate = "['lt', 'legs', 4]";
query = new QmfQuery(QmfQueryTarget.OBJECT, predicate);
System.out.println(query.getPredicate());
results = evaluateDataQuery(query);
displayResults(results);
System.out.println("\nQuery for everything with between two and four legs");
predicate = "['and', ['ge', 'legs', 2], " +
"['le', 'legs', 4]]";
query = new QmfQuery(QmfQueryTarget.OBJECT, predicate);
System.out.println(query.getPredicate());
results = evaluateDataQuery(query);
displayResults(results);
System.out.println("\nQuery for all reptiles or birds");
predicate = "['or', ['eq', '_class_name', ['quote', 'reptile']], " +
"['eq', '_class_name', ['quote', 'bird']]]";
query = new QmfQuery(QmfQueryTarget.OBJECT, predicate);
System.out.println(query.getPredicate());
results = evaluateDataQuery(query);
displayResults(results);
System.out.println("\nQuery for everything whose name matches the regex ^h");
predicate = "['re_match', 'name', ['quote', '^h']]";
query = new QmfQuery(QmfQueryTarget.OBJECT, predicate);
System.out.println(query.getPredicate());
results = evaluateDataQuery(query);
displayResults(results);