एक्सएमएल आरडीएफ
आरडीएफ दस्तावेज़ उदाहरण
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:si="https://www.w3schools.com/rdf/">
<rdf:Description rdf:about="https://www.w3schools.com">
<si:title>W3Schools</si:title>
<si:author>Jan Egil Refsnes</si:author>
</rdf:Description>
</rdf:RDF>
आरडीएफ क्या है?
- आरडीएफ का मतलब आर ईसोर्स डी एसक्रिप्शन एफ रैमवर्क है
- RDF वेब पर संसाधनों का वर्णन करने के लिए एक ढांचा है
- RDF को कंप्यूटर द्वारा पढ़ने और समझने के लिए डिज़ाइन किया गया है
- RDF लोगों को प्रदर्शित करने के लिए नहीं बनाया गया है
- RDF XML में लिखा है
- RDF W3C की सिमेंटिक वेब गतिविधि का एक हिस्सा है
- RDF 10 फरवरी 2004 से W3C अनुशंसा है
आरडीएफ - उपयोग के उदाहरण
- खरीदारी की वस्तुओं के गुणों का वर्णन करना, जैसे कि मूल्य और उपलब्धता
- वेब घटनाओं के लिए समय सारिणी का वर्णन
- वेब पेजों के बारे में जानकारी का वर्णन करना (सामग्री, लेखक, निर्मित और संशोधित तिथि)
- वेब चित्रों के लिए सामग्री और रेटिंग का वर्णन करना
- खोज इंजन के लिए सामग्री का वर्णन
- इलेक्ट्रॉनिक पुस्तकालयों का वर्णन
RDF को कंप्यूटर द्वारा पढ़ने के लिए डिज़ाइन किया गया है
RDF को सूचना का वर्णन करने का एक सामान्य तरीका प्रदान करने के लिए डिज़ाइन किया गया था ताकि इसे कंप्यूटर अनुप्रयोगों द्वारा पढ़ा और समझा जा सके।
RDF विवरण वेब पर प्रदर्शित करने के लिए डिज़ाइन नहीं किए गए हैं।
RDF XML में लिखा गया है
RDF दस्तावेज़ XML में लिखे गए हैं। RDF द्वारा उपयोग की जाने वाली XML भाषा RDF/XML कहलाती है।
XML का उपयोग करके, विभिन्न प्रकार के ऑपरेटिंग सिस्टम और एप्लिकेशन भाषाओं का उपयोग करके विभिन्न प्रकार के कंप्यूटरों के बीच RDF सूचनाओं का आसानी से आदान-प्रदान किया जा सकता है।
आरडीएफ और "द सिमेंटिक वेब"
RDF भाषा W3C की सिमेंटिक वेब गतिविधि का एक हिस्सा है। W3C का "सिमेंटिक वेब विजन" एक ऐसा भविष्य है जहां:
- वेब जानकारी का सटीक अर्थ है
- वेब जानकारी को कंप्यूटर द्वारा समझा और संसाधित किया जा सकता है
- कंप्यूटर वेब से जानकारी को एकीकृत कर सकते हैं
RDF संसाधनों की पहचान करने के लिए वेब पहचानकर्ताओं (URI) का उपयोग करता है।
RDF गुणों और संपत्ति मूल्यों के साथ संसाधनों का वर्णन करता है।
आरडीएफ संसाधन, संपत्ति और संपत्ति मूल्य
RDF वेब आइडेंटिफ़ायर (URI) का उपयोग करके चीजों की पहचान करता है, और गुणों और संपत्ति मूल्यों के साथ संसाधनों का वर्णन करता है।
संसाधन, संपत्ति और संपत्ति मूल्य की व्याख्या:
- एक संसाधन कुछ भी है जिसमें यूआरआई हो सकता है, जैसे "https://www.w3schools.com/rdf"
- संपत्ति एक ऐसा संसाधन है जिसका एक नाम होता है, जैसे "लेखक" या "मुखपृष्ठ"
- एक संपत्ति मूल्य एक संपत्ति का मूल्य है, जैसे "Jan Egil Refsnes" या "https://www.w3schools.com" (ध्यान दें कि एक संपत्ति मूल्य एक अन्य संसाधन हो सकता है)
निम्नलिखित RDF दस्तावेज़ "https://www.w3schools.com/rdf" संसाधन का वर्णन कर सकता है:
<?xml version="1.0"?>
<RDF>
<Description about="https://www.w3schools.com/rdf">
<author>Jan Egil Refsnes</author>
<homepage>https://www.w3schools.com</homepage>
</Description>
</RDF>
ऊपर दिए गए उदाहरण को सरल बनाया गया है। नामस्थान छोड़े गए हैं।
आरडीएफ विवरण
एक संसाधन, एक संपत्ति, और एक संपत्ति मूल्य का संयोजन एक वक्तव्य बनाता है (जिसे एक वक्तव्य के विषय, विधेय और वस्तु के रूप में जाना जाता है)।
आइए बेहतर समझ पाने के लिए कुछ उदाहरण कथन देखें:
कथन: "https://www.w3schools.com/rdf के लेखक जान एगिल रेफ्सनेस हैं"।
- उपरोक्त कथन का विषय है: https://www.w3schools.com/rdf
- विधेय है: लेखक
- उद्देश्य है: जन एगिल रेफ्सनेस
कथन: "https://www.w3schools.com/rdf का होमपेज https://www.w3schools.com है"।
- उपरोक्त कथन का विषय है: https://www.w3schools.com/rdf
- विधेय है: होमपेज
- उद्देश्य है: https://www.w3schools.com
आरडीएफ उदाहरण
यहाँ एक सीडी-सूची से दो रिकॉर्ड हैं:
Title | Artist | Country | Company | Price | Year |
---|---|---|---|---|---|
Empire Burlesque | Bob Dylan | USA | Columbia | 10.90 | 1985 |
Hide your heart | Bonnie Tyler | UK | CBS Records | 9.90 | 1988 |
RDF दस्तावेज़ से कुछ पंक्तियाँ नीचे दी गई हैं:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
<cd:artist>Bob Dylan</cd:artist>
<cd:country>USA</cd:country>
<cd:company>Columbia</cd:company>
<cd:price>10.90</cd:price>
<cd:year>1985</cd:year>
</rdf:Description>
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Hide your heart">
<cd:artist>Bonnie Tyler</cd:artist>
<cd:country>UK</cd:country>
<cd:company>CBS Records</cd:company>
<cd:price>9.90</cd:price>
<cd:year>1988</cd:year>
</rdf:Description>
.
.
.
</rdf:RDF>
RDF दस्तावेज़ की पहली पंक्ति XML घोषणा है। XML घोषणा के बाद RDF दस्तावेज़ों का मूल तत्व होता है: <rdf:RDF> ।
Xmlns:rdf नेमस्पेस , निर्दिष्ट करता है कि rdf उपसर्ग वाले तत्व नामस्थान "http://www.w3.org/1999/02/22-rdf-syntax-ns#" से हैं।
Xmlns:cd नाम स्थान, निर्दिष्ट करता है कि cd उपसर्ग वाले तत्व नामस्थान "http://www.recshop.fake/cd#" से हैं।
<rdf:Description> तत्व में rdf द्वारा पहचाने गए संसाधन का विवरण होता है : विशेषता के बारे में ।
तत्व: <सीडी:कलाकार>, <सीडी:देश>, <सीडी:कंपनी>, आदि संसाधन के गुण हैं।
आरडीएफ ऑनलाइन सत्यापनकर्ता
RDF सीखते समय W3C की RDF सत्यापन सेवा उपयोगी होती है। यहां आप आरडीएफ फाइलों के साथ प्रयोग कर सकते हैं।
ऑनलाइन RDF Validator आपके RDF दस्तावेज़ को पार्स करता है, आपके सिंटैक्स की जाँच करता है, और आपके RDF दस्तावेज़ के सारणीबद्ध और चित्रमय दृश्य उत्पन्न करता है।
नीचे दिए गए उदाहरण को W3C के RDF सत्यापनकर्ता में कॉपी और पेस्ट करें:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:si="https://www.w3schools.com/rdf/">
<rdf:Description rdf:about="https://www.w3schools.com">
<si:title>W3Schools.com</si:title>
<si:author>Jan Egil Refsnes</si:author>
</rdf:Description>
</rdf:RDF>
जब आप ऊपर दिए गए उदाहरण को पार्स करते हैं, तो परिणाम कुछ इस तरह दिखाई देगा ।
आरडीएफ तत्व
RDF के मुख्य तत्व मूल तत्व, <RDF>, और <विवरण> तत्व हैं, जो एक संसाधन की पहचान करते हैं।
<rdf:RDF> तत्व
<rdf:RDF> RDF दस्तावेज़ का मूल तत्व है। यह XML दस्तावेज़ को RDF दस्तावेज़ के रूप में परिभाषित करता है। इसमें आरडीएफ नेमस्पेस का संदर्भ भी शामिल है:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
...Description goes here...
</rdf:RDF>
<rdf:विवरण>तत्व
<rdf:Description> तत्व के बारे में विशेषता वाले संसाधन की पहचान करता है।
<rdf:Description> तत्व में ऐसे तत्व होते हैं जो संसाधन का वर्णन करते हैं:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
<cd:artist>Bob Dylan</cd:artist>
<cd:country>USA</cd:country>
<cd:company>Columbia</cd:company>
<cd:price>10.90</cd:price>
<cd:year>1985</cd:year>
</rdf:Description>
</rdf:RDF>
तत्व, कलाकार, देश, कंपनी, मूल्य और वर्ष को http://www.recshop.fake/cd# नाम स्थान में परिभाषित किया गया है। यह नाम स्थान RDF के बाहर है (और RDF का भाग नहीं है)। RDF केवल ढांचे को परिभाषित करता है। तत्वों, कलाकार, देश, कंपनी, मूल्य और वर्ष को किसी और (कंपनी, संगठन, व्यक्ति, आदि) द्वारा परिभाषित किया जाना चाहिए।
गुण के रूप में गुण
संपत्ति तत्वों को विशेषताओं (तत्वों के बजाय) के रूप में भी परिभाषित किया जा सकता है:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Empire Burlesque"
cd:artist="Bob Dylan" cd:country="USA"
cd:company="Columbia" cd:price="10.90"
cd:year="1985" />
</rdf:RDF>
संसाधन के रूप में गुण
संपत्ति तत्वों को संसाधनों के रूप में भी परिभाषित किया जा सकता है:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
<cd:artist rdf:resource="http://www.recshop.fake/cd/dylan" />
...
...
</rdf:Description>
</rdf:RDF>
ऊपर दिए गए उदाहरण में, संपत्ति कलाकार का कोई मूल्य नहीं है, बल्कि उस संसाधन का संदर्भ है जिसमें कलाकार के बारे में जानकारी है।
आरडीएफ कंटेनर
RDF कंटेनरों का उपयोग चीजों के समूह का वर्णन करने के लिए किया जाता है।
निम्नलिखित RDF तत्वों का उपयोग समूहों का वर्णन करने के लिए किया जाता है: <बैग>, <Seq>, और <Alt>।
<rdf:बैग> तत्व
<rdf:Bag> तत्व का उपयोग उन मानों की सूची का वर्णन करने के लिए किया जाता है जिनका किसी विशिष्ट क्रम में होना आवश्यक नहीं है।
<rdf:Bag> तत्व में डुप्लिकेट मान हो सकते हैं।
उदाहरण
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Beatles">
<cd:artist>
<rdf:Bag>
<rdf:li>John</rdf:li>
<rdf:li>Paul</rdf:li>
<rdf:li>George</rdf:li>
<rdf:li>Ringo</rdf:li>
</rdf:Bag>
</cd:artist>
</rdf:Description>
</rdf:RDF>
<rdf:Seq> तत्व
<rdf:Seq> तत्व का उपयोग मूल्यों की एक क्रमबद्ध सूची का वर्णन करने के लिए किया जाता है (उदाहरण के लिए, वर्णानुक्रम में)।
<rdf:Seq> तत्व में डुप्लिकेट मान हो सकते हैं।
उदाहरण
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Beatles">
<cd:artist>
<rdf:Seq>
<rdf:li>George</rdf:li>
<rdf:li>John</rdf:li>
<rdf:li>Paul</rdf:li>
<rdf:li>Ringo</rdf:li>
</rdf:Seq>
</cd:artist>
</rdf:Description>
</rdf:RDF>
<rdf:Alt> तत्व
<rdf:Alt> तत्व का उपयोग वैकल्पिक मूल्यों की सूची का वर्णन करने के लिए किया जाता है (उपयोगकर्ता केवल एक मान का चयन कर सकता है)।
उदाहरण
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Beatles">
<cd:format>
<rdf:Alt>
<rdf:li>CD</rdf:li>
<rdf:li>Record</rdf:li>
<rdf:li>Tape</rdf:li>
</rdf:Alt>
</cd:format>
</rdf:Description>
</rdf:RDF>
आरडीएफ शर्तें
ऊपर के उदाहरणों में हमने कंटेनर तत्वों का वर्णन करते समय "मूल्यों की सूची" के बारे में बात की है। RDF में इन "मूल्यों की सूची" को सदस्य कहा जाता है।
तो, हमारे पास निम्नलिखित हैं:
- एक कंटेनर एक संसाधन है जिसमें चीजें होती हैं
- निहित चीजों को सदस्य कहा जाता है (मूल्यों की सूची नहीं)
आरडीएफ संग्रह
RDF संग्रह उन समूहों का वर्णन करता है जिनमें केवल निर्दिष्ट सदस्य हो सकते हैं।
rdf:parseType="संग्रह" विशेषता
जैसा कि पिछले अध्याय में देखा गया है, एक कंटेनर कहता है कि युक्त संसाधन सदस्य हैं - यह नहीं कहता कि अन्य सदस्यों की अनुमति नहीं है।
RDF संग्रह का उपयोग उन समूहों का वर्णन करने के लिए किया जाता है जिनमें केवल निर्दिष्ट सदस्य हो सकते हैं।
एक संग्रह का वर्णन विशेषता rdf:parseType="Collection" द्वारा किया जाता है।
उदाहरण
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://recshop.fake/cd#">
<rdf:Description
rdf:about="http://recshop.fake/cd/Beatles">
<cd:artist rdf:parseType="Collection">
<rdf:Description rdf:about="http://recshop.fake/cd/Beatles/George"/>
<rdf:Description rdf:about="http://recshop.fake/cd/Beatles/John"/>
<rdf:Description rdf:about="http://recshop.fake/cd/Beatles/Paul"/>
<rdf:Description rdf:about="http://recshop.fake/cd/Beatles/Ringo"/>
</cd:artist>
</rdf:Description>
</rdf:RDF>
आरडीएफ योजना और आवेदन कक्षाएं
RDF स्कीमा (RDFS) RDF का विस्तार है।
RDF वर्गों, गुणों और मूल्यों के साथ संसाधनों का वर्णन करता है।
इसके अलावा, आरडीएफ को एप्लिकेशन-विशिष्ट वर्गों और गुणों को परिभाषित करने के तरीके की भी आवश्यकता होती है। एप्लिकेशन-विशिष्ट वर्गों और गुणों को RDF के एक्सटेंशन का उपयोग करके परिभाषित किया जाना चाहिए।
ऐसा ही एक विस्तार आरडीएफ स्कीमा है।
आरडीएफ स्कीमा (आरडीएफएस)
RDF स्कीमा वास्तविक अनुप्रयोग-विशिष्ट वर्ग और गुण प्रदान नहीं करता है।
इसके बजाय आरडीएफ स्कीमा एप्लिकेशन-विशिष्ट वर्गों और गुणों का वर्णन करने के लिए ढांचा प्रदान करता है।
Classes in RDF Schema are much like classes in object oriented programming languages. This allows resources to be defined as instances of classes, and subclasses of classes.
RDFS Example
The following example demonstrates some of the RDFS facilities:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.animals.fake/animals#">
<rdf:Description rdf:ID="animal">
<rdf:type
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
</rdf:Description>
<rdf:Description rdf:ID="horse">
<rdf:type
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="#animal"/>
</rdf:Description>
</rdf:RDF>
In the example above, the resource "horse" is a subclass of the class "animal".
Example Abbreviated
Since an RDFS class is an RDF resource we can abbreviate the example above by using rdfs:Class instead of rdf:Description, and drop the rdf:type information:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.animals.fake/animals#">
<rdfs:Class rdf:ID="animal" />
<rdfs:Class rdf:ID="horse">
<rdfs:subClassOf rdf:resource="#animal"/>
</rdfs:Class>
</rdf:RDF>
That's it!
The Dublin Core
The Dublin Core Metadata Initiative (DCMI) has created some predefined properties for describing documents.
RDF is metadata (data about data). RDF is used to describe information resources.
The Dublin Core is a set of predefined properties for describing documents.
The first Dublin Core properties were defined at the Metadata Workshop in Dublin, Ohio in 1995 and is currently maintained by the Dublin Core Metadata Initiative.
Property | Definition |
---|---|
Contributor | An entity responsible for making contributions to the content of the resource |
Coverage | The extent or scope of the content of the resource |
Creator | An entity primarily responsible for making the content of the resource |
Format | The physical or digital manifestation of the resource |
Date | A date of an event in the lifecycle of the resource |
Description | An account of the content of the resource |
Identifier | An unambiguous reference to the resource within a given context |
Language | A language of the intellectual content of the resource |
Publisher | An entity responsible for making the resource available |
Relation | A reference to a related resource |
Rights | Information about rights held in and over the resource |
Source | A Reference to a resource from which the present resource is derived |
Subject | A topic of the content of the resource |
Title | A name given to the resource |
Type | The nature or genre of the content of the resource |
A quick look at the table above indicates that RDF is ideal for representing Dublin Core information.
RDF Example
The following example demonstrates the use of some of the Dublin Core properties in an RDF document:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc= "http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="https://www.w3schools.com">
<dc:description>W3Schools - Free tutorials</dc:description>
<dc:publisher>Refsnes Data as</dc:publisher>
<dc:date>2008-09-01</dc:date>
<dc:type>Web Development</dc:type>
<dc:format>text/html</dc:format>
<dc:language>en</dc:language>
</rdf:Description>
</rdf:RDF>
RDF Reference
The RDF namespace (xmlns:rdf) is: http://www.w3.org/1999/02/22-rdf-syntax-ns#
The RDFS namespace (xmlns:rdfs ) is: http://www.w3.org/2000/01/rdf-schema#
The recommended file extension for RDF files is .rdf. However, the extension .xml is often used to provide compatibility with old xml parsers.
The MIME type should be "application/rdf+xml".
RDFS / RDF Classes
Element | Class of | Subclass of |
---|---|---|
rdfs:Class | All classes | |
rdfs:Datatype | Data types | Class |
rdfs:Resource | All resources | Class |
rdfs:Container | Containers | Resource |
rdfs:Literal | Literal values (text and numbers) | Resource |
rdf:List | Lists | Resource |
rdf:Property | Properties | Resource |
rdf:Statement | Statements | Resource |
rdf:Alt | Containers of alternatives | Container |
rdf:Bag | Unordered containers | Container |
rdf:Seq | Ordered containers | Container |
rdfs:ContainerMembershipProperty | Container membership properties | Property |
rdf:XMLLiteral | XML literal values | Literal |
RDFS / RDF Properties
Element | Domain | Range | Description |
---|---|---|---|
rdfs:domain | Property | Class | The domain of the resource |
rdfs:range | Property | Class | The range of the resource |
rdfs:subPropertyOf | Property | Property | The property is a sub property of a property |
rdfs:subClassOf | Class | Class | The resource is a subclass of a class |
rdfs:comment | Resource | Literal | The human readable description of the resource |
rdfs:label | Resource | Literal | The human readable label (name) of the resource |
rdfs:isDefinedBy | Resource | Resource | The definition of the resource |
rdfs:seeAlso | Resource | Resource | The additional information about the resource |
rdfs:member | Resource | Resource | The member of the resource |
rdf:first | List | Resource | |
rdf:rest | List | List | |
rdf:subject | Statement | Resource | The subject of the resource in an RDF Statement |
rdf:predicate | Statement | Resource | The predicate of the resource in an RDF Statement |
rdf:object | Statement | Resource | The object of the resource in an RDF Statement |
rdf:value | Resource | Resource | The property used for values |
rdf:type | Resource | Class | The resource is an instance of a class |
RDF Attributes
Attribute | Description |
---|---|
rdf:about | Defines the resource being described |
rdf:Description | Container for the description of a resource |
rdf:resource | Defines a resource to identify a property |
rdf:datatype | Defines the data type of an element |
rdf:ID | Defines the ID of an element |
rdf:li | Defines a list |
rdf:_n | Defines a node |
rdf:nodeID | Defines the ID of an element node |
rdf:parseType | Defines how an element should be parsed |
rdf:RDF | The root of an RDF document |
xml:base | Defines the XML base |
xml:lang | Defines the language of the element content |