Powered by
TTSReader
Share this page on
Article provided by Wikipedia


Main article: "RDF query language

The predominant query language for RDF graphs is "SPARQL. SPARQL is an "SQL-like language, and a "recommendation of the "W3C as of January 15, 2008.

An example of a SPARQL query to show country capitals in Africa, using a fictional ontology.

PREFIX ex: <http://example.com/exampleOntology#>
SELECT ?capital ?country
WHERE {
  ?x ex:cityname ?capital ;
     ex:isCapitalOf ?y .
  ?y ex:countryname ?country ;
     ex:isInContinent ex:Africa .
}

Other non-standard ways to query RDF graphs include:

Examples[edit]

Example 1: RDF Description of a person named Eric Miller[40][edit]

The following example is taken from the W3C website[40] describing a resource with statements "there is a Person identified by http://www.w3.org/People/EM/contact#me, whose name is Eric Miller, whose email address is e.miller123(at)example (changed for security purposes), and whose title is Dr.

""
""
An RDF Graph Describing Eric Miller[40]

The resource "http://www.w3.org/People/EM/contact#me" is the subject.

The objects are:

The subject is a URI.

The predicates also have URIs. For example, the URI for each predicate:

In addition, the subject has a type (with URI http://www.w3.org/1999/02/22-rdf-syntax-ns#type), which is person (with URI http://www.w3.org/2000/10/swap/pim/contact#Person).

Therefore, the following "subject, predicate, object" RDF triples can be expressed:

In standard N-Triples format, this RDF can be written as:

<http://www.w3.org/People/EM/contact#me> <http://www.w3.org/2000/10/swap/pim/contact#fullName> "Eric Miller" .
<http://www.w3.org/People/EM/contact#me> <http://www.w3.org/2000/10/swap/pim/contact#mailbox> <mailto:e.miller123(at)example> .
<http://www.w3.org/People/EM/contact#me> <http://www.w3.org/2000/10/swap/pim/contact#personalTitle> "Dr." .
<http://www.w3.org/People/EM/contact#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/10/swap/pim/contact#Person> .

Equivalently, it can be written in standard Turtle (syntax) format as:

@prefix eric:    <http://www.w3.org/People/EM/contact#> .
@prefix contact: <http://www.w3.org/2000/10/swap/pim/contact#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

eric:me contact:fullName "Eric Miller" .
eric:me contact:mailbox <mailto:e.miller123(at)example> .
eric:me contact:personalTitle "Dr." .
eric:me rdf:type contact:Person .

Or, it can be written in RDF/XML format as:

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#" xmlns:eric="http://www.w3.org/People/EM/contact#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me">
    <contact:fullName>Eric Miller</contact:fullName>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me">
    <contact:mailbox rdf:resource="mailto:e.miller123(at)example"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me">
    <contact:personalTitle>Dr.</contact:personalTitle>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me">
    <rdf:type rdf:resource="http://www.w3.org/2000/10/swap/pim/contact#Person"/>
  </rdf:Description>
</rdf:RDF>

Example 2: The postal abbreviation for New York[edit]

Certain concepts in RDF are taken from "logic and "linguistics, where subject-predicate and subject-predicate-object structures have meanings similar to, yet distinct from, the uses of those terms in RDF. This example demonstrates:

In the "English language statement 'New York has the postal abbreviation NY' , 'New York' would be the subject, 'has the postal abbreviation' the predicate and 'NY' the object.

Encoded as an RDF triple, the subject and predicate would have to be resources named by URIs. The object could be a resource or literal element. For example, in the N-Triples form of RDF, the statement might look like:

<urn:x-states:New%20York> <http://purl.org/dc/terms/alternative> "NY" .

In this example, "urn:x-states:New%20York" is the URI for a resource that denotes the US state "New York, "http://purl.org/dc/terms/alternative" is the URI for a predicate (whose human-readable definition can be found at here [41]), and "NY" is a literal string. Note that the URIs chosen here are not standard, and don't need to be, as long as their meaning is known to whatever is reading them.

Example 3: A Wikipedia article about Tony Benn[edit]

In a like manner, given that "http://en.wikipedia.org/wiki/Tony_Benn" identifies a particular resource (regardless of whether that URI could be traversed as a hyperlink, or whether the resource is actually the "Wikipedia article about "Tony Benn), to say that the title of this resource is "Tony Benn" and its publisher is "Wikipedia" would be two assertions that could be expressed as valid RDF statements. In the N-Triples form of RDF, these statements might look like the following:

<http://en.wikipedia.org/wiki/Tony_Benn> <http://purl.org/dc/elements/1.1/title> "Tony Benn" .
<http://en.wikipedia.org/wiki/Tony_Benn> <http://purl.org/dc/elements/1.1/publisher> "Wikipedia" .

To an English-speaking person, the same information could be represented simply as:

The title of this resource, which is published by Wikipedia, is 'Tony Benn'

However, RDF puts the information in a formal way that a machine can understand. The purpose of RDF is to provide an "encoding and interpretation mechanism so that "resources can be described in a way that particular "software can understand it; in other words, so that software can access and use information that it otherwise couldn't use.

Both versions of the statements above are wordy because one requirement for an RDF resource (as a subject or a predicate) is that it be unique. The subject resource must be unique in an attempt to pinpoint the exact resource being described. The predicate needs to be unique in order to reduce the chance that the idea of "Title or "Publisher will be ambiguous to software working with the description. If the software recognizes http://purl.org/dc/elements/1.1/title (a specific "definition for the "concept of a title established by the "Dublin Core Metadata Initiative), it will also know that this title is different from a land title or an honorary title or just the letters t-i-t-l-e put together.

The following example, written in Turtle, shows how such simple claims can be elaborated on, by combining multiple RDF vocabularies. Here, we note that the primary topic of the Wikipedia page is a "Person" whose name is "Tony Benn":

@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc:   <http://purl.org/dc/elements/1.1/> .

<http://en.wikipedia.org/wiki/Tony_Benn>
    dc:publisher "Wikipedia" ;
    dc:title "Tony Benn" ;
    foaf:primaryTopic [
        a foaf:Person ;
        foaf:name "Tony Benn"
    ] .

Applications[edit]

Some uses of RDF include research into social networking. It will also help people in business fields understand better their relationships with members of industries that could be of use for product placement.[49] It will also help scientists understand how people are connected to one another.

RDF is being used to have a better understanding of road traffic patterns. This is because the information regarding traffic patterns is on different websites, and RDF is used to integrate information from different sources on the web. Before, the common methodology was using keyword searching, but this method is problematic because it does not consider synonyms. This is why ontologies are useful in this situation. But one of the issues that comes up when trying to efficiently study traffic is that to fully understand traffic, concepts related to people, streets, and roads must be well understood. Since these are human concepts, they require the addition of "fuzzy logic. This is because values that are useful when describing roads, like slipperiness, are not precise concepts and cannot be measured. This would imply that the best solution would incorporate both fuzzy logic and ontology.[50]

See also[edit]

Notations for RDF
Similar concepts
Other (unsorted)

References[edit]

  1. ^ "XML and Semantic Web W3C Standards Timeline" (PDF). 2012-02-04. 
  2. ^ http://www.w3.org/TR/PR-rdf-syntax/ "Resource Description Framework (RDF) Model and Syntax Specification"
  3. ^ Optimized Index Structures for Querying RDF from the Web Andreas Harth, Stefan Decker, 3rd Latin American Web Congress, Buenos Aires, Argentina, October 31 to November 2, 2005, pp. 71–80
  4. ^ [1] Shape Expressions language
  5. ^ a b "World Wide Web Consortium Publishes Public Draft of Resource Description Framework". W3C. Cambridge, MA. 1997-10-03. 
  6. ^ a b Lash, Alex (1997-10-03). "W3C takes first step toward RDF spec". CNET News. Archived from the original on June 16, 2011. Retrieved 2015-11-28. 
  7. ^ Hammersley, Ben (2005). Developing Feeds with RSS and Atom. Sebastopol: O’Reilly. pp. 2–3. "ISBN "0-596-00881-3. 
  8. ^ Lassila, Ora; Swick, Ralph R. (1997-10-02). "Resource Description Framework (RDF): Model and Syntax". W3C. Retrieved 2015-11-24. 
  9. ^ Swick, Ralph (1997-12-11). "Resource Description Framework (RDF)". W3C. Archived from the original on February 14, 1998. Retrieved 2015-11-24. 
  10. ^ "Resource Description Framework (RDF) Model and Syntax Specification". 22 Feb 1999. Retrieved 5 May 2014. 
  11. ^ Manola, Frank; Miller, Eric (2004-02-10), RDF Primer, W3C, retrieved 2015-11-21 
  12. ^ Klyne, Graham; Carroll, Jeremy J. (2004-02-10), Resource Description Framework (RDF): Concepts and Abstract Syntax, W3C, retrieved 2015-11-21 
  13. ^ Beckett, Dave (2004-02-10), RDF/XML Syntax Specification (Revised), W3C, retrieved 2015-11-21 
  14. ^ Hayes, Patrick (2014-02-10), RDF Semantics, retrieved 2015-11-21 
  15. ^ Brickley, Dan; Guha, R.V. (2004-02-10), RDF Vocabulary Description Language 1.0: RDF Schema: W3C Recommendation 10 February 2004, W3C, retrieved 2015-11-21 
  16. ^ Grant, Jan; Beckett, Dave (2004-02-10), RDF Test Cases, W3C, retrieved 2015-11-21 
  17. ^ Schreiber, Guus; Raimond, Yves (2014-06-24), RDF 1.1 Primer, W3C, retrieved 2015-11-22 
  18. ^ Cyganiak, Richard; Wood, David; Lanthaler, Markus (2014-02-25), RDF 1.1 Concepts and Abstract Syntax, W3C, retrieved 2015-11-22 
  19. ^ Gandon, Fabien; Schreiber, Guus (2014-02-25), RDF 1.1 XML Syntax, W3C, retrieved 2015-11-22 
  20. ^ Hayes, Patrick J.; Patel-Schneider, Peter F. (2014-02-25), RDF 1.1 Semantics, W3C, retrieved 2015-11-22 
  21. ^ Brickley, Dan; Guha, R.V. (2014-02-25), RDF Schema 1.1, W3C, retrieved 2015-11-22 
  22. ^ Kellogg, Gregg; Lanthaler, Markus (2014-02-25), RDF 1.1 Test Cases, W3C, retrieved 2015-11-22 
  23. ^ "RDF Vocabulary Description Language 1.0: RDF Schema". "W3C. 2004-02-10. Retrieved 2011-01-05. 
  24. ^ "RDF 1.1 Turtle: Terse RDF Triple Language". W3C. 9 Jan 2014. Retrieved 2014-02-22. 
  25. ^ "application/rdf+xml Media Type Registration". IETF. September 2004. p. 2. Retrieved 2011-01-08. 
  26. ^ "RDF 1.1 Turtle: Terse RDF Triple Language". W3C. 9 January 2014. 
  27. ^ "RDF 1.1 N-Triples: A line-based syntax for an RDF graph". "W3C. 9 January 2014. 
  28. ^ "N-Quads: Extending N-Triples with Context". 2012-06-25. 
  29. ^ "RDF 1.1 N-Quads". "W3C. January 2014. 
  30. ^ "JSON-LD 1.0: A JSON-based Serialization for Linked Data". W3C. 
  31. ^ "RDF 1.1 XML Syntax". "W3C. 25 February 2014. 
  32. ^ "Problems of the RDF syntax". Vuk Miličić. 
  33. ^ RDF 1.1 Concepts and Abstract Syntax https://www.w3.org/TR/rdf11-concepts/
  34. ^ Contexts for RDF Information Modelling
  35. ^ Circumstance, Provenance and Partial Knowledge
  36. ^ The Concept of 4Suite RDF Scopes
  37. ^ Redland RDF Library – Contexts
  38. ^ Named Graphs
  39. ^ "The RDF Query Language (RQL)". The ICS-FORTH RDFSuite. ICS-FORTH. 
  40. ^ a b c "RDF Primer". "W3C. Retrieved 2009-03-13. 
  41. ^ DCMI Metadata Terms. Dublincore.org. Retrieved on 2014-05-30.
  42. ^ Haystack
  43. ^ The IDEAS Group Website
  44. ^ Connected Services Framework
  45. ^ RDF on MusicBrainz Wiki
  46. ^ [2]
  47. ^ SIOC (Semantically-Interlinked Online Communities)
  48. ^ Oliver Ian, Honkola Jukka, Ziegler Jurgen (2008). “Dynamic, Localized Space Based Semantic Webs”. IADIS WWW/Internet 2008. Proceedings, p.426, IADIS Press, "ISBN 978-972-8924-68-3
  49. ^ An RDF Approach for Discovering the Relevant Semantic Associations in a Social Network By Thushar A.K, and P. Santhi Thilagam
  50. ^ Traffic Information Retrieval Based on Fuzzy Ontology and RDF on the Semantic Web By Jun Zhai, Yi Yu, Yiduo Liang, and Jiatao Jiang (2008)

Further reading[edit]

External links[edit]

) )