XML RDF (Resource Description Framework)ο
RDF (Resource Description Framework) is a standard model for data interchange on the web. It enables structured and semi-structured data to be mixed, shared, and reused across different applications.
RDF uses an XML-based format when serialized as RDF/XML, meaning it follows XML rules to describe relationships between resources.
β
What is RDF?ο
π Describes Resources: RDF describes resources (like a book, person, or website) using triples β sets of three pieces of information.
π Triple Structure: - Subject: The resource being described. - Predicate: The property or characteristic of the resource. - Object: The value of that property.
π Web-Friendly: Specifically designed to link and connect data across the web (Semantic Web).
β
Basic Structure of RDF/XMLο
An RDF/XML document typically looks like this:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.com/">
<rdf:Description rdf:about="http://example.com/book1">
<ex:title>Learning XML</ex:title>
<ex:author>John Doe</ex:author>
<ex:published>2024-05-01</ex:published>
</rdf:Description>
</rdf:RDF>
β
Understanding the Exampleο
Root Element:
<rdf:RDF>acts as the container for RDF data.Namespaces: Defined using xmlns: to distinguish between different vocabularies (e.g., rdf, ex).
Resource Description: Each resource is described with a
<rdf:Description>element.
Breakdown of the Example:
Subject: http://example.com/book1 (the book being described)
Predicate: ex:title, ex:author, ex:published (the properties)
Object:
XML RDF (Resource Description Framework)ο
RDF (Resource Description Framework) is a standard model for data interchange on the web. It allows structured and semi-structured data to be mixed, shared, and reused across different applications.
RDF is XML-based when serialized using RDF/XML syntax β meaning it follows XML rules to describe relationships between resources.
β
What is RDF?
π Describes Resources: RDF describes resources (like a book, person, or website) using triples (subject, predicate, object).
π Triple Structure: - Subject: The resource being described. - Predicate: The property or characteristic of the resource. - Object: The value of the property.
π Web-Friendly: Designed for linking data across the web (Semantic Web).
β
Basic Structure of RDF/XML
An RDF/XML document typically looks like this:
```xml <?xml version=β1.0β?> <rdf:RDF xmlns:rdf=βhttp://www.w3.org/1999/02/22-rdf-syntax-ns#β
xmlns:ex=βhttp://example.com/β>
- <rdf:Description rdf:about=βhttp://example.com/book1β>
<ex:title>Learning XML</ex:title> <ex:author>John Doe</ex:author> <ex:published>2024-05-01</ex:published>
</rdf:Description>
</rdf:RDF>
The root element is <rdf:RDF>.
Namespaces are used (xmlns:rdf and xmlns:ex) to identify vocabularies.
Each resource is described with a <rdf:Description> element.
- Explained with Example:
Subject: http://example.com/book1 (the book resource)
Predicate: ex:title, ex:author, ex:published (properties)
Object: βLearning XMLβ, βJohn Doeβ, β2024-05-01β (property values)
Why Use RDF?ο
β Data Integration: Connects information from different sources. β Machine-Readable: Easy for programs to understand and process. β Extensible: New properties can be added without breaking the model. β Semantic Web Foundation: Core technology behind the semantic web (Web 3.0).