Skip to content

Commit 2f9e0ad

Browse files
committed
Switch from rdfs:label to rdf:type for element labels.
1 parent 8c01268 commit 2f9e0ad

File tree

9 files changed

+132
-116
lines changed

9 files changed

+132
-116
lines changed

README.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ Property graph values must be converted into RDF values and vice versa. Blazegr
4545

4646
Blazegraph accepts user-supplied IDs (strings only) for vertices and edges. If no id is supplied a UUID will be generated. By default, TP3 ids and property keys are converted into URIs by prepending a <blaze:> namespace prefix. Property values are simply converted into datatyped literals.
4747

48-
Two fixed URIs are used and provided by the BlazeValueFactory to represent element labels (rdfs:label by default) and property values for Cardinality.list vertex properties (rdf:value by default). These can also be overriden as desired.
48+
Two fixed URIs are used and provided by the BlazeValueFactory to represent element labels (rdf:type by default) and property values for Cardinality.list vertex properties (rdf:value by default). These can also be overriden as desired.
4949

5050
Property graph elements are represented as follows in Blazegraph:
5151

5252
# BlazeVertex john = graph.addVertex(T.id, "john", T.label, "person");
53-
blaze:john rdfs:label "person" .
53+
blaze:john rdf:type blaze:person .
5454

5555
# BlazeEdge knows = graph.addEdge(john, mary, "knows", T.id, "k01");
5656
blaze:john blaze:k01 blaze:mary .
57-
<<blaze:john blaze:k01 blaze:mary>> rdfs:label "knows" .
57+
<<blaze:john blaze:k01 blaze:mary>> rdf:type blaze:knows .
5858

5959
Vertices requires one statement, edges require two.
6060

@@ -84,34 +84,34 @@ Cardinality.list uses a specially datatyped and monotonically increasing interna
8484

8585
Here is how the Tinkerpop3 "Crew" dataset looks when loaded into Blazegraph. Human-friendly IDs have been assigned to vertices and edge UUIDs have been abbreviated to 5 characters for brevity.
8686

87-
blaze:tinkergraph rdfs:label "software" ;
87+
blaze:tinkergraph rdf:type blaze:software ;
8888
blaze:name "tinkergraph" .
8989
90-
blaze:gremlin rdfs:label "software" ;
90+
blaze:gremlin rdf:type blaze:software ;
9191
blaze:name "gremlin" ;
9292
blaze:48f63 blaze:tinkergraph .
9393
94-
<<blaze:gremlin blaze:48f63 blaze:tinkergraph>> rdfs:label "traverses" .
94+
<<blaze:gremlin blaze:48f63 blaze:tinkergraph>> rdf:type blaze:traverses .
9595
96-
blaze:daniel rdfs:label "person" ;
96+
blaze:daniel rdf:type blaze:person ;
9797
blaze:name "daniel" ;
9898
blaze:81056 blaze:tinkergraph ;
9999
blaze:e09ac blaze:gremlin ;
100100
blaze:location "spremberg" ;
101101
blaze:location "kaiserslautern" ;
102102
blaze:location "aachen" .
103103
104-
<<blaze:daniel blaze:81056 blaze:tinkergraph>> rdfs:label "uses" ;
104+
<<blaze:daniel blaze:81056 blaze:tinkergraph>> rdf:type blaze:uses ;
105105
blaze:skill "3"^^xsd:int .
106-
<<blaze:daniel blaze:e09ac blaze:gremlin>> rdfs:label "uses" ;
106+
<<blaze:daniel blaze:e09ac blaze:gremlin>> rdf:type blaze:uses ;
107107
blaze:skill "5"^^xsd:int .
108108
<<blaze:daniel blaze:location "spremberg">> blaze:startTime "1982"^^xsd:int ;
109109
blaze:endTime "2005"^^xsd:int .
110110
<<blaze:daniel blaze:location "kaiserslautern">> blaze:startTime "2005"^^xsd:int ;
111111
blaze:endTime "2009"^^xsd:int .
112112
<<blaze:daniel blaze:location "aachen">> blaze:startTime "2009"^^xsd:int .
113113
114-
blaze:marko rdfs:label "person" ;
114+
blaze:marko rdf:type blaze:person ;
115115
blaze:name "marko" ;
116116
blaze:42af2 blaze:gremlin ;
117117
blaze:4edec blaze:gremlin ;
@@ -122,13 +122,13 @@ Here is how the Tinkerpop3 "Crew" dataset looks when loaded into Blazegraph. Hu
122122
blaze:location "brussels" ;
123123
blaze:location "santa fe" .
124124

125-
<<blaze:marko blaze:42af2 blaze:gremlin>> rdfs:label "develops" ;
125+
<<blaze:marko blaze:42af2 blaze:gremlin>> rdf:type blaze:develops ;
126126
blaze:since "2009"^^xsd:int .
127-
<<blaze:marko blaze:4edec blaze:gremlin>> rdfs:label "uses" ;
127+
<<blaze:marko blaze:4edec blaze:gremlin>> rdf:type blaze:uses ;
128128
blaze:skill "4"^^xsd:int .
129-
<<blaze:marko blaze:61d50 blaze:tinkergraph>> rdfs:label "develops" ;
129+
<<blaze:marko blaze:61d50 blaze:tinkergraph>> rdf:type blaze:develops ;
130130
blaze:since "2010"^^xsd:int .
131-
<<blaze:marko blaze:68c12 blaze:tinkergraph>> rdfs:label "uses" ;
131+
<<blaze:marko blaze:68c12 blaze:tinkergraph>> rdf:type blaze:uses ;
132132
blaze:skill "5"^^xsd:int .
133133
<<blaze:marko blaze:location "san diego">> blaze:startTime "1997"^^xsd:int ;
134134
blaze:endTime "2001"^^xsd:int .
@@ -138,7 +138,7 @@ Here is how the Tinkerpop3 "Crew" dataset looks when loaded into Blazegraph. Hu
138138
blaze:endTime "2005"^^xsd:int .
139139
<<blaze:marko blaze:location "santa fe">> blaze:startTime "2005"^^xsd:int .
140140

141-
blaze:stephen rdfs:label "person" ;
141+
blaze:stephen rdf:type blaze:person ;
142142
blaze:name "stephen" ;
143143
blaze:15869 blaze:tinkergraph ;
144144
blaze:1e9c3 blaze:gremlin ;
@@ -148,21 +148,21 @@ Here is how the Tinkerpop3 "Crew" dataset looks when loaded into Blazegraph. Hu
148148
blaze:location "dulles" ;
149149
blaze:location "purcellville" .
150150

151-
<<blaze:stephen blaze:15869 blaze:tinkergraph>> rdfs:label "develops" ;
151+
<<blaze:stephen blaze:15869 blaze:tinkergraph>> rdf:type blaze:develops ;
152152
blaze:since "2011"^^xsd:int .
153-
<<blaze:stephen blaze:1e9c3 blaze:gremlin>> rdfs:label "develops" ;
153+
<<blaze:stephen blaze:1e9c3 blaze:gremlin>> rdf:type blaze:develops ;
154154
blaze:since "2010"^^xsd:int .
155-
<<blaze:stephen blaze:bf48d blaze:tinkergraph>> rdfs:label "uses" ;
155+
<<blaze:stephen blaze:bf48d blaze:tinkergraph>> rdf:type blaze:uses ;
156156
blaze:skill "4"^^xsd:int .
157-
<<blaze:stephen blaze:bff3c blaze:gremlin>> rdfs:label "uses" ;
157+
<<blaze:stephen blaze:bff3c blaze:gremlin>> rdf:type blaze:uses ;
158158
blaze:skill "5"^^xsd:int .
159159
<<blaze:stephen blaze:location "centreville">> blaze:startTime "1990"^^xsd:int ;
160160
blaze:endTime "2000"^^xsd:int .
161161
<<blaze:stephen blaze:location "dulles">> blaze:startTime "2000"^^xsd:int ;
162162
blaze:endTime "2006"^^xsd:int .
163163
<<blaze:stephen blaze:location "purcellville">> blaze:startTime "2006"^^xsd:int .
164164

165-
blaze:matthias rdfs:label "person" ;
165+
blaze:matthias rdf:type blaze:person ;
166166
blaze:name "matthias" ;
167167
blaze:7373e blaze:gremlin ;
168168
blaze:e5a5d blaze:gremlin ;
@@ -172,19 +172,20 @@ Here is how the Tinkerpop3 "Crew" dataset looks when loaded into Blazegraph. Hu
172172
blaze:location "oakland" ;
173173
blaze:location "seattle" .
174174

175-
<<blaze:matthias blaze:7373e blaze:gremlin>> rdfs:label "develops" ;
175+
<<blaze:matthias blaze:7373e blaze:gremlin>> rdf:type blaze:develops ;
176176
blaze:since "2012"^^xsd:int .
177-
<<blaze:matthias blaze:e5a5d blaze:gremlin>> rdfs:label "uses" ;
177+
<<blaze:matthias blaze:e5a5d blaze:gremlin>> rdf:type blaze:uses ;
178178
blaze:skill "3"^^xsd:int .
179-
<<blaze:matthias blaze:ef89a blaze:tinkergraph>> rdfs:label "uses" ;
179+
<<blaze:matthias blaze:ef89a blaze:tinkergraph>> rdf:type blaze:uses ;
180180
blaze:skill "3"^^xsd:int .
181181
<<blaze:matthias blaze:location "bremen">> blaze:startTime "2004"^^xsd:int ;
182182
blaze:endTime "2007"^^xsd:int .
183183
<<blaze:matthias blaze:location "baltimore">> blaze:startTime "2007"^^xsd:int ;
184184
blaze:endTime "2011"^^xsd:int .
185185
<<blaze:matthias blaze:location "oakland">> blaze:startTime "2011"^^xsd:int ;
186186
blaze:endTime "2014"^^xsd:int .
187-
<<blaze:matthias blaze:location "seattle">> blaze:startTime "2014"^^xsd:int .
187+
<<blaze:matthias blaze:location "seattle">> blaze:startTime "2014"^^xsd:int .
188+
188189
## Getting up and running with Blazegraph/TP3
189190

190191
Currently **BlazeGraphEmbedded** is the only concrete implementation of the Blazegraph Tinkerpop3 API. BlazeGraphEmbedded is backed by an embedded (same JVM) instance of Blazegraph. This puts the enterprise features of Blazegraph (high-availability, scale-out, etc.) out of reach for the 1.0 version of the TP3 integration, since those features are accessed via Blazegraph's client/server API. A TP3 integration with the client/server version of Blazegraph is reserved for a future blazegraph-tinkerpop release.
@@ -439,11 +440,11 @@ Sample usage of this API can be found in SampleCode.demonstrateSparqlAPI(). Thi
439440
// vertex named "lop"
440441
" ?lop <blaze:name> \"lop\" . " +
441442
// created by ?c
442-
" <<?c_id ?x ?lop>> rdfs:label \"created\" . " +
443+
" <<?c_id ?x ?lop>> rdf:type <blaze:created> . " +
443444
// whose age is 29
444445
" ?c_id <blaze:age> \"29\"^^xsd:int . " +
445446
// created by ?a
446-
" <<?a_id ?y ?lop>> rdfs:label \"created\" . " +
447+
" <<?a_id ?y ?lop>> rdf:type <blaze:created> . " +
447448
// gather names
448449
" ?a_id <blaze:name> ?a . " +
449450
" ?c_id <blaze:name> ?c . " +

crew.rdf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
blaze:tinkergraph rdfs:label "software" ;
1+
blaze:tinkergraph rdf:type blaze:software ;
22
blaze:name "tinkergraph" .
33

4-
blaze:gremlin rdfs:label "software" ;
4+
blaze:gremlin rdf:type blaze:software ;
55
blaze:name "gremlin" ;
66
blaze:48f63 blaze:tinkergraph .
77

8-
<<blaze:gremlin blaze:48f63 blaze:tinkergraph>> rdfs:label "traverses" .
8+
<<blaze:gremlin blaze:48f63 blaze:tinkergraph>> rdf:type blaze:traverses .
99

10-
blaze:daniel rdfs:label "person" ;
10+
blaze:daniel rdf:type blaze:person ;
1111
blaze:name "daniel" ;
1212
blaze:81056 blaze:tinkergraph ;
1313
blaze:e09ac blaze:gremlin ;
1414
blaze:location "spremberg" ;
1515
blaze:location "kaiserslautern" ;
1616
blaze:location "aachen" .
1717

18-
<<blaze:daniel blaze:81056 blaze:tinkergraph>> rdfs:label "uses" ;
18+
<<blaze:daniel blaze:81056 blaze:tinkergraph>> rdf:type blaze:uses ;
1919
blaze:skill "3"^^xsd:int .
20-
<<blaze:daniel blaze:e09ac blaze:gremlin>> rdfs:label "uses" ;
20+
<<blaze:daniel blaze:e09ac blaze:gremlin>> rdf:type blaze:uses ;
2121
blaze:skill "5"^^xsd:int .
2222
<<blaze:daniel blaze:location "spremberg">> blaze:startTime "1982"^^xsd:int ;
2323
blaze:endTime "2005"^^xsd:int .
2424
<<blaze:daniel blaze:location "kaiserslautern">> blaze:startTime "2005"^^xsd:int ;
2525
blaze:endTime "2009"^^xsd:int .
2626
<<blaze:daniel blaze:location "aachen">> blaze:startTime "2009"^^xsd:int .
2727

28-
blaze:marko rdfs:label "person" ;
28+
blaze:marko rdf:type blaze:person ;
2929
blaze:name "marko" ;
3030
blaze:42af2 blaze:gremlin ;
3131
blaze:4edec blaze:gremlin ;
@@ -36,13 +36,13 @@
3636
blaze:location "brussels" ;
3737
blaze:location "santa fe" .
3838

39-
<<blaze:marko blaze:42af2 blaze:gremlin>> rdfs:label "develops" ;
39+
<<blaze:marko blaze:42af2 blaze:gremlin>> rdf:type blaze:develops ;
4040
blaze:since "2009"^^xsd:int .
41-
<<blaze:marko blaze:4edec blaze:gremlin>> rdfs:label "uses" ;
41+
<<blaze:marko blaze:4edec blaze:gremlin>> rdf:type blaze:uses ;
4242
blaze:skill "4"^^xsd:int .
43-
<<blaze:marko blaze:61d50 blaze:tinkergraph>> rdfs:label "develops" ;
43+
<<blaze:marko blaze:61d50 blaze:tinkergraph>> rdf:type blaze:develops ;
4444
blaze:since "2010"^^xsd:int .
45-
<<blaze:marko blaze:68c12 blaze:tinkergraph>> rdfs:label "uses" ;
45+
<<blaze:marko blaze:68c12 blaze:tinkergraph>> rdf:type blaze:uses ;
4646
blaze:skill "5"^^xsd:int .
4747
<<blaze:marko blaze:location "san diego">> blaze:startTime "1997"^^xsd:int ;
4848
blaze:endTime "2001"^^xsd:int .
@@ -52,7 +52,7 @@
5252
blaze:endTime "2005"^^xsd:int .
5353
<<blaze:marko blaze:location "santa fe">> blaze:startTime "2005"^^xsd:int .
5454

55-
blaze:stephen rdfs:label "person" ;
55+
blaze:stephen rdf:type blaze:person ;
5656
blaze:name "stephen" ;
5757
blaze:15869 blaze:tinkergraph ;
5858
blaze:1e9c3 blaze:gremlin ;
@@ -62,21 +62,21 @@
6262
blaze:location "dulles" ;
6363
blaze:location "purcellville" .
6464

65-
<<blaze:stephen blaze:15869 blaze:tinkergraph>> rdfs:label "develops" ;
65+
<<blaze:stephen blaze:15869 blaze:tinkergraph>> rdf:type blaze:develops ;
6666
blaze:since "2011"^^xsd:int .
67-
<<blaze:stephen blaze:1e9c3 blaze:gremlin>> rdfs:label "develops" ;
67+
<<blaze:stephen blaze:1e9c3 blaze:gremlin>> rdf:type blaze:develops ;
6868
blaze:since "2010"^^xsd:int .
69-
<<blaze:stephen blaze:bf48d blaze:tinkergraph>> rdfs:label "uses" ;
69+
<<blaze:stephen blaze:bf48d blaze:tinkergraph>> rdf:type blaze:uses ;
7070
blaze:skill "4"^^xsd:int .
71-
<<blaze:stephen blaze:bff3c blaze:gremlin>> rdfs:label "uses" ;
71+
<<blaze:stephen blaze:bff3c blaze:gremlin>> rdf:type blaze:uses ;
7272
blaze:skill "5"^^xsd:int .
7373
<<blaze:stephen blaze:location "centreville">> blaze:startTime "1990"^^xsd:int ;
7474
blaze:endTime "2000"^^xsd:int .
7575
<<blaze:stephen blaze:location "dulles">> blaze:startTime "2000"^^xsd:int ;
7676
blaze:endTime "2006"^^xsd:int .
7777
<<blaze:stephen blaze:location "purcellville">> blaze:startTime "2006"^^xsd:int .
7878

79-
blaze:matthias rdfs:label "person" ;
79+
blaze:matthias rdf:type blaze:person ;
8080
blaze:name "matthias" ;
8181
blaze:7373e blaze:gremlin ;
8282
blaze:e5a5d blaze:gremlin ;
@@ -86,11 +86,11 @@
8686
blaze:location "oakland" ;
8787
blaze:location "seattle" .
8888

89-
<<blaze:matthias blaze:7373e blaze:gremlin>> rdfs:label "develops" ;
89+
<<blaze:matthias blaze:7373e blaze:gremlin>> rdf:type blaze:develops ;
9090
blaze:since "2012"^^xsd:int .
91-
<<blaze:matthias blaze:e5a5d blaze:gremlin>> rdfs:label "uses" ;
91+
<<blaze:matthias blaze:e5a5d blaze:gremlin>> rdf:type blaze:uses ;
9292
blaze:skill "3"^^xsd:int .
93-
<<blaze:matthias blaze:ef89a blaze:tinkergraph>> rdfs:label "uses" ;
93+
<<blaze:matthias blaze:ef89a blaze:tinkergraph>> rdf:type blaze:uses ;
9494
blaze:skill "3"^^xsd:int .
9595
<<blaze:matthias blaze:location "bremen">> blaze:startTime "2004"^^xsd:int ;
9696
blaze:endTime "2007"^^xsd:int .

src/main/java/com/blazegraph/gremlin/structure/BlazeEdge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* <p/>
4646
* <pre>
4747
* :fromId :edgeId :toId .
48-
* <<:fromId :edgeId :toId>> rdfs:label "label" .
48+
* <<:fromId :edgeId :toId>> rdf:type :label .
4949
* </pre>
5050
* <p/>
5151
* Edge properties are represented as follows:

0 commit comments

Comments
 (0)