Triples can share subject and /or object URIs in order to construct a graph. 三元组可以共享主题和/或对象URIs,以便构建图形。
Example: 3 triples
Turtle serialisation, including the namespace declaration:
@prefix ex: http://example.org/ .
http://semantic-web-book.org/uri
ex:title “Foundations of Semantic Web Technologies” ;
ex:publishedBy http://crcpress.com/uri .
http://crcpress.com/uri ex:name “CRC Press” .
Notice the use of the semicolon (;) abreviation. Here it reuses the subject of an initial triple as the subject of a second triple. So we could have equivalently written this as 4 separate triple statements, each terminated by a full-stop as we saw before.
We do not have to name everything that is the subject or object of a triple. We can use a “blank node“ that represents an unnamed node in the graph and functions as a variable of very local scope, using the Turtle symbols “[“ and “]”. 我们不必为三重事物的主体或客体命名。我们可以使用一个“空白节点”,它代表图中一个未命名的节点,并作为一个非常局部范围的变量,使用海龟符号“[”和“]”。
Example (equivalent to above except that now we have no URI for the publisher)
@prefix ex: http://example.org/ .
http://semantic-web-book.org/uri ex:publishedBy [ ex:name “CRCPress”] ;
ex:title “Foundations of Semantic Web Technologies”