|
118 | 118 | :ext "http://mu.semte.ch/vocabularies/ext/"
|
119 | 119 | :schema "http://schema.org/"
|
120 | 120 | :books "http://example.com/books/"
|
121 |
| - :favorites "http://mu.semte.ch/favorites/") |
| 121 | + :favorites "http://mu.semte.ch/favorites/" |
| 122 | + :geo "http://www.opengis.net/ont/geosparql#") |
122 | 123 |
|
123 | 124 | (acl:supply-allowed-group "public")
|
124 | 125 |
|
|
142 | 143 |
|
143 | 144 | (acl:define-graph acl::public-data ("http://mu.semte.ch/graphs/public")
|
144 | 145 | ("foaf:Person" acl::-> acl::_)
|
145 |
| - ("schema:Book" acl::-> acl::_)) |
| 146 | + ("schema:Book" acl::-> acl::_) |
| 147 | + ("geo:Geometry" acl::-> acl::_)) |
146 | 148 | (acl:define-graph acl::user-data ("http://mu.semte.ch/graphs/personal/")
|
147 | 149 | (acl::_
|
148 | 150 | acl::-> "ext:hasBook"
|
|
364 | 366 | }"))
|
365 | 367 |
|
366 | 368 | (with-impersonation-for :joll
|
| 369 | + (quad-transformations:define-quad-transformation (quad method) |
| 370 | + ;; fix wktLiteral string representation |
| 371 | + (let* ((object (quad:object quad)) |
| 372 | + (datatype-match (and |
| 373 | + (sparql-parser:match-p object) |
| 374 | + (eq (sparql-parser:match-term object) 'ebnf::|RDFLiteral|) |
| 375 | + (= 3 (length (sparql-parser:match-submatches object))) |
| 376 | + (third (sparql-parser:match-submatches object)))) |
| 377 | + (datatype-uri (and datatype-match |
| 378 | + (detect-quads::quad-term-uri |
| 379 | + (first |
| 380 | + (sparql-parser:match-submatches datatype-match))))) |
| 381 | + (string-value (and (sparql-parser:match-p object) |
| 382 | + (eq (sparql-parser:match-term object) 'ebnf::|RDFLiteral|) |
| 383 | + (sparql-manipulation:string-literal-string |
| 384 | + (first (sparql-parser:match-submatches object)))))) |
| 385 | + (if (and datatype-uri |
| 386 | + (string= "http://www.opengis.net/ont/geosparql#wktLiteral" datatype-uri) |
| 387 | + (search "https://www.opengis.net/" string-value)) |
| 388 | + (let ((new-quad (quad:copy quad)) |
| 389 | + (new-string (cl-ppcre:regex-replace "https://" string-value "http://"))) |
| 390 | + (setf (quad:object new-quad) |
| 391 | + (sparql-manipulation:make-rdfliteral new-string :datatype-match datatype-match)) |
| 392 | + (quad-transformations:update new-quad)) |
| 393 | + (quad-transformations:keep)))) |
| 394 | + |
367 | 395 | (format t "~&Joll can write a book title with the right URI and no type.~%")
|
368 | 396 |
|
369 | 397 | (server:execute-query-for-context
|
|
462 | 490 | (server:execute-query-for-context
|
463 | 491 | "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
464 | 492 | PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
465 |
| - INSERT DATA { <http://book-store.example.com/books/my-book> mu:uuid \"123\"^^xsd:string. }")) |
| 493 | + INSERT DATA { <http://book-store.example.com/books/my-book> mu:uuid \"123\"^^xsd:string. }") |
| 494 | + |
| 495 | + (server:execute-query-for-context |
| 496 | + "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> |
| 497 | + PREFIX ext: <http://mu.semte.ch/vocabularies/ext/> |
| 498 | + PREFIX mu: <http://mu.semte.ch/vocabularies/core/> |
| 499 | + PREFIX geo: <http://www.opengis.net/ont/geosparql#> |
| 500 | + INSERT DATA { |
| 501 | + <http://book-store.example.com/geometries/a> |
| 502 | + a geo:Geometry; |
| 503 | + geo:asWKT \"<https://www.opengis.net/def/crs/EPSG/0/31370> POINT (155822.2 132723.18)\"^^<http://www.opengis.net/ont/geosparql#wktLiteral>. |
| 504 | + }")) |
| 505 | + |
466 | 506 | (with-impersonation-for :jack
|
467 | 507 | ;; can insert some random content
|
468 | 508 | (server:execute-query-for-context
|
|
499 | 539 | "PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
500 | 540 | INSERT DATA {
|
501 | 541 | ext:myDisplay ext:anotherThing \"Another thing\".
|
502 |
| - }") |
503 |
| - ))) |
| 542 | + }")))) |
0 commit comments