*/ echo "
"; $employees->writeAsHtmlTable(); echo "
";
// Query string: "find the full name of all employees"
$query1 = '
SELECT ?fullName
WHERE (?x, vcard:FN, ?fullName)
USING vcard FOR ";
RdqlEngine::writeQueryResultAsHtmlTable($result1);
// This will return no objects, but their string serialization instead
$result2 = $employees->rdqlQuery($query1, FALSE);
echo " ";
// Another query: "find the given name and age of all employees over 30"
$query2 = '
SELECT ?givenName, ?age
WHERE (?x, vcard:N, ?blank),
(?blank, vcard:Given, ?givenName),
(?x, v:age, ?age)
AND ?age > 30
USING vcard FOR ";
RdqlEngine::writeQueryResultAsHtmlTable($result3);
echo " ";
// Yet another query: "find the private telephone number of the person
// whose office number is '+1 111 2222 668' and return additionally his given name and age"
$query3 = '
SELECT ?givenName ?age ?telNumberHome
WHERE (?person vcard:N ?blank1)
(?blank1 vcard:Given ?givenName)
(?person v:age ?age)
(?person vcard:TEL ?blank2)
(?blank2 rdf:value ?telNumberHome)
(?blank2 rdf:type vcard:home)
(?person vcard:TEL ?blank3)
(?blank3 rdf:value ?telNumberOffice)
(?blank3 rdf:type vcard:work)
AND ?telNumberOffice eq "+1 111 2222 668"
USING vcard FOR ";
RdqlEngine::writeQueryResultAsHtmlTable($result4);
echo " ";
// Next query: find the resources which represent employees whose family name starts with 'M' and return additionally the corresponding office email address
$query4 = '
SELECT ?resource, ?email
WHERE (?resource, vcard:N, ?blank1)
(?blank1, vcard:Family, ?familyName)
(?resource, vcard:EMAIL, ?blank2)
(?blank2, rdf:value, ?email)
(?blank2, rdf:type, vcard:work)
AND ?familyName ~~ "/^M/"
USING vcard FOR ";
RdqlEngine::writeQueryResultAsHtmlTable($result5);
?>
Query1: 'find the full name of all employees'. Output:
Query2: 'find the given name and age of all employees over 30.' Output:
Query3: 'find the private telephone number of the person whose office number is '+1 111 2222 668' and return additionally his given name and age'. Output:
Query4: 'find the resources which represent employees whose family name starts with \"M\" and return additionally the corresponding office email address'. Output: