Leif Harald Karlsen
Data can be organized according to how structured it is:
Central idea: Loosen up the rigid structure (semi-structured)
s p o
Leif teaches IN5800
teaches type Relationship
type type Relationship
Instead of
<https://www.uio.no/studier/emner/matnat/ifi/IN5800>
can set
@prefix ifi: <https://www.uio.no/studier/emner/matnat/ifi/> .
and now write ifi:IN5800
@prefix ifi: <https://www.uio.no/studier/emner/matnat/ifi/> .
@prefix folk: <http://folk.uio.no/> .
@prefix ex: <http://example.com/> .
folk:leifhka ex:hasName "Leif Harald Karlsen" .
folk:leifhka ex:teaches ifi:IN5800 .
folk:leifhka ex:teaches ifi:IN2090 .
folk:leifhka ex:knows folk:martingi .
folk:martingi ex:teaches ifi:IN3060 .
ifi:IN5800 ex:hasCredits 10 .
ifi:IN3060 ex:alias ifi:IN4060 .
More compact syntax:
@prefix ifi: <https://www.uio.no/studier/emner/matnat/ifi/> .
@prefix folk: <http://folk.uio.no/> .
@prefix ex: <http://example.com/> .
folk:leifhka ex:hasName "Leif Harald Karlsen" ;
ex:teaches ifi:IN5800, ifi:IN2090 ;
ex:knows folk:martingi .
folk:martingi ex:teaches ifi:IN3060 .
ifi:IN5800 ex:hasCredits 10 .
ifi:IN3060 ex:alias ifi:IN4060 .
ex:teaches rdfs:domain ex:Teacher
and
ex:teaches rdfs:range ex:Course
rdf:type rdf:type rdfs:Property
and
rdf:Property rdf:type rdfs:Class
rdfs:Class
, rdf:type
,
rdf:Property
, rdfs:domain
,
rdfs:range
, etc.Triple(subject, predicate, object)
in a relational
databaseFormat: SQL tables – Data structure: Relational
Company
cid | name | founded
-----+------+------------
1 | UiO | 1811-09-02
2 | DNB | 2003-12-03
Person
pid | name | worksfor
-----+-------+----------
1 | Peter | 2
2 | Kari | 1
3 | Mary | 1
4 | Nils |
Format: SQL tables – Data structure: Triples
Nodes
id | ntype | svalue | lang
-----+--------+-------------------------------------------------+------
1 | uri | http://www.w3.org/1999/02/22-rdf-syntax-ns#type |
2 | uri | http://www.w3.org/2001/XMLSchema#date |
101 | uri | http://example.org/comp |
102 | uri | http://example.org/comp/cid |
103 | uri | http://example.org/comp/cid/1 |
104 | uri | http://example.org/comp/cid/2 |
105 | uri | http://example.org/comp/founded |
106 | uri | http://example.org/comp/name |
107 | uri | http://example.org/pers |
108 | uri | http://example.org/pers/name |
109 | uri | http://example.org/pers/pid |
110 | uri | http://example.org/pers/pid/1 |
111 | uri | http://example.org/pers/pid/2 |
112 | uri | http://example.org/pers/pid/3 |
113 | uri | http://example.org/pers/pid/4 |
114 | uri | http://example.org/pers/worksfor |
115 | string | DNB |
116 | string | Kari |
117 | string | Mary |
118 | string | Nils |
119 | string | Peter |
120 | string | UiO |
121 | date | 1811-09-02 |
122 | date | 2003-12-03 |
Triples
subject | predicate | object
---------+-----------+--------
103 | 1 | 101
103 | 105 | 121
103 | 106 | 120
104 | 1 | 101
104 | 105 | 122
104 | 106 | 115
110 | 1 | 107
110 | 108 | 119
110 | 114 | 104
111 | 1 | 107
111 | 108 | 116
111 | 114 | 103
112 | 1 | 107
112 | 108 | 117
112 | 114 | 103
113 | 1 | 107
113 | 108 | 118
Format: RDF – Data structure: Triples
@prefix ex: <http://example.org/public/> .
@prefix ex-c: <http://example.org/public/Company/> .
@prefix ex-p: <http://example.org/public/pers/> .
ex-c:cid1 a ex:Company ;
ex-c:founded 1811-09-02 ;
ex-c:name "UiO" .
ex-c:cid2 a ex:Company ;
ex-c:founded 2003-12-03 ;
ex-c:name "DNB" .
ex-p:pid1 a ex:Person .
ex-p:name "Peter" ;
ex-p:worksfor ex-c:cid2 .
ex-p:pid2 a ex:Person ;
ex-p:name "Kari" ;
ex-p:worksfor ex-c:cid1 .
ex-p:pid3 a ex:Person ;
ex-p:name "Mary" ;
ex-p:worksfor ex-c:cid1 .
ex-p:pid4 a ex:Person ;
ex-p:name "Nils" .
Format: RDF – Data structure: Relational
ex:Company a ex:Table ;
ex:columns ("cid", "name", "founded") ;
ex:row (1, "UiO", "1811-09-02"^^xsd:date) ,
(2, "DNB", "2003-12-03"^^xsd:date) .
ex:Person a ex:Table ;
ex:columns ("pid", "name", "worksfor") ;
ex:row (1, "Peter", 2) ,
(2, "Kari", 1) ,
(3, "Mary", 1) ,
(4, "Nils", ex:null) .
s1 measures 5 degrees Celsius
T happened 10:02:13 21.01.21
X is at POINT(1.0, 2.3)
s1 is warm
T happened before P
X is contained in Y