RDF is an XML-based language for describing information contained in a Web resource. It is the special "markup file" that enables smart agents to understand and process Web content.
RDF provides a basis for coding, exchanging, and reusing structured metadata, making the vision of the Semantic Web a reality.
A resource is anything that is being described by RDF expressions:
The name of a resource must be global. If you have a doubt that someone else might use the same name to refer to something else, then you cannot use that name.
Breakdown:
This URI uniquely identifies a Nikon D70 camera globally.
A property is a resource that has a name and can be used to describe some specific aspect, characteristic, attribute, or relation of another resource.
This property describes the weight of a camera.
Since properties are also resources, they follow the same naming conventions and must be globally unique using URIs.
Knowledge (or information) is expressed as a statement in the form of subject-predicate-object, and this order should never be changed.
Can be interpreted as:
Full form:
Using namespace abbreviation:
| Subject | Predicate | Object |
|---|---|---|
| mySLR:Nikon-D70 | mySLR:weight | 1.4 lb |
| Subject | Predicate | Object |
|---|---|---|
| mySLR:Nikon-D70 | mySLR:weight | 1.4 lb |
| mySLR:Nikon-D70 | mySLR:pixel | 6.1 M |
| mySLR:Nikon-D50 | mySLR:weight | 1.3 lb |
Question: What properties did we define for Nikon D70?
Properties found:
The machine can perform useful work based on the RDF statements!
Even with simple statements, machines can draw inferences and answer questions without understanding the specific meaning of the content.
RDF has an extremely small vocabulary set:
RDF
Description
ID
about
parseType
resource
nodeID
datatype
Seq
Bag
Alt
Statement
Property
XMLLiteral
List
subject
predicate
object
type
value
first
rest
_n
nil
Key Insight: The small vocabulary size makes RDF easy to learn and implement, while still being powerful enough to express any knowledge.
The complete URI for the subject is constructed as:
Result: http://www.yuchen.net/rdf/NikonD70.rdf#Nikon-D70
rdf:Description - Generic element for describing any resourcerdf:about - Specifies the URI of the resource being describedrdf:type - Indicates the class/type of the resourcerdf:resource - Points to another resource as a property valueAlways use rdf:about with absolute URIs to ensure resources are uniquely identified regardless of document location.
Anonymous resources that serve as containers for properties but don't need their own identity. They exist only to provide structure.
The inner <rdf:Description> has no rdf:about - it's a blank node!
<rdf:Description> without ID<weight rdf:parseType="Resource"><rdf:Description rdf:nodeID="node1">Anonymous resources cannot be aggregated because there's no way to identify them across different documents.
Without explicit type information, we can't be sure how to interpret values:
Is this a decimal? A string? An integer with a typo?
Better with XML entities:
xsd:integer, xsd:decimal, xsd:string, xsd:dateThe name of a resource must be global. If you have a doubt that someone else might use the same name to refer to something else, then you cannot use that name.
This ensures that the same URI always refers to the same concept everywhere.
Knowledge is expressed as a statement in the form of subject-predicate-object, and this order should never be changed.
This fixed structure enables machines to process and understand RDF statements.
I can talk about any resource at my will. If I choose to use an existing URI to identify the resource I am talking about, then:
This rule enables distributed information aggregation - the key feature that makes the Semantic Web possible!
You want to compare Nikon D70 vs Canon 20D using information from:
Share these URIs with all vendors and reviewers
Your crawler collects all RDF statements and aggregates them by URI, giving you a complete picture with sales data from multiple vendors and multiple reviews - all without a centralized database!
XML is excellent for data exchange, but RDF provides the semantic structure needed for machine understanding and reasoning.
Dublin Core is a standardized set of metadata elements for describing documents and resources on the Web.
dc:title - The name of the resourcedc:creator - The person or organization responsible for creating the contentdc:subject - The topic of the resourcedc:description - An account of the resourcedc:date - A date associated with the resourcedc:type - The nature or genre of the resourceAlways search for existing vocabularies before creating your own. Using standard vocabularies like Dublin Core ensures your data can be understood by existing tools and applications.
RDF enables a Web where:
To fully realize the Semantic Web vision, we need to add vocabularies and schemas that define the meaning of classes and properties. This is where RDFS (RDF Schema) and OWL (Web Ontology Language) come in!
RDF is the foundation - now you're ready to build on it.