40 | | * Simple example: rdf:Description element defines the subject, rdf:about attribute defines a resource that is the subject. rdfs:label, for example, attaches a human readable label to a subject. |
41 | | * Example with more namespaces: subject is now defined on element foaf:Person (again by rdf:about), subject has multiple predicates: foaf:name (his name), foaf:page (which in turn encloses another triple: foaf:Document => dc:title => literal) |
| 40 | * Simple example: rdf:Description element defines the subject, rdf:about attribute defines a resource that is the subject. rdfs:label, for example, attaches a human readable label to a subject. |
| 41 | |
| 42 | XML representation of RDF: |
| 43 | {{{ |
| 44 | <rdf:RDF |
| 45 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| 46 | xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> |
| 47 | |
| 48 | <rdf:Description rdf:about="http://elmonline.ca/luke"> |
| 49 | <rdfs:label>Luke McCarthy's web page</rdfs:label> |
| 50 | </rdf:Description> |
| 51 | |
| 52 | </rdf:RDF> |
| 53 | }}} |
| 54 | |
| 55 | Expanded human-readable representation: |
| 56 | subject: <http://elmonline.ca/luke> |
| 57 | predicate: 'rdfs:label' => <http://http://www.w3.org/2000/01/rdf-schema#label> |
| 58 | object: "Luke McCarthy's web page" |
| 59 | |
| 60 | Condensed human-readable representation: |
| 61 | <http://elmonline.ca/luke> <http://www.w3.org/2000/01/rdf-schema#label> "Luke McCarthy's blog" |
| 62 | |
| 63 | * Example with more namespaces: subject is now defined on element foaf:Person (again by rdf:about), subject has multiple predicates: foaf:name (his name), foaf:page (which in turn encloses another object: foaf:Document => dc:title => literal) |
| 64 | |
| 65 | XML representation of RDF: |
| 66 | {{{ |
| 67 | <rdf:RDF |
| 68 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| 69 | xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" |
| 70 | xmlns:foaf="http://xmlns.com/foaf/0.1/" |
| 71 | xmlns:dc="http://purl.org/dc/elements/1.1/"> |
| 72 | |
| 73 | <foaf:Person rdf:about="http://sw.elmonline.ca/luke"> |
| 74 | <foaf:name>Luke McCarthy</foaf:name> |
| 75 | <foaf:page> |
| 76 | <foaf:Document rdf:about="http://elmonline.ca/luke"> |
| 77 | <dc:title>Luke McCarthy's web page</dc:title> |
| 78 | </foaf:Document> |
| 79 | </foaf:page> |
| 80 | </foaf:Person> |
| 81 | |
| 82 | </rdf:RDF> |
| 83 | }}} |
| 84 | |
| 85 | Condensed human-readable representation: |
| 86 | <http://sw.elmonline.ca/luke> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . |
| 87 | <http://sw.elmonline.ca/luke> <http://xmlns.com/foaf/0.1/name> "Luke McCarthy" . |
| 88 | <http://sw.elmonline.ca/luke> <http://xmlns.com/foaf/0.1/page> <http://elmonline.ca/luke> . |
| 89 | <http://elmonline.ca/luke> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Document> . |
| 90 | <http://elmonline.ca/luke> <http://purl.org/dc/elements/1.1/title> "Luke McCarthy's web page" |
| 91 | |
43 | | * Biological example: a !UniProt record |
| 93 | |
| 94 | XML representation of RDF: |
| 95 | {{{ |
| 96 | <rdf:RDF |
| 97 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| 98 | xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" |
| 99 | xmlns:foaf="http://xmlns.com/foaf/0.1/" |
| 100 | xmlns:dc="http://purl.org/dc/elements/1.1/" |
| 101 | xmlns:rss="http://purl.org/rss/1.0/" |
| 102 | xmlns:html="http://www.w3.org/1999/xhtml"> |
| 103 | |
| 104 | <foaf:Agent rdf:nodeID="id2246148"> |
| 105 | <foaf:name>Tim Berners-Lee</foaf:name> |
| 106 | <foaf:weblog> |
| 107 | <foaf:Document rdf:about="http://dig.csail.mit.edu/breadcrumbs/blog/4"> |
| 108 | <dc:title>Tim Berners-Lee</dc:title> |
| 109 | <rdfs:seeAlso> |
| 110 | <rss:channel rdf:about="http://dig.csail.mit.edu/breadcrumbs/blog/feed/4"> |
| 111 | <foaf:maker rdf:nodeID="id2246148"/> |
| 112 | <foaf:topic rdf:resource="http://www.w3.org/2001/sw/"/> |
| 113 | <foaf:topic rdf:resource="http://www.w3.org/RDF/"/> |
| 114 | </rss:channel> |
| 115 | </rdfs:seeAlso> |
| 116 | </foaf:Document> |
| 117 | </foaf:weblog> |
| 118 | <foaf:interest rdf:resource="http://www.w3.org/2001/sw/"/> |
| 119 | <foaf:interest rdf:resource="http://www.w3.org/RDF/"/> |
| 120 | </foaf:Agent> |
| 121 | |
| 122 | </rdf:RDF> |
| 123 | }}} |
| 124 | |
| 125 | Condensed human-readable representation: |
| 126 | <id2246148> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . |
| 127 | <id2246148> <http://xmlns.com/foaf/0.1/name> "Tim Berners-Lee" . |
| 128 | <id2246148> <http://xmlns.com/foaf/0.1/interest> <http://www.w3.org/RDF/> . |
| 129 | <id2246148> <http://xmlns.com/foaf/0.1/interest> <http://www.w3.org/2001/sw/> . |
| 130 | <id2246148> <http://xmlns.com/foaf/0.1/weblog> <http://dig.csail.mit.edu/breadcrumbs/blog/4> . |
| 131 | # this says that there is an Agent named Tim Berners-Lee who is interested in RDF and the Semantic Web and has a weblog (identified by http://dig.csail.mit.edu/breadcrumbs/blog/4) |
| 132 | |
| 133 | <http://dig.csail.mit.edu/breadcrumbs/blog/4> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Document> . |
| 134 | <http://dig.csail.mit.edu/breadcrumbs/blog/4> <http://purl.org/dc/elements/1.1/title> "Tim Berners-Lee" . |
| 135 | # this says that the weblog identified above is a Document titled "Tim Berners-Lee" |
| 136 | |
| 137 | <http://dig.csail.mit.edu/breadcrumbs/blog/4> <http://www.w3.org/2000/01/rdf-schema#seeAlso> <http://dig.csail.mit.edu/breadcrumbs/blog/feed/4> . |
| 138 | <http://dig.csail.mit.edu/breadcrumbs/blog/feed/4> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/rss/1.0/channel> . |
| 139 | <http://dig.csail.mit.edu/breadcrumbs/blog/feed/4> <http://xmlns.com/foaf/0.1/maker> <id2246148> . |
| 140 | <http://dig.csail.mit.edu/breadcrumbs/blog/feed/4> <http://xmlns.com/foaf/0.1/topic> <http://www.w3.org/RDF/> . |
| 141 | <http://dig.csail.mit.edu/breadcrumbs/blog/feed/4> <http://xmlns.com/foaf/0.1/topic> <http://www.w3.org/2001/sw/> . |
| 142 | # this says that the weblog identified by http://dig.csail.mit.edu/breadcrumbs/blog/4 has an alternative representation (rdfs:seeAlso) that is the RSS feed (rss:channel) identified by http://dig.csail.mit.edu/breadcrumbs/blog/feed/4. This feed is about RDF and the Semantic Web and is written by the Agent above (Tim Berners-Lee) |
| 143 | |
| 144 | * Biological example: a !UniProt record: [http://www.uniprot.org/uniprot/P47989.rdf http://www.uniprot.org/uniprot/P47989.rdf] |