RWW Interaction & ACL Testing using cURL

What?

The Linked Data Platform (LDP) specification from the W3C outlines how HTTP interaction patterns can be used to facilitate loosely coupled Create, Read, Update (Write), and Delete ("CRUD") operations, at World Wide Web scale.

Why?

The "Write" dimension of the World Wide Web has been underutilized since the Web's inception. This has lead to a proliferation of Web Applications and Services that confusingly conflate otherwise distinct functionality realms in the way they work with entities, both "real world" and digital, and their --

How?

Different File Usage

1: PKCS 12 File Usage


curl --cert {pkcs#12-file-name}:{pwd} --cert-type P12 -k -I {resource-url}

2: Secure PEM File Usage


curl --cert {cert-pem-file-name} --key {private-key-pem-file-name} -k -I {resource-url}

LDP QA

1: Basic Metadata Interrogation


curl -X OPTIONS -IH "Accept: text/turtle" http://example.com/DAV/home/demo/Public/

2: Basic Metadata and Content Interrogation


curl -iH "Accept: text/turtle" http://example.com/DAV/home/demo/Public/

3: INSERT via POST with Slug header


curl -X POST -ik -H "Content-Type:text/turtle"  -E MyCertificate-ODS-QA.pem:1234  --data-binary @profile2.ttl -H "Slug: profile2.ttl" https://example.com/DAV/home/demo/Public/

4: INSERT via POST without Slug header


curl -X POST -ik -H "Content-Type:text/turtle"  -E MyCertificate-ODS-QA.pem:1234  --data-binary @profile2.ttl https://example.com/DAV/home/demo/Public/

5: INSERT via Inline Data without Slug header


curl -X POST -ik -H "Content-Type:text/turtle"  -E MyCertificate-ODS-QA.pem:1234  --data-binary "<> a foaf:Document" https://example.com/DAV/home/demo/Public/

6: Collection (Folder) Creation

7: Without Slug


curl -k -i -E MyCertificate-ODS-QA.pem:king6c/ -H "Content-Type: text/turtle" -X POST  --data-binary @ldp_container.ttl

Methods

PUT Method

To replace the content of the Document at <https://example.com/DAV/home/demo/Public/example.ttl> with "<#this> <#relation> <#that> ."

PUT Method for creating a remote document from a local document


curl -X PUT -k -i -E MyCertificate-ODS-QA.pem:1234 -H "Content-Type: text/turtle" -data-binary @test.ttl https://example.com/DAV/home/demo/Public/

MKCOL Method


curl -X MKCOL -k -i -E MyCertificate-ODS-QA.pem:1234 https://example.com/DAV/home/demo/Public/container2/

HTTP PATCH method for SPARQL 1.1 INSERT

HTTP POST method for SPARQL SELECT

Related