What's a RDF triple?

2019-01-30 21:59发布

In layman's terms, what's a RDF triple?

14条回答
乱世女痞
2楼-- · 2019-01-30 22:33

I think the question needs to be split into two parts - what is a triple and what makes an "RDF triple" so special?

Firstly, a triple is, as most of the other commenters here have already pointed out, a statement in "subject/predicate/object" form - i.e. a statement linking one object (subject) to another object(object) or a literal, via a predicate. We are all familiar with triples: a triple is the smallest irreducible representation for binary relationship. In plain English: a spreadsheet is a collection of triples, for example, if a column in your spreadsheet has the heading "Paul" and a row has the heading "has Sister" and the value in the cell is "Lisa". Here you have a triple: Paul (subject) has Sister(predicate) Lisa (literal/object).

What makes RDF triples special is that EVERY PART of the triple has a URI associated with it, so the everyday statement "Mike Smith knows John Doe" might be represented in RDF as:

uri://people#MikeSmith12 http://xmlns.com/foaf/0.1/knows uri://people#JohnDoe45

The analogy to the spreadsheet is that by giving every part of the URI a unique address, you give the cell in the spreadsheet its whole address space....so you could in principle stick every cell (if expressed in RDF triples) of the spreadsheet into a different document on a different server and reconstitute the spreadsheet through a single query.

Edit: This section of the official documentation addresses the original question.

查看更多
Viruses.
3楼-- · 2019-01-30 22:33

It has been awhile since I worked with RDF, but here it goes :D

A triple is a subject, predicate and object.

The subject is a URI which uniquely identifies something. For example, your openid uniquely identifies you.

The object defines how the subject and object are related.

The predicate is some attribute of the subject. For example a name.

Given that, the triples form a graph S->P. Given more triplets, the graph grows. For example, you can have the same person identified as the subject of a bunch of triples, you can then connect all of the predicates through that unique subject.

查看更多
时光不老,我们不散
4楼-- · 2019-01-30 22:33

RDF Triple is an actual expression that defines a way in which you can represent a relationship between objects. There are three parts to a triple: Subject, Predicate and Object (typically written in the same order). A predicate relates subject to object.

Subject ----Predicate---> Object

More useful information can be found at:

http://www.w3.org/TR/rdf-concepts/

查看更多
疯言疯语
5楼-- · 2019-01-30 22:34

One can think of a triple as a type of sentence that states a single "fact" about a resource. First of all to understand RDF Triple you should know that each and every thing in RDF is defined in terms of URI http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-referenceor blank node http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node.

An RDF Triple consists of three components :- 1) Subject 2) Predicate 3) Object For ex :- Pranay hasCar Ferrari Here Subject is Pranay, hasCar is a predicate and Ferrari is a object. This are each defined with RDF-URI. For more information you can visit :- http://www.w3.org/TR/owl-ref/

查看更多
放我归山
6楼-- · 2019-01-30 22:35

Triple explained by example

Be there a table that relates users and questions.

TABLE dc:creator
-------------------------
| Question |   User     |
-------------------------
|    45    |   485527   |
|    44    |   485527   |
|    40    |   485528   |

This could conceptually be expressed in three RDF triples like...

<question:45> <dc:creator> <user:485527>
<question:44> <dc:creator> <user:485527>
<question:40> <dc:creator> <user:485528>

...so that each row is converted to one triple that relates a user to a question. The general form of each triple can be described as:

<Subject> <Predicate> <Object>

One specialty about RDF is, that you can (or must) use URIs/IRIs to identify entities as well as relations. Find more here. This makes it possible for everyone to reuse already existing relations (predicates) and to publish statements about arbitrary entities in the www.

Example relating a SO answer to its creator:

<https://stackoverflow.com/a/49066324/1485527>   
<http://purl.org/dc/terms/creator> 
<https://stackoverflow.com/users/1485527>
查看更多
仙女界的扛把子
7楼-- · 2019-01-30 22:39

Note, that it can get a bit more complicated. RDF triples can also be considered Subjects or Objects, so you can have something like: Bart -> said -> ( triples -> can be -> objects)

查看更多
登录 后发表回答