This example is part of the RAP - Rdf API for PHP documentation.
Set the system DSN for the particular database file (control pannel -> administrative
tools -> data sources (odbc) -> system DSN).
|
Read more about Setting Database Connection.
|
Note: | getModel() loads into memory only the modelURI and a database internal modelID, it also sets a database connection for the DbModel. This saves main memory and allows to gain advantage of database's indexing capabilities. |
Output:
Base URI: http://www.w3.org/Home/Lassila.rdf# |
Size: 4 |
||
No. |
Subject |
Predicate |
Object |
1. |
Resource: http://www.w3.org/Home/Lassila |
Resource: http://description.org/schema/Creator |
Blank Node: b85740 |
2. |
Blank Node: b85740 |
RDF Node: http://www.w3.org/1999/02/22-rdf-syntax-ns#type |
Resource: http://description.org/schema/Person |
3. |
Blank Node: b85740 |
Resource: http://example.org/stuff/1.0/Name |
Literal: Ora Lassila (rdf:datatype="http://www.w3.org/TR/xmlschema-2#string") |
4. |
Blank Node: b85740 |
Resource: http://example.org/stuff/1.0/Email |
Literal: lassila@w3.org |
|
Output:
MemModel[baseURI=http://www.w3.org/Home/Lassila.rdf#; size=5] Triple(Resource("http://www.w3.org/Home/Lassila"), Resource("http://description.org/schema/Creator"), bNode("b85740")) Triple(bNode("b85740"), Resource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), Resource("http://description.org/schema/Person")) Triple(bNode("b85740"), Resource("http://example.org/stuff/1.0/Name"), Literal("Ora Lassila", datatype="http://www.w3.org/TR/xmlschema-2#string")) Triple(bNode("b85740"), Resource("http://example.org/stuff/1.0/Email"), Literal("lassila@w3.org")) Triple(Resource("http://www.w3.org/Home/Lassila"), Resource("http://description.org/schema/Description"), Literal("Lassilas persönliche Homepage", lang="de"))
|
Output:
Base URI: http://www.w3.org/Home/Lassila.rdf# |
Size: 1 |
||
No. |
Subject |
Predicate |
Object |
1. |
Resource: http://www.w3.org/Home/Lassila |
Resource: http://description.org/schema/Description |
Literal: Lassilas persönliche Homepage (xml:lang="de") |
|
Output:
<?xml version='1.0' encoding='UTF-8'?>
|
Output:
Base URI: http://www.w3.org/Home/Lassila.rdf# |
Size: 4 |
||
No. |
Subject |
Predicate |
Object |
1. |
Resource: http://www.w3.org/Home/Lassila |
Resource: http://description.org/schema/Creator |
Blank Node: b85740 |
2. |
Blank Node: b85740 |
RDF Node: http://www.w3.org/1999/02/22-rdf-syntax-ns#type |
Resource: http://description.org/schema/Person |
3. |
Blank Node: b85740 |
Resource: http://example.org/stuff/1.0/Name |
Literal: Ora Lassila (rdf:datatype="http://www.w3.org/TR/xmlschema-2#string") |
4. |
Blank Node: b85740 |
Resource: http://example.org/stuff/1.0/Email |
Literal: lassila@w3.org |
|
Output:
models are equal
|
Output:
Files: Output.rdf