Changes between Version 1 and Version 2 of RDF


Ignore:
Timestamp:
11.03.2012 23:32:38 (13 years ago)
Author:
jri
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RDF

    v1 v2  
    55Resource Description Framework 
    66 
    7 Purpose: Make *statements* about *resources*. 
    8  
    9 <http://www.w3.org/RDF/>   
    10  
    11 <http://www.w3.org/TR/rdf-primer/>   
    12 <http://www.w3.org/TR/rdf-concepts/>   
    13 <http://www.w3.org/TR/rdf-syntax-grammar/>   
    14 <http://www.w3.org/TR/rdf-mt/>   
    15 <http://www.w3.org/TR/rdf-schema/>   
    16 <http://www.w3.org/TR/rdf-testcases/> 
    17  
    18 What is fundamental to RDF is the *graph model* of the statements.   
     7Purpose: Make **statements** about **resources**. 
     8 
     9http://www.w3.org/RDF/ 
     10 
     11http://www.w3.org/TR/rdf-primer/\\ 
     12http://www.w3.org/TR/rdf-concepts/\\ 
     13http://www.w3.org/TR/rdf-syntax-grammar/\\ 
     14http://www.w3.org/TR/rdf-mt/\\ 
     15http://www.w3.org/TR/rdf-schema/\\ 
     16http://www.w3.org/TR/rdf-testcases/ 
     17 
     18What is fundamental to RDF is the **graph model** of the statements.\\ 
    1919The notation used to represent or depict the graph is secondary. 
    2020 
    21 <img src="http://www.w3.org/TR/rdf-primer/fig1dec16.png"> 
     21[[Image(http://www.w3.org/TR/rdf-primer/fig1dec16.png)]] 
    2222 
    2323 
     
    2929 
    3030Example 1: 
    31  
     31{{{ 
    3232    <?xml version="1.0"?> 
    3333    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
     
    4141        </rdf:Description> 
    4242    </rdf:RDF> 
    43  
    44 An obvious way to talk about any RDF statement is to say it is a *description*, and that it is *about* the subject of the statement (in this case, about http://www.example.org/index.html). 
     43}}} 
     44An obvious way to talk about any RDF statement is to say it is a //description//, and that it is //about// the subject of the statement (in this case, about http://www.example.org/index.html). 
    4545 
    4646Example 2: 
    47  
     47{{{ 
    4848    <?xml version="1.0"?> 
    4949    <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]> 
     
    6161 
    6262    </rdf:RDF> 
    63  
    64 Here the `rdf:Description` element has an `rdf:ID` attribute instead of an `rdf:about` attribute. Using `rdf:ID` specifies a *fragment identifier* as an abbreviation of the complete URIref of the resource being described. The fragment identifier will be interpreted relative to a base URI. Suppose the RDF/XML document is identified by (and located at) `http://www.example.com/2002/04/products` the full URIref for the resource is `http://www.example.com/2002/04/products#item10245`. 
     63}}} 
     64Here the `rdf:Description` element has an `rdf:ID` attribute instead of an `rdf:about` attribute. Using `rdf:ID` specifies a **fragment identifier** as an abbreviation of the complete URIref of the resource being described. The fragment identifier will be interpreted relative to a base URI. Suppose the RDF/XML document is identified by (and located at) `http://www.example.com/2002/04/products` the full URIref for the resource is `http://www.example.com/2002/04/products#item10245`. 
    6565 
    6666Example 3: 
    67  
     67{{{ 
    6868    <?xml version="1.0"?> 
    6969    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
     
    7676        </contact:Person> 
    7777    </rdf:RDF> 
    78  
    79 RDF/XML provides a special abbreviation for describing *typed nodes*. In this abbreviation, the `rdf:type` property and its value are removed, and the `rdf:Description` element for the node is replaced by an element whose name is the QName corresponding to the value of the removed `rdf:type` property (a URIref that names a class). 
     78}}} 
     79RDF/XML provides a special abbreviation for describing **typed nodes**. In this abbreviation, the `rdf:type` property and its value are removed, and the `rdf:Description` element for the node is replaced by an element whose name is the QName corresponding to the value of the removed `rdf:type` property (a URIref that names a class). 
    8080 
    8181 
    8282== N3 notation == 
    8383 
    84 Another RDF notation is *N3* ("Notation 3", developed by Tim Berners-Lee). 
     84Another RDF notation is **N3** ("Notation 3", developed by Tim Berners-Lee). 
    8585 
    8686N3 Example: 
    87  
     87{{{ 
    8888    @prefix dc: <http://purl.org/dc/elements/1.1/>. 
    8989 
    9090    <http://de.wikipedia.org/wiki/Tim_Berners-Lee> dc:title "Tim Berners-Lee"; 
    9191                                                   dc:publisher "Wikipedia". 
    92  
     92}}} 
    9393Full URIrefs must be enclosed in angle brackets in the triples notation. 
    9494 
     
    100100== Statement == 
    101101 
    102 A statement about a *resource* that states the resource has a certain *property* with a certain *value*. 
     102A statement about a **resource** that states the resource has a certain **property** with a certain **value**. 
    103103A statement consists of 3 parts (a SPO-triple): 
    104104 
     
    113113 
    1141141. An URI  
    115 2. a *fragment identifier* (optional). 
     1152. a **fragment identifier** (optional). 
    116116 
    117117Example: 
    118  
     118{{{ 
    119119    http://www.example.org/index.html#section2 
    120  
     120}}} 
    121121 
    122122== URI == 
     
    148148== Vocabulary == 
    149149 
    150 A *vocabulary* is a set of URIrefs, mostly properties, intended for  
     150A **vocabulary** is a set of URIrefs, mostly properties, intended for  
    151151a specific purpose. It's easy to imagine Property vocabularies  
    152152describing books, videos, pizza joints, fine wines, mutual funds, and  
     
    158158A QName consists of 2 parts (separated by a colon): 
    159159 
    160 1. a *prefix* that has been assigned to a namespace URI 
    161  
    162 2. a *local name* 
     1601. a **prefix** that has been assigned to a namespace URI 
     161 
     1622. a **local name** 
    163163 
    164164The full URIref is formed from the QName by appending the local name to the namespace URI assigned to the prefix. 
    165165 
    166166Example: 
    167  
     167{{{ 
    168168    foo:bar 
    169  
     169}}} 
    170170if the QName prefix `foo` is assigned to the namespace URI `http://example.org/somewhere/`, this QName is shorthand for the URIref `http://example.org/somewhere/bar`. 
    171171 
     
    175175Structured information like a person's address is represented in RDF by considering the aggregate thing to be described as a resource, and then making statements about that new resource. Such resources may never need to be referred to directly from outside a particular graph, and hence may not require "universal" identifiers. 
    176176 
    177 <img src="http://www.w3.org/TR/rdf-primer/fig6may19.png"> 
    178  
    179 Here, the node that stands for the concept of "John Smith's address" has no URIref. In the drawing this *blank node* just provides the necessary connectivity between the various other parts of the graph. (Blank nodes are also called *anonymous resources*.) 
    180  
    181 In the triple representation of a graph *blank node identifiers* have the form `_:name`. Each distinct blank node in the graph is given a different blank node identifier. Two different graphs might independently use the same blank node identifiers, and it would be incorrect to assume that blank nodes from different graphs having the same blank node identifiers are the same. 
     177[[Image(http://www.w3.org/TR/rdf-primer/fig6may19.png)]] 
     178 
     179Here, the node that stands for the concept of "John Smith's address" has no URIref. In the drawing this **blank node** just provides the necessary connectivity between the various other parts of the graph. (Blank nodes are also called //anonymous resources//.) 
     180 
     181In the triple representation of a graph **blank node identifiers** have the form `_:name`. Each distinct blank node in the graph is given a different blank node identifier. Two different graphs might independently use the same blank node identifiers, and it would be incorrect to assume that blank nodes from different graphs having the same blank node identifiers are the same. 
    182182 
    183183Example: 
    184  
     184{{{ 
    185185    exstaff:85740   exterms:address         _:johnaddress . 
    186186    _:johnaddress   exterms:street          "1501 Grant Avenue" . 
     
    188188    _:johnaddress   exterms:state           "Massachusetts" . 
    189189    _:johnaddress   exterms:postalCode      "01730" . 
    190  
     190}}} 
    191191Hint: RDF directly represents only binary relationships. The 5-way relationship (between John and the 4 address components) must be broken up into a group of separate binary relationships. Blank nodes provide one way to do this. 
    192192 
     
    195195= RDF Schema = 
    196196 
    197 <http://www.w3.org/TR/rdf-schema/> 
    198  
    199 RDF Schema provides a *type system* for RDF. 
     197http://www.w3.org/TR/rdf-schema/ 
     198 
     199RDF Schema provides a **type system** for RDF. 
    200200 
    201201The RDF Schema type system is similar in some respects to the type  
    202202systems of object-oriented programming languages such as Java. For  
    203203example, RDF Schema allows resources to be defined as instances of one  
    204 or more *classes*. In addition, it allows classes to be organized  
     204or more **classes**. In addition, it allows classes to be organized  
    205205in a hierarchical fashion; for example a class `ex:Dog` might be defined  
    206206as a subclass of `ex:Mammal` which is a subclass of `ex:Animal`, meaning  
     
    224224 
    225225Describing a class (example): 
    226  
     226{{{ 
    227227    ex:MotorVehicle   rdf:type   rdfs:Class . 
    228  
     228}}} 
    229229(using ex: to stand for the URIref `http://www.example.org/schemas/vehicles`) 
    230230 
    231231Describing an instance (example): 
    232  
     232{{{ 
    233233    exthings:companyCar   rdf:type   ex:MotorVehicle . 
    234  
     234}}} 
    235235Common convention: 
    236236 
     
    238238- property and instance names are written with an initial lowercase letter. 
    239239 
    240 ### Subclass 
     240=== Subclass === 
    241241 
    242242Specialization (example): 
    243  
     243{{{ 
    244244    ex:Van   rdf:type          rdfs:Class . 
    245245    ex:Van   rdfs:subClassOf   ex:MotorVehicle . 
    246  
     246}}} 
    247247A class may be a subclass of more than one class. 
    248248 
    249249Schema in RDF/XML notation (example): 
    250  
     250{{{ 
    251251    <?xml version="1.0"?> 
    252252    <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]> 
     
    272272 
    273273    </rdf:RDF> 
    274  
     274}}} 
    275275 
    276276== Properties == 
     
    281281 
    282282Describing a property (example): 
    283  
     283{{{ 
    284284    exterms:weightInKg   rdf:type   rdf:Property . 
    285  
     285}}} 
    286286=== Range === 
    287287 
     
    289289 
    290290A property with instances as values (example): 
    291  
     291{{{ 
    292292    ex:Person   rdf:type     rdfs:Class . 
    293293    ex:author   rdf:type     rdf:Property . 
    294294    ex:author   rdfs:range   ex:Person . 
    295  
    296 A property can have zero, one, or more than one range property. In case of many: the values of the property are resources that are instances of *all* of the classes specified as the ranges. 
     295}}} 
     296A property can have zero, one, or more than one range property. In case of many: the values of the property are resources that are instances of //all// of the classes specified as the ranges. 
    297297 
    298298A property with 2 ranges (example): 
    299  
     299{{{ 
    300300    ex:hasMother   rdfs:range   ex:Female . 
    301301    ex:hasMother   rdfs:range   ex:Person . 
    302  
     302}}} 
    303303A property with a typed literal value (example, `xsd:integer` is a XML Schema datatype): 
    304  
     304{{{ 
    305305    ex:age   rdf:type     rdf:Property . 
    306306    ex:age   rdfs:range   xsd:integer . 
    307  
     307}}} 
    308308=== Domain === 
    309309 
    310310The `rdfs:domain` property is used to indicate that a particular property applies to a designated class. 
    311  
     311{{{ 
    312312    ex:Book     rdf:type      rdfs:Class . 
    313313    ex:author   rdf:type      rdf:Property . 
    314314    ex:author   rdfs:domain   ex:Book . 
    315  
    316 A property may have zero, one, or more than one domain property. In case of many: this says that any resource that has the property is an instance of *all* of the classes specified as the domains. 
     315}}} 
     316A property may have zero, one, or more than one domain property. In case of many: this says that any resource that has the property is an instance of //all// of the classes specified as the domains. 
    317317 
    318318A property with 2 domains (in RDFs this is a nonsense example!!): 
    319  
     319{{{ 
    320320    exterms:weight   rdfs:domain   ex:Book . 
    321321    exterms:weight   rdfs:domain   ex:MotorVehicle . 
    322  
     322}}} 
    323323RDF/XML notation (to be added to Classes example above): 
    324  
     324{{{ 
    325325    <rdf:Property rdf:ID="registeredTo"> 
    326326        <rdfs:domain rdf:resource="#MotorVehicle"/> 
     
    336336 
    337337    <rdfs:Datatype rdf:about="&xsd;integer"/> 
    338  
     338}}} 
    339339=== Subproperty === 
    340340 
     
    342342 
    343343Describing a subproperty (example): 
    344  
     344{{{ 
    345345    ex:driver          rdf:type             rdf:Property . 
    346346    ex:primaryDriver   rdf:type             rdf:Property . 
    347347    ex:primaryDriver   rdfs:subPropertyOf   ex:driver . 
    348  
     348}}} 
    349349The meaning of this `rdfs:subPropertyOf` relationship is that if an instance `exstaff:fred` is an `ex:primaryDriver` of the instance `ex:companyVan`, then RDF Schema defines `exstaff:fred` as also being an `ex:driver` of `ex:companyVan`. 
    350350 
    351351All RDF Schema `rdfs:range` and `rdfs:domain` properties that apply to an RDF property also apply to each of its subproperties. 
    352  
     352{{{ 
    353353RDF/XML notation (to be added to Classes example above): 
    354354 
     
    360360        <rdfs:subPropertyOf rdf:resource="#driver"/> 
    361361    </rdf:Property> 
    362  
     362}}} 
    363363 
    364364== Describing an instance (complex example) == 
    365  
     365{{{ 
    366366    <?xml version="1.0"?> 
    367367    <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]> 
     
    376376        </ex:PassengerVehicle> 
    377377    </rdf:RDF> 
    378  
    379 Note that a typed literal is used for the value of the `ex:rearSetLegRoom` property in this instance, rather than a plain literal (i.e., rather than stating the value as `<ex:rearSeatLegRoom>127</ex:rearSeatLegRoom>`). Because the schema describes the range of this property as an `xsd:integer`, the value of the property should be a typed literal of that datatype in order to match the range description (i.e., the range declaration does *not* automatically "assign" a datatype to a plain literal, and so a typed literal of the appropriate datatype must be explicitly provided). 
     378}}} 
     379Note that a typed literal is used for the value of the `ex:rearSetLegRoom` property in this instance, rather than a plain literal (i.e., rather than stating the value as `<ex:rearSeatLegRoom>127</ex:rearSeatLegRoom>`). Because the schema describes the range of this property as an `xsd:integer`, the value of the property should be a typed literal of that datatype in order to match the range description (i.e., the range declaration does //not// automatically "assign" a datatype to a plain literal, and so a typed literal of the appropriate datatype must be explicitly provided). 
    380380 
    381381 
     
    383383= Dublin Core Metadata Initiative (DCMI) = 
    384384 
    385 <http://dublincore.org/> 
     385http://dublincore.org/ 
    386386 
    387387The Dublin Core metadata set is intended to be suitable for use by resource discovery tools on the Internet, such as the "Webcrawlers" employed by popular World Wide Web search engines. An real-world application of RDF. 
    388388 
    389389The four currently approved DCMI namespace URIs are: 
    390  
     390{{{ 
    391391    http://purl.org/dc/terms/           All DCMI properties, classes and encoding schemes 
    392     http://purl.org/dc/dcmitype/            Classes in the DCMI Type Vocabulary 
     392    http://purl.org/dc/dcmitype/        Classes in the DCMI Type Vocabulary 
    393393    http://purl.org/dc/dcam/            Terms used in the DCMI Abstract Model 
    394394    http://purl.org/dc/elements/1.1/    The Dublin Core Metadata Element Set, Version 1.1 (original 15 elements) 
     395}}}