RDF(Resource Description Framework)
- RDF is a directed, labeled graph data format for representing information in the Web
- Concepts
- Graph data model
- URI-based vocabulary
- Datatypes
- Literals
- XML serialization syntax
- Expression of simple facts
- Entailment
Graph data model
- The basic structure of RDF is a collection of triples. Each triple has :
- subject
- predicate
- object
- A set of such triples is called an RDF graph
- The direction of the triples: use the subject to (use property) predictObject
- It is a node-to-node relationship
- Nodes in the graph: subjects and objects
- An RDF triple is written in the order subject, predicate, object
- Subject: RDF URI reference or a blank node
- Predicate/Property: RDF URI reference : the property of the triple, it denotes a certain relatioship说白了就是Subject和Object沟通的桥梁,相当于外键-主键
- Object: RDF URI reference, a literal or a blank node
URI-based Vocabulary and Node Identification
- URI reference or lieral used as node identifiers. It represents what a node represents or what the relationship is
- The predicate can also be a node in the graph
- A node may be one of:
- a URI with optinal fragment identifier
- literal
- blank
- Properties are URI references
Datatypes
Namespaces
Prefix | IRI |
---|---|
rdf | http://www.w3.org/1999/02/22-rdf-syntax-ns# |
rdfs: | http://www.w3.org/2000/01/rdf-schema# |
xsd: | http://www.w3.org/2001/XMLSchema# |
fn: | http://www.w3.org/2005/xpath-functions# |
Data Descriptions
SPARQL query language uses the Turtle data fromat to show each triple
Turtle allows IRIs to be abbreviated with prefixes
Turtle: Terse RDF Triple languagle
https://www.w3.org/TeamSubmission/turtle/
Result Descriptions
x | y | z |
---|---|---|
“Alice” | “http://example/a” |
- Binding is a pair(variable, RDF term)
- In this results, there are three variables: x y z
- variable x is bound to Alice, variable y is bound to "http://example/a
- variable z is not bound to an RDF term
- variable are not neccessarly to be bound