@@ -58,85 +58,72 @@ HTTP/1.1 200 OK
58
58
<http://www.w3.org/ns/posix/stat#size> "780" .
59
59
```
60
60
61
- #### Globbing (inlining on GET)
62
-
63
- We have found that in some cases, using the existing LDP features was not
64
- enough. For instance, to optimize certain applications we needed to aggregate
65
- all RDF resources from a container and retrieve them with a single GET
66
- operation. We implemented this feature on the servers and decided to call it
67
- "globbing". Similar to [ UNIX shell
68
- glob] ( https://en.wikipedia.org/wiki/Glob_(programming) ) , doing a GET on any URI
69
- which ends with a ` * ` will return an aggregate view of all the resources that
70
- match the indicated pattern.
71
-
72
- For example, let's assume that ` /data/res1 ` and ` /data/res2 ` are two resources
73
- containing one triple each, which defines their type as follows:
74
-
75
- For * res1* :
61
+ #### Globbing (` GET ` the merged RDF graph of a container)
62
+
63
+ To optimize certain applications,
64
+ this specification defines a single ` GET ` operation
65
+ that provides access to an aggregation of the RDF resources in a container.
66
+ We refer to this feature as _ globbing_ ,
67
+ since it provides a subset of the functionality
68
+ offered by the [ UNIX shell glob] ( https://en.wikipedia.org/wiki/Glob_(programming) ) .
69
+ Consider a container to which the user has _ Read_ access,
70
+ which will have a URL ending in ` / ` .
71
+ If we append a ` * ` to that URL (so it ends in ` /* ` ),
72
+ we obtain the URL of a resource that,
73
+ in response to a ` GET ` request,
74
+ returns the [ RDF graph merge] ( https://www.w3.org/TR/rdf-mt/#graphdefs )
75
+ of all of the container's direct child resources
76
+ that are available in an RDF format
77
+ and for which the user has _ Read_ access.
78
+ Resources with syntax errors can be ignored or be partially included,
79
+ but they do not cause a failure.
80
+ The response can contain additional metadata about the container,
81
+ such as the list of resources.
82
+
83
+ For example, consider a container ` /data ` that contains the following resources:
84
+ - ` resource1.ttl `
85
+ - ` resource2.ttl `
86
+ - ` hidden3.ttl `
87
+ - ` resource4.txt `
88
+
89
+ The user performing the request had read access to ` /data ` ,
90
+ ` resource1.ttl ` and ` resource2.ttl ` ,
91
+ but not to ` hidden3.ttl ` .
92
+ Let's assume that ` /data/resource1.ttl ` and ` /data/resource2.ttl `
93
+ contain one triple each:
76
94
77
95
``` ttl
78
96
<> a <https://example.org/ns/type#One> .
79
97
```
80
98
81
- For * res2* :
82
-
83
99
``` ttl
84
100
<> a <https://example.org/ns/type#Two> .
85
101
```
86
102
87
- If one would like to fetch all resources of a container beginning with ` res `
88
- (e.g. ` /data/res1 ` , ` /data/res2 ` ) in one request, they could do a GET on
89
- ` /data/res* ` as follows.
90
-
91
- REQUEST:
92
-
93
- ``` http
94
- GET /data/res* HTTP/1.1
95
- Host: example.org
96
- ```
97
-
98
- RESPONSE:
99
-
100
- ``` http
101
- HTTP/1.1 200 OK
102
- ```
103
- ``` ttl
104
- <res1>
105
- a <https://example.org/ns/type#One> .
106
-
107
- <res2>
108
- a <https://example.org/ns/type#Two> .
109
- ```
110
-
111
- Alternatively, one could ask the server to inline * all* resources of a
112
- container, which includes the triples corresponding to the container itself:
113
-
114
- REQUEST:
103
+ Then a request to ` /data/* `
104
+ will return a serialization of the [ RDF graph merge] ( https://www.w3.org/TR/rdf-mt/#graphdefs )
105
+ of the datasets contained in ` resource1.ttl ` and ` resource2.ttl ` :
115
106
116
107
``` http
117
108
GET /data/* HTTP/1.1
118
109
Host: example.org
119
110
```
120
111
121
- RESPONSE:
122
-
123
112
``` http
124
113
HTTP/1.1 200 OK
125
114
```
126
115
``` ttl
127
116
<>
128
117
a <http://www.w3.org/ns/ldp#BasicContainer> ;
129
- <http://www.w3.org/ns/ldp#contains> <res1 >, <res2 > .
118
+ <http://www.w3.org/ns/ldp#contains> <resource1.ttl >, <resource2.ttl > .
130
119
131
- <res1 >
120
+ <resource1.ttl >
132
121
a <https://example.org/ns/type#One> .
133
122
134
- <res2 >
123
+ <resource2.ttl >
135
124
a <https://example.org/ns/type#Two> .
136
125
```
137
126
138
- Note: the aggregation process is not currently recursive, therefore it will not
139
- apply to children containers.
140
127
141
128
### Alternative: using SPARQL
142
129
0 commit comments