Setting up the model:
//change the RDFAPI_INCLUDE_DIR to your local settings // Some definitions // Create an empty Model // Create the resources // Add the property // Retrieve the John Smith vcard resource from the model // Retrieve the value of the FN property // Add two nickname properties to vcard |
// List the nicknames |
Known nicknames for John Smith:
Smithy
Adman
echo '<BR><b>Iterate over all subjects which having FN property:</b><br>'; |
Iterate over all subjects which having FN property:
http://somewhere/JohnSmith
Create a Bag:
// Create a bag $beckySmith = $model->createResource('http://somewhere/BeckySmith'); // Add persons to bag |
// Print out the full names of the members of the bag |
Print out the full names of the members of the bag:
Becky Smith
John Smith
echo '<BR><BR>All Statements as HTML table'; |
All Statements as HTML table
Base URI: |
Size: 7 |
||
No. |
Subject |
Predicate |
Object |
1. |
Resource: http://somewhere/JohnSmith |
Resource: http://www.w3.org/2001/vcard-rdf/3.0#FN |
Literal: John Smith |
2. |
Resource: http://somewhere/JohnSmith |
Resource: http://www.w3.org/2001/vcard-rdf/3.0#NICKNAME |
Literal: Smithy |
3. |
Resource: http://somewhere/JohnSmith |
Resource: http://www.w3.org/2001/vcard-rdf/3.0#NICKNAME |
Literal: Adman |
4. |
Resource: http://somewhere/BeckySmith |
Resource: http://www.w3.org/2001/vcard-rdf/3.0#FN |
Literal: Becky Smith |
5. |
Blank Node: bNode1 |
RDF Node: http://www.w3.org/1999/02/22-rdf-syntax-ns#type |
RDF Node: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag |
6. |
Blank Node: bNode1 |
RDF Node: http://www.w3.org/1999/02/22-rdf-syntax-ns#_1 |
Resource: http://somewhere/BeckySmith |
7. |
Blank Node: bNode1 |
RDF Node: http://www.w3.org/1999/02/22-rdf-syntax-ns#_2 |
Resource: http://somewhere/JohnSmith |